Blob Blame History Raw
%global gem_name bundler


%global thorversion 0.14.6
%global rdocversion 3.9.4

%{!?enable_test: %global enable_test 0}

Summary: Library and utilities to manage a Ruby application's gem dependencies
Name: rubygem-%{gem_name}
Version: 1.0.21
Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL: http://gembundler.com
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
Patch0: bundler-prevent-test-failures-with-ruby-1.9.3.patch
Patch1: bundler-add-support-for-binary-extensions-in-dedicated-folde.patch
Requires: ruby(rubygems)
Requires: ruby(abi) = 1.9.1
Requires: rubygem(thor) = %{thorversion}
BuildRequires: rubygems-devel
%if 0%{enable_test} > 0
BuildRequires: ruby-devel
BuildRequires: rubygem(rake)
BuildRequires: rubygem(thor) = %{thorversion}
BuildRequires: rubygem(fakeweb) = 1.3.0
BuildRequires: rubygem(builder) = 2.1.2
# Use rspec-core until rspec are not migrated to RSpec 2.x
BuildRequires: rubygem(rspec-core)
BuildRequires: git sudo
%endif
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}

%description
Bundler manages an application's dependencies through its entire life, across
many machines, systematically and repeatably

%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires:%{name} = %{version}-%{release}

%description doc
Documentation for %{name}


%prep
%setup -q -c -T
mkdir -p .%{gem_dir}
gem install --local --install-dir .%{gem_dir} \
            --force --rdoc %{SOURCE0}

pushd .%{gem_instdir}
%patch0 -p1
%patch1 -p1
popd

%build

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/

mkdir -p %{buildroot}/%{_bindir}
mv %{buildroot}%{gem_dir}/bin/* %{buildroot}/%{_bindir}
rmdir %{buildroot}%{gem_dir}/bin
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
rm %{buildroot}/%{gem_instdir}/.gitignore

# Remove bundled Thor
rm -rf %{buildroot}/%{gem_libdir}/bundler/vendor

# Man pages are used by Bundler internally, do not remove them!
mkdir -p %{buildroot}%{_mandir}/man5
cp -a %{buildroot}%{gem_libdir}/bundler/man/gemfile.5 %{buildroot}%{_mandir}/man5
mkdir -p %{buildroot}%{_mandir}/man1
for i in bundle bundle-config bundle-exec bundle-install bundle-package bundle-update 
do
        cp -a %{buildroot}%{gem_libdir}/bundler/man/$i %{buildroot}%{_mandir}/man1/`echo $i.1`
done

# Remove the man pages sources
rm -r %{buildroot}%{gem_instdir}/man/

# Specs are still not passing. There are several reasons:
# 1) Depency on git, git needs modified global configuration settings, this
#    would mess with developer computer, requires sudo etc.
# 2) Test needs local copy of rake, fakeweb and builder gems, otherwise they
#    are installed during runtime.
# There might be other issues I am not aware of ATM.
#
# Nevertheless, specs should be possible to execute after installation.
#
%if 0%{enable_test} > 0
%check
pushd %{buildroot}%{gem_instdir}
RUBYOPT="$RUBYOPT -I%{gem_dir}/gems/thor-%{thorversion}/lib -I%{gem_dir}/gems/rdoc-%{rdocversion}/lib" rspec spec/
# The test suite for 1.0.15 fails with two errors:
# https://github.com/carlhuda/bundler/issues/1290
# https://github.com/carlhuda/bundler/issues/986
# Neither of them should have impact on Bundler functionality.
rm -rf %{buildroot}%{gem_instdir}/tmp/
%endif

%files
%dir %{gem_instdir}
%{gem_libdir}
%doc %{gem_instdir}/LICENSE
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/README.md
%{gem_instdir}/.travis.yml
%{_bindir}/bundle
%{gem_instdir}/bin
%{gem_cache}
%{gem_spec}
%doc %{_mandir}/man1/*
%doc %{_mandir}/man5/*

%files doc
%doc %{gem_instdir}/ISSUES.md
%doc %{gem_instdir}/UPGRADING.md
%{gem_instdir}/Rakefile
%{gem_instdir}/spec
%{gem_instdir}/%{gem_name}.gemspec
%doc %{gem_docdir}

%changelog
* Wed Feb 01 2012 Vít Ondruch <vondruch@redhat.com> - 1.0.21-1
- Rebuilt for Ruby 1.9.3.
- Update to Bundler 1.0.21.

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Jul 07 2011 Vít Ondruch <vondruch@redhat.com> - 1.0.15-1
- Updated to Bundler 1.0.15

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Feb 04 2011 Vít Ondruch <vondruch@redhat.com> - 1.0.10-1
- Upstream update

* Thu Jan 27 2011 Vít Ondruch <vondruch@redhat.com> - 1.0.9-2
- More concise summary
- Do not remove manpages, they are used internally
- Added buildroot cleanup in clean section

* Mon Jan 24 2011 Vít Ondruch <vondruch@redhat.com> - 1.0.9-1
- Bumped to Bundler 1.0.9
- Installed manual pages
- Removed obsolete buildroot cleanup

* Mon Nov 1 2010 Jozef Zigmund <jzigmund@redhat.com> - 1.0.3-2
- Add ruby(abi) dependency
- Add using macro %{geminstdir} in files section
- Add subpackage doc for doc files
- Removed .gitignore file
- Removed rubygem-thor from vendor folder
- Add dependency rubygem(thor)

* Mon Oct 18 2010 Jozef Zigmund <jzigmund@redhat.com> - 1.0.3-1
- Initial package