259116
%global gem_name bundler
259116
259116
# Enable test when building on local.
d17082
%bcond_with tests
259116
259116
# Ideally it should be checked against FileUtils::VERSION.
259116
# https://github.com/ruby/fileutils/pull/12
259116
%global fileutils_version 0.7.2
259116
%global molinillo_version 0.6.4
259116
%global net_http_persistent_version 2.9.4
259116
%global thor_version 0.20.0
259116
259116
Name: rubygem-%{gem_name}
259116
Version: 1.16.1
d17082
Release: 4%{?dist}
259116
Summary: Library and utilities to manage a Ruby application's gem dependencies
259116
Group: Development/Languages
259116
License: MIT
259116
URL: http://bundler.io
259116
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
259116
# git clone https://github.com/bundler/bundler.git && cd bundler
259116
# git checkout v1.16.1 && tar czvf bundler-1.16.1-specs.tgz spec/
259116
Source1: %{gem_name}-%{version}-specs.tgz
d17082
# Raise an error or print a warning in dependency confusion cases.
d17082
# https://github.com/rubygems/rubygems/pull/5029
d17082
Patch0: ruby-bundler-raise-error-in-dependency-confusion.patch
d17082
Patch1: ruby-bundler-raise-error-in-dependency-confusion-tests.patch
259116
# ruby package has just soft dependency on rubygem(io-console), while
259116
# Bundler always requires it.
259116
Requires: rubygem(io-console)
259116
BuildRequires: ruby(release)
259116
BuildRequires: rubygems-devel
259116
BuildRequires: ruby
d17082
%if %{with tests}
259116
BuildRequires: ruby-devel
259116
BuildRequires: rubygem(rspec) >= 3.0
d17082
BuildRequires: rubygem(rake)
259116
BuildRequires: git
259116
BuildRequires: %{_bindir}/ps
259116
%endif
259116
# https://github.com/bundler/bundler/issues/3647
259116
Provides: bundled(rubygem-fileutils) = %{fileutils_version}
259116
Provides: bundled(rubygem-molinillo) = %{molinillo_version}
259116
Provides: bundled(rubygem-net-http-persisntent) = %{net_http_persistent_version}
259116
Provides: bundled(rubygem-thor) = %{thor_version}
259116
BuildArch: noarch
259116
259116
%description
259116
Bundler manages an application's dependencies through its entire life, across
259116
many machines, systematically and repeatably.
259116
259116
259116
%package doc
259116
Summary: Documentation for %{name}
259116
Group: Documentation
259116
Requires: %{name} = %{version}-%{release}
259116
BuildArch: noarch
259116
259116
%description doc
259116
Documentation for %{name}.
259116
259116
%prep
259116
%setup -q -c -T
259116
%gem_install -n %{SOURCE0}
259116
d17082
pushd .%{gem_instdir}
d17082
%patch0 -p1
d17082
popd
d17082
259116
%build
259116
259116
%install
259116
mkdir -p %{buildroot}%{gem_dir}
259116
cp -a .%{gem_dir}/* \
259116
        %{buildroot}%{gem_dir}/
259116
259116
259116
mkdir -p %{buildroot}%{_bindir}
259116
cp -a .%{_bindir}/* \
259116
        %{buildroot}%{_bindir}/
259116
259116
find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x
259116
259116
# Remove unnecessary executable bit.
259116
# https://github.com/bundler/bundler/pull/6285
259116
chmod a-x %{buildroot}%{gem_libdir}/bundler/templates/Executable
259116
259116
# Man pages are used by Bundler internally, do not remove them!
259116
for n in 5 1; do
259116
  mkdir -p %{buildroot}%{_mandir}/man${n}
259116
  for file in %{buildroot}%{gem_instdir}/man/*.${n}; do
259116
    base_name=$(basename "${file}")
259116
    cp -a "${file}" "%{buildroot}%{_mandir}/man${n}/${base_name}"
259116
  done
259116
done
259116
259116
%check
259116
pushd .%{gem_instdir}
259116
# Check bundled libraries.
259116
[ `ls lib/bundler/vendor | wc -l` == 4 ]
259116
259116
ruby -e '
259116
  module Bundler; end
259116
  require "./lib/bundler/vendor/fileutils/lib/fileutils.rb"'
259116
259116
[ `ruby -e '
259116
  module Bundler; end
259116
  require "./lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata"
259116
  puts Bundler::Molinillo::VERSION'` == '%{molinillo_version}' ]
259116
259116
[ `ruby -Ilib -e '
259116
  module Bundler; module Persistent; module Net; module HTTP; end; end; end; end
259116
  require "./lib/bundler/vendor/net-http-persistent/lib/net/http/persistent"
259116
  puts Bundler::Persistent::Net::HTTP::Persistent::VERSION'` == '%{net_http_persistent_version}' ]
259116
259116
[ `ruby -e '
259116
  module Bundler; end
259116
  require "./lib/bundler/vendor/thor/lib/thor/version"
259116
  puts Bundler::Thor::VERSION'` == '%{thor_version}' ]
259116
259116
# Test suite has to be disabled for official build, since it downloads various
259116
# gems, which are not in Fedora or they have different version etc.
259116
# Nevertheless, the test suite should run for local builds.
d17082
%if %{with tests}
259116
259116
tar xzvf %{SOURCE1}
d17082
cat %{PATCH1} | patch -p1
259116
d17082
# Re-create bundler.gemspec used in spec/spec_helper.rb to avoid unnecessary
d17082
# git dependency.
259116
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
259116
259116
# Color tests do not work in mock building process (but this can be tested
259116
# running from shell).
259116
# https://github.com/rpm-software-management/mock/issues/136
259116
sed -i '/^          context "with color" do$/,/^          end$/ s/^/#/' \
259116
  spec/bundler/source_spec.rb
259116
259116
# This test fails due to rubypick.
259116
sed -i '/^      it "like a normally executed executable" do$/,/^      end$/ s/^/#/' \
259116
  spec/commands/exec_spec.rb
259116
259116
# RDoc is not default gem on Fedora.
259116
sed -i '/^    context "given a default gem shippped in ruby" do$/,/^    end$/ s/^/#/' \
259116
  spec/commands/info_spec.rb
259116
d17082
# Avoid unexpected influence of Fedora specific configuration. This forces
d17082
# Ruby to load this empty operating_system.rb instead of operatin_system.rb
d17082
# shipped as part of RubyGems.
d17082
mkdir -p %{_builddir}/rubygems/rubygems/defaults/
d17082
touch %{_builddir}/rubygems/rubygems/defaults/operating_system.rb
d17082
d17082
# Suppress warnings by "git init" on Git >= 2.28.
d17082
# Running `git config --global init.defaultBranch <name>` is not enough.
d17082
# https://github.blog/2020-07-27-highlights-from-git-2-28/
d17082
for file in \
d17082
  lib/bundler/cli/gem.rb \
d17082
  spec/bundler/gem_helper_spec.rb \
d17082
  spec/commands/show_spec.rb \
d17082
  spec/support/builders.rb
d17082
do
d17082
  sed -E -i 's|(git init( --bare)?)|\1 2> /dev/null|' $file
d17082
done
d17082
259116
# It is necessary to require spec_helper.rb explicitly.
259116
# https://github.com/bundler/bundler/pull/5634
d17082
# To pass other tests, set BUNDLE_DISABLE_DEPENDENCY_CONFUSION_CHECK
d17082
RUBYOPT=-I%{_builddir}/rubygems GEM_PATH=/usr/share/gems \
d17082
BUNDLE_DISABLE_DEPENDENCY_CONFUSION_CHECK=1 \
d17082
rspec -rspec_helper spec -f d
259116
259116
%endif
259116
259116
popd
259116
259116
%files
259116
%dir %{gem_instdir}
259116
%{_bindir}/bundle
259116
%{_bindir}/bundler
259116
%exclude %{gem_instdir}/.*
259116
%exclude %{gem_libdir}/bundler/ssl_certs/index.rubygems.org
259116
%exclude %{gem_libdir}/bundler/ssl_certs/rubygems.global.ssl.fastly.net
259116
%exclude %{gem_libdir}/bundler/ssl_certs/rubygems.org
259116
%exclude %{gem_libdir}/bundler/ssl_certs/.document
259116
%license %{gem_instdir}/LICENSE.md
259116
%exclude %{gem_instdir}/bundler.gemspec
259116
%{gem_instdir}/exe
259116
%{gem_libdir}
259116
%exclude %{gem_instdir}/man/*.ronn
259116
%doc %{gem_instdir}/man
259116
%exclude %{gem_cache}
259116
%{gem_spec}
259116
%doc %{_mandir}/man1/*
259116
%doc %{_mandir}/man5/*
259116
259116
%files doc
259116
%doc %{gem_docdir}
259116
%doc %{gem_instdir}/CHANGELOG.md
259116
%doc %{gem_instdir}/README.md
259116
259116
%changelog
d17082
* Mon Dec 13 2021 Jun Aruga <jaruga@redhat.com> - 1.16.1-4
d17082
- Fix Bundler dependency confusion.
d17082
  Resolves: CVE-2020-36327
d17082
259116
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.16.1-3
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
259116
259116
* Thu Feb 01 2018 Vít Ondruch <vondruch@redhat.com> - 1.16.1-2
259116
- Remove unnecessary executable bit.
259116
259116
* Tue Jan 02 2018 Jun Aruga <jaruga@redhat.com> - 1.16.1-1
259116
- Update to Bundler 1.16.1.
259116
259116
* Mon Nov 06 2017 Jun Aruga <jaruga@redhat.com> - 1.16.0-1
259116
- Update to Bundler 1.16.0.
259116
259116
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.7-3
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
259116
259116
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.7-2
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
259116
259116
* Mon Jan 02 2017 Vít Ondruch <vondruch@redhat.com> - 1.13.7-1
259116
- Update to Bundler 1.13.7.
259116
259116
* Fri Dec 16 2016 Vít Ondruch <vondruch@redhat.com> - 1.13.6-1
259116
- Update to Bundler 1.13.6.
259116
259116
* Wed Jul 27 2016 Vít Ondruch <vondruch@redhat.com> - 1.12.5-1
259116
- Update to Bundler 1.12.5.
259116
259116
* Fri Apr 08 2016 Vít Ondruch <vondruch@redhat.com> - 1.10.6-3
259116
- Explicitly set rubygem(io-console) dependency.
259116
259116
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.6-2
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
259116
259116
* Mon Oct 12 2015 Vít Ondruch <vondruch@redhat.com> - 1.10.6-1
259116
- Update to Bundler 1.10.6.
259116
- Keep vendored libraries.
259116
259116
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.8-3
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
259116
259116
* Thu Feb 05 2015 Vít Ondruch <vondruch@redhat.com> - 1.7.8-2
259116
- Properly uninstall the vendor directory.
259116
259116
* Tue Dec 09 2014 Vít Ondruch <vondruch@redhat.com> - 1.7.8-1
259116
- Update to Bundler 1.7.8.
259116
259116
* Thu Nov 20 2014 Josef Stribny <jstribny@redhat.com> - 1.7.6-2
259116
- Keep ssl_certs/certificate_manager.rb file (used in tests)
259116
- Correctly add load paths for gems during tests
259116
259116
* Wed Nov 12 2014 Josef Stribny <jstribny@redhat.com> - 1.7.6-1
259116
- Update to 1.7.6
259116
259116
* Tue Nov 11 2014 Josef Stribny <jstribny@redhat.com> - 1.7.4-2
259116
- Use symlinks for vendored libraries (rhbz#1163039)
259116
259116
* Mon Oct 27 2014 Vít Ondruch <vondruch@redhat.com> - 1.7.4-1
259116
- Update to Bundler 1.7.4.
259116
- Add thor and net-http-persistent dependencies into .gemspec.
259116
259116
* Mon Sep 22 2014 Josef Stribny <jstribny@redhat.com> - 1.7.3-1
259116
- Update to 1.7.3
259116
259116
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
259116
259116
* Sun Jan 12 2014 Sam Kottler <skottler@fedoraproject.org> - 1.5.2-1
259116
- Update to 1.5.2 (BZ #1047222)
259116
259116
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.5-2
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
259116
259116
* Tue Jun 11 2013 Vít Ondruch <vondruch@redhat.com> - 1.3.5-1
259116
- Update to Bundler 1.3.5.
259116
259116
* Mon Mar 04 2013 Josef Stribny <jstribny@redhat.com> - 1.3.1-1
259116
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
259116
- Update to Bundler 1.3.1
259116
259116
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-2
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
259116
259116
* Fri Nov 02 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.2.1-1
259116
- Update to Bundler 1.2.1.
259116
- Fix permissions on some executable files.
259116
259116
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.4-2
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
259116
259116
* Fri Jul 13 2012 Vít Ondruch <vondruch@redhat.com> - 1.1.4-1
259116
- Update to Bundler 1.1.4.
259116
259116
* Wed Feb 01 2012 Vít Ondruch <vondruch@redhat.com> - 1.0.21-1
259116
- Rebuilt for Ruby 1.9.3.
259116
- Update to Bundler 1.0.21.
259116
259116
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.15-2
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
259116
259116
* Thu Jul 07 2011 Vít Ondruch <vondruch@redhat.com> - 1.0.15-1
259116
- Updated to Bundler 1.0.15
259116
259116
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.10-2
259116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
259116
259116
* Fri Feb 04 2011 Vít Ondruch <vondruch@redhat.com> - 1.0.10-1
259116
- Upstream update
259116
259116
* Thu Jan 27 2011 Vít Ondruch <vondruch@redhat.com> - 1.0.9-2
259116
- More concise summary
259116
- Do not remove manpages, they are used internally
259116
- Added buildroot cleanup in clean section
259116
259116
* Mon Jan 24 2011 Vít Ondruch <vondruch@redhat.com> - 1.0.9-1
259116
- Bumped to Bundler 1.0.9
259116
- Installed manual pages
259116
- Removed obsolete buildroot cleanup
259116
259116
* Mon Nov 1 2010 Jozef Zigmund <jzigmund@redhat.com> - 1.0.3-2
259116
- Add ruby(abi) dependency
259116
- Add using macro %%{geminstdir} in files section
259116
- Add subpackage doc for doc files
259116
- Removed .gitignore file
259116
- Removed rubygem-thor from vendor folder
259116
- Add dependency rubygem(thor)
259116
259116
* Mon Oct 18 2010 Jozef Zigmund <jzigmund@redhat.com> - 1.0.3-1
259116
- Initial package