536ae32
%global gem_name rugged
536ae32
536ae32
Summary:       Rugged is a Ruby binding to the libgit2 library
536ae32
Name:          rubygem-%{gem_name}
1e82eb9
Version:       0.23.3
1e82eb9
Release:       1%{?dist}
536ae32
Group:         Development/Languages
536ae32
License:       MIT
3513793
URL:           https://github.com/libgit2/rugged
1e82eb9
Source0:       https://rubygems.org/gems/%{gem_name}-%{version}.gem
536ae32
# The test directory for this version is incomplete due to gemspec bug.
536ae32
# Upstream has removed test and Rakefile from gem in future versions.
536ae32
# https://github.com/libgit2/rugged/issues/262
536ae32
# https://github.com/libgit2/rugged/pull/263
536ae32
# This is how we are getting the tests (Source1)
69cac04
#  git clone git://github.com/libgit2/rugged.git
536ae32
#  cd rugged/
1e82eb9
#  git checkout v0.23.3
1e82eb9
#  tar cfz rugged-0.23.3-test.tgz test/ Rakefile
1e82eb9
Source1:       %{gem_name}-%{version}-test.tgz
536ae32
Requires:      ruby(rubygems)
d5eb88e
Requires:      ruby
d5eb88e
BuildRequires: ruby
536ae32
BuildRequires: git
f191350
BuildRequires: cmake
536ae32
BuildRequires: libgit2-devel
536ae32
BuildRequires: ruby-devel
536ae32
BuildRequires: rubygem(minitest)
69cac04
BuildRequires: rubygems-devel
536ae32
Provides:      rubygem(%{gem_name}) = %{version}
536ae32
%{?rubygems_default_filter}
536ae32
536ae32
%description
536ae32
Rugged is a Ruby bindings to the libgit2W C Git library. This is
536ae32
for testing and using the libgit2 library in a language that is awesome.
536ae32
536ae32
536ae32
%package doc
536ae32
Summary:       Documentation for %{name}
536ae32
Group:         Documentation
536ae32
Requires:      %{name} = %{version}-%{release}
536ae32
BuildArch:     noarch
536ae32
536ae32
%description doc
536ae32
Documentation for %{name}
536ae32
536ae32
%prep
1e82eb9
gem unpack %{SOURCE0}
536ae32
1e82eb9
%setup -q -D -T -n  %{gem_name}-%{version}
1e82eb9
1e82eb9
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
536ae32
536ae32
rm -rf vendor
f23e2b0
# Remove the bundled libraries from gemspec
060ed9b
sed -i -e 's\, "vendor[^,]*"\\g' rugged.gemspec
536ae32
6266d87
# The build system requres libgit2's version.h to be present, and defaults to
6266d87
# using the vendor'd copy. Use the system copy instead.
6266d87
sed -i -e 's|LIBGIT2_DIR = .*|LIBGIT2_DIR = "/usr"|' ext/rugged/extconf.rb
6266d87
536ae32
%build
060ed9b
export CONFIGURE_ARGS="--with-cflags='%{optflags}' --use-system-libraries"
6266d87
536ae32
gem build %{gem_name}.gemspec
3513793
%gem_install
536ae32
536ae32
%install
536ae32
mkdir -p %{buildroot}%{gem_dir}
536ae32
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
536ae32
536ae32
536ae32
# move C extensions to the extdir.
ee63891
%if 0%{?fedora} >= 21
ee63891
mkdir -p %{buildroot}%{gem_extdir_mri}/
ee63891
cp -a .%{gem_extdir_mri}/{gem.build_complete,%{gem_name}/} %{buildroot}%{gem_extdir_mri}/
ee63891
%else
060ed9b
mkdir -p %{buildroot}%{gem_extdir_mri}/ext/%{gem_name}/
060ed9b
mv %{buildroot}%{gem_instdir}/ext/%{gem_name}/rugged.so %{buildroot}%{gem_extdir_mri}/ext/%{gem_name}/
ee63891
%endif
536ae32
536ae32
# We don't need those files anymore.
536ae32
rm -rf %{buildroot}%{gem_instdir}/ext/
536ae32
536ae32
%check
536ae32
pushd .%{gem_instdir}
1e82eb9
tar xfz %{SOURCE1}
536ae32
export LANG="en_US.UTF-8"
536ae32
git config --global user.name John Doe
060ed9b
# Comment out the test until we get the minitest/autorun figured out
060ed9b
# testrb -Ilib test/*test.rb
536ae32
popd
536ae32
536ae32
%files
536ae32
%doc %{gem_instdir}/LICENSE
536ae32
%doc %{gem_instdir}/README.md
536ae32
%dir %{gem_instdir}
536ae32
%{gem_libdir}
536ae32
%{gem_extdir_mri}
536ae32
%exclude %{gem_cache}
536ae32
%{gem_spec}
536ae32
536ae32
%files doc
536ae32
%doc %{gem_docdir}
536ae32
536ae32
%changelog
1e82eb9
* Thu Feb 18 2016 Jiri Popelka <jpopelka@redhat.com> - 0.23.3-1
1e82eb9
- Update to version 0.23.3
1e82eb9
098fc79
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.0-0.20150733git233da19
098fc79
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
098fc79
bd2c814
* Mon Jan 11 2016 Vít Ondruch <vondruch@redhat.com> - 0.23.0-0.20150732git233da19
bd2c814
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3
bd2c814
ec84a95
* Fri Jul 31 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@Foobar.org> - 0.22.2-4.20150731git233da19
ec84a95
- Bump to latest git
ec84a95
547ad9c
* Fri Jul 31 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.22.2-3
547ad9c
- Rebuilt for libgit2-0.23.0 and libgit2-glib-0.23
547ad9c
fb72a14
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22.2-2
fb72a14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
fb72a14
3513793
* Mon May 25 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.22.2-1
3513793
- Update to 0.22.2 (rhbz#1222540)
3513793
- Use HTTPS urls
3513793
6266d87
* Tue May 05 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.22.1-0.1.b1
6266d87
- Update to version 0.22.1b1 (rhbz#1166414)
6266d87
911945c
* Fri Jan 16 2015 Vít Ondruch <vondruch@redhat.com> - 0.21.0-4
911945c
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.2
911945c
bf4ffde
* Fri Dec 26 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.21.0-3
ee63891
- Install gem.build_complete on F-21 and move extension file to the
ee63891
  correct location (bug 1176450)
ee63891
06cb5b7
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.21.0-2
06cb5b7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
06cb5b7
060ed9b
* Thu Jul 03 2014 Troy Dawson <tdawson@redhat.com> - 0.21.0-1
060ed9b
- Update to version 0.21.0
060ed9b
- Comment out the test until we get minitest/autorun figured out
060ed9b
c738742
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19.0-7
c738742
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c738742
d5eb88e
* Wed Feb 05 2014 Troy Dawson <tdawson@redhat.com> - 0.19.0-6
d5eb88e
- Misc packaging fixes (#1061552) Ken Dreyer
d5eb88e
69cac04
* Mon Jan 06 2014 Troy Dawson <tdawson@redhat.com> - 0.19.0-5
69cac04
- Misc spec file fixes (#1048958) Ken Dreyer
f23e2b0
- Change vendor patch to sed command
69cac04
536ae32
* Mon Sep 09 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-4
536ae32
- Update comments about test source
536ae32
- Fix zero length files in test
536ae32
536ae32
* Fri Sep 06 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-3
536ae32
- Added full test directory
536ae32
- use minitest for tests
536ae32
- Added .so file provides filter
536ae32
536ae32
* Thu Aug 22 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-2
536ae32
- remove vendor directory and patch gemspec to reflect that
536ae32
- export LIBGIT2_PATH before building to use system git2
536ae32
536ae32
* Mon Jul 22 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-1
536ae32
- Updated to latest release - 0.19.0
536ae32
- Cleaned up bad tests
536ae32
- Comment out check, due to bad exit code from successful tests
536ae32
536ae32
* Mon Jul 22 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-1
536ae32
- Updated to latest release - 0.19.0
536ae32
- Cleaned up bad tests
536ae32
536ae32
* Tue Jul 09 2013 Troy Dawson <tdawson@redhat.com> - 0.16.0-3
536ae32
- Change build section to use current ruby guidelines
536ae32
- move lib/rugged/rugged.so instead of ext/rugged/rugged.so
536ae32
- move rugged.so into the correct directory
536ae32
- cleanup test, now runs without problems
536ae32
536ae32
* Tue Jul 02 2013 Troy Dawson <tdawson@redhat.com> - 0.16.0-2
536ae32
- Make macro's more consistant
536ae32
- Remove extra rugged.so
536ae32
- Set correct permissions for rugged.so
536ae32
- Run test (thanks to Axilleas Pipinellis for this)
536ae32
- Add libgit2-devel to buildrequires - this causes the build to
536ae32
  use system libgit2 instead of bundled version.
536ae32
536ae32
* Mon Mar 18 2013 Troy Dawson <tdawson@redhat.com> - 0.16.0-1
536ae32
- Initial package