%{?scl:%global _scl_prefix /opt/rh} %{?scl:%scl_package rubygems} %{!?scl:%global pkg_name %{name}} %define gem_dir %(ruby -rrbconfig -e 'puts File::expand_path(File::join(RbConfig::CONFIG["sitedir"],"..","gems"))') %define rb_ver %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]') %define gem_home %{gem_dir}/%{rb_ver} %define ruby_sitelib %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]') %define repoid 70696 Summary: The Ruby standard for packaging ruby libraries Name: %{?scl_prefix}rubygems Version: 1.3.7 Release: 5%{?dist} Group: Development/Libraries # No GPL version is specified. License: MIT URL: http://rubyforge.org/projects/rubygems/ Source0: http://rubyforge.org/frs/download.php/%{repoid}/rubygems-%{version}.tgz Patch0: rubygems-1.3.7-noarch-gemdir.patch # Fix algorithmic complexity vulnerability (CVE-2013-4287). # https://github.com/rubygems/rubygems/issues/626 Patch1: rubygems-1.8.23.1-CVE-2013-4287-algorithmic-complexity-vulnerability.patch # Fix insecure connection to SSL repository (CVE-2012-2125, CVE-2012-2126). # https://github.com/rubygems/rubygems/commit/c22a3b705ead93f4cb8282e6dcb2f8f330d74edd # NOTE 1: Certificates are omitted from patch due to: # https://github.com/rubygems/rubygems/commit/e9388de72ee5953ff061203ad387c98b2154db87 # Upstream clarification: https://github.com/rubygems/rubygems/issues/654 # NOTE 2: The ca-bundle.pem is automatically discovered on system path by OpenSLL. Patch2: rubygems-1.8.24-CVE-2012-2125-CVE-2012-2126-Insecure-connection-to-SSL-repository.patch # Remove regexp backtracing (CVE-2013-4363). # https://github.com/rubygems/rubygems/commit/56d1f8c17bc81f0eb354d5099021c498a0be9b51 Patch3: rubygems-1.8.23.1-CVE-2013-4363-remove-regexp-backtracing.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) Requires: %{?scl_prefix}ruby-devel %{?scl_prefix}ruby-rdoc BuildRequires: %{?scl_prefix}ruby-devel %{?scl_prefix}ruby-rdoc BuildArch: noarch %{?scl:Requires: %scl_runtime} %description RubyGems is the Ruby standard for publishing and managing third party libraries. %package devel Summary: Macros and development tools for packaging RubyGems Group: Development/Libraries License: Ruby or MIT Requires: %{name} = %{version}-%{release} BuildArch: noarch %description devel Macros and development tools for packaging RubyGems. %prep %setup -q -n %{pkg_name}-%{version} %patch0 -p1 -b .noarch %patch1 -p1 %patch2 -p1 %patch3 -p1 # Some of the library files start with #! which rpmlint doesn't like # and doesn't make much sense for f in `find lib -name \*.rb` ; do head -1 $f | grep -q '^#!/usr/bin/env ruby' && sed -i -e '1d' $f done %build # Nothing %install rm -rf $RPM_BUILD_ROOT GEM_HOME=%{buildroot}/%{gem_home} \ ruby setup.rb --prefix=/ \ --no-rdoc --no-ri \ --destdir=%{buildroot}/%{ruby_sitelib}/ mkdir -p %{buildroot}/%{_bindir} mv %{buildroot}/%{ruby_sitelib}/bin/gem %{buildroot}/%{_bindir}/gem rm -rf %{buildroot}/%{ruby_sitelib}/bin mv %{buildroot}/%{ruby_sitelib}/lib/* %{buildroot}/%{ruby_sitelib}/. # FIXME!! mkdir -p $RPM_BUILD_ROOT%{gem_home}/{cache,gems,specifications,doc} # create macros.rubygems mkdir -p %{buildroot}%{_sysconfdir}/rpm cat >> %{buildroot}%{_sysconfdir}/rpm/macros.rubygems << \EOF # The RubyGems root folder. %%gem_dir %{gem_home} # Common gem locations and files. %%gem_instdir %%{gem_dir}/gems/%%{gem_name}-%%{version} %%gem_libdir %%{gem_instdir}/lib %%gem_cache %%{gem_dir}/cache/%%{gem_name}-%%{version}.gem %%gem_spec %%{gem_dir}/specifications/%%{gem_name}-%%{version}.gemspec %%gem_docdir %%{gem_dir}/doc/%%{gem_name}-%%{version} # Install gem into appropriate directory. # -n Overrides gem file name for installation. # -d Set installation directory. %%gem_install(d:n:) \ mkdir -p %%{-d*}%%{!?-d:.%%{gem_dir}} \ \ CONFIGURE_ARGS="--with-cflags='%%{optflags}' $CONFIGURE_ARGS" \\\ PATH="/opt/rh/ruby187/root/usr/bin:/opt/rh/ruby187/root/usr/sbin:$PATH" \ LD_LIBRARY_PATH="/opt/rh/ruby187/root/usr/lib64:$LD_LIBRARY_PATH" \ PKG_CONFIG_PATH="/opt/rh/ruby187/root/usr/lib64/pkgconfig:$PKG_CONFIG_PATH" \ gem install \\\ -V \\\ --local \\\ --install-dir %%{-d*}%%{!?-d:.%%{gem_dir}} \\\ --bindir .%%{_bindir} \\\ --force \\\ %%{-n*}%%{!?-n:%%{gem_name}-%%{version}.gem} EOF mkdir -p $RPM_BUILD_ROOT/usr/bin/ cat > $RPM_BUILD_ROOT/usr/bin/gem < - 1.3.7-5 - Remove regexp backtracing (CVE-2013-4363). - Related: rhbz#1002839. * Wed Sep 18 2013 Vít Ondruch - 1.3.7-4 - Fix insecure connection to SSL repository (CVE-2012-2125, CVE-2012-2126). - Related: rhbz#1002839. * Mon Sep 02 2013 Vít Ondruch - 1.3.7-3 - Fix algorithmic complexity vulnerability (CVE-2013-4287). - Resolves: rhbz#1002839. * Tue Aug 13 2013 Vít Ondruch - 1.3.7-2 - Provide -devel package. - Resolves: rhbz#788001 - Fix license. - Resolves: rhbz#559707 * Mon May 17 2010 Mamoru Tasaka - 1.3.7-1 - Update to 1.3.7, dropping upstreamed patch * Wed Apr 28 2010 Mamoru Tasaka - 1.3.6-1 - Update to 1.3.6 - Show prefix with gem contents by default as shown in --help * Mon Sep 21 2009 Mamoru Tasaka - 1.3.5-1 - Update to 1.3.5 * Sun Jul 26 2009 Fedora Release Engineering - 1.3.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Feb 25 2009 Fedora Release Engineering - 1.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sun Nov 09 2008 Jeroen van Meeuwen - 1.3.1-1 - New upstream version * Tue Sep 16 2008 David Lutterkort - 1.2.0-2 - Bump release because I forgot to check in newer patch * Tue Sep 16 2008 David Lutterkort - 1.2.0-1 - Updated for new setup.rb - Simplified by removing conditionals that were needed for EL-4; there's just no way we can support that with newer rubygems * Wed Sep 3 2008 Tom "spot" Callaway - 0.9.4-2 - fix license tag * Fri Jul 27 2007 David Lutterkort - 0.9.4-1 - Conditionalize so it builds on RHEL4 * Tue Feb 27 2007 David Lutterkort - 0.9.2-1 - New version - Add patch0 to fix multilib sensitivity of Gem::dir (bz 227400) * Thu Jan 18 2007 David Lutterkort - 0.9.1-1 - New version; include LICENSE.txt and GPL.txt - avoid '..' in gem_dir to work around a bug in gem installer - add ruby-rdoc to requirements * Tue Jan 2 2007 David Lutterkort - 0.9.0-2 - Fix gem_dir to be arch independent - Mention dual licensing in License field * Fri Dec 22 2006 David Lutterkort - 0.9.0-1 - Updated to 0.9.0 - Changed to agree with Fedora Extras guidelines * Mon Jan 9 2006 David Lutterkort - 0.8.11-1 - Updated for 0.8.11 * Sun Oct 10 2004 Omar Kilani 0.8.1-1ts - First version of the package