[rubygem-pam] Fix depdency errors by moving the spec files up to the new macros.

Bryan Kearney bkearney at fedoraproject.org
Mon May 5 16:51:28 UTC 2014


commit a8402833c7e24aa764a4f004c0e7eeadbfab6062
Author: Bryan Kearney <bkearney at redhat.com>
Date:   Mon May 5 12:50:43 2014 -0400

    Fix depdency errors by moving the spec files up to the new macros.
    
    In addition to the macro change, the spec file was updated to the latest
    standard by removing the ruby-pam packaging. Only delivering via gems
    now.

 rubygem-pam.spec |  103 ++++++++++++++++++++++-------------------------------
 1 files changed, 43 insertions(+), 60 deletions(-)
---
diff --git a/rubygem-pam.spec b/rubygem-pam.spec
index 7d81932..9acaae0 100644
--- a/rubygem-pam.spec
+++ b/rubygem-pam.spec
@@ -1,106 +1,89 @@
-%define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
-%define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
-%define gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
-%define gemname pam
-%define libname _%{gemname}.so
-%define geminstdir %{gemdir}/gems/%{gemname}-%{version}
-%define installroot %{buildroot}%{geminstdir}
-%define extension_dir %{installroot}/ext/
+%define gem_name pam
+%define libname _%{gem_name}.so
 
 # Main package bundles it at a gem
-Name:           rubygem-%{gemname}
+Name:           rubygem-%{gem_name}
 Version:        1.5.4
-Release:        16%{?dist}
+Release:        17%{?dist}
 Summary:        Ruby bindings for pam
 Group:          Development/Languages
 
 License:        LGPLv2+
 URL:            http://rubyforge.org/projects/ruby-pam
-Source0:        http://rubyforge.org/frs/download.php/43802/%{gemname}-%{version}.gem
+Source0:        http://rubyforge.org/frs/download.php/43802/%{gem_name}-%{version}.gem
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  pam-devel >= 0.0.6
 BuildRequires:  ruby-devel >=  1.9
+BuildRequires:  rubygems-devel
 BuildRequires:  ruby
 BuildRequires:  ruby-irb
 BuildRequires:  rubygem-rake
 Requires:       rubygems
 Requires:       ruby(release) >= 1.9
-Provides:       rubygem(%{gemname}) = %{version}
+Provides:       rubygem(%{gem_name}) = %{version}
 
 %description
 Ruby bindings for pam exposed via a gem
 
-
-# Secondary package exposes the library not as a gem
-%package        -n ruby-%{gemname}
-Summary:        Ruby-pam bindings exposed outside of gem
-Group:          Development/Languages
-Requires:       rubygem(%{gemname})
-Provides:       ruby(%{gemname}) = %{version}
-
-%description -n ruby-%{gemname}
-Ruby bindings for pam not exposed via a gem
-
-# Empty per the standard
 %prep
+gem unpack %{SOURCE0}
+%setup -q -D -T -n  %{gem_name}-%{version}
+gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
 
-#Empty per the standard
 %build
+gem build %{gem_name}.gemspec
+%gem_install
 
 # Installs the gem, and then moves the compiled code to the site
-# library. Softlinks are used to keep the gem "whole"
+# library.
 %install
 rm -rf %{buildroot}
-install -d -m0755  %{buildroot}%{gemdir}
-install -d -m0755  %{buildroot}%{ruby_sitelib}
-install -d -m0755  %{buildroot}%{ruby_sitearch}   
+install -d -m0755  %{buildroot}%{gem_dir}
+install -d -m0755  %{buildroot}%{ruby_sitelibdir}
+install -d -m0755  %{buildroot}%{ruby_sitearchdir}
 
-gem install --local --install-dir %{buildroot}%{gemdir} \
-            --force %{SOURCE0}  
-              
-# Clean up the yard cruft if present
-rm -rf %{buildroot}/%{geminstdir}/.yardoc
+# copy the results of hte build over.
+mkdir -p %{buildroot}%{gem_dir}
+cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
 
-mv %{extension_dir}%{libname} %{buildroot}%{ruby_sitearch}/%{libname}
-rm -rf %{extension_dir}
-strip %{buildroot}%{ruby_sitearch}/%{libname}
-rm %{installroot}/lib/%{libname}
-cp %{installroot}/lib/%{gemname}.rb %{buildroot}%{ruby_sitelib}/%{gemname}.rb
+# Move the library into the extension specific location
+mkdir -p %{buildroot}%{gem_extdir_mri}/ext
+mv %{buildroot}%{gem_instdir}/ext/%{libname} %{buildroot}%{gem_extdir_mri}/ext/%{libname}
 
+# Remove the cruft in the old locations.
+rm -rf %{buildroot}%{gem_instdir}/ext
+rm -rf %{buildroot}%{gem_dir}/extensions
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-
 %files
 %defattr(-,root,root,-)
-%dir %{geminstdir}
-%{geminstdir}/Rakefile
-%{geminstdir}/test
-%{geminstdir}/lib
-%{gemdir}/cache/%{gemname}-%{version}.gem
-%{gemdir}/specifications/%{gemname}-%{version}.gemspec
-%{ruby_sitearch}/%{libname}
-%doc %{geminstdir}/COPYING 
-%doc %{geminstdir}/LICENSE
-%doc %{geminstdir}/MANIFEST
-%doc %{geminstdir}/README
-%doc %{geminstdir}/ChangeLog
-%doc %{gemdir}/doc
-
-%files -n ruby-%{gemname}
-%defattr(-,root,root,-)
-%{ruby_sitelib}/%{gemname}.rb
-
+%dir %{gem_instdir}
+%{gem_instdir}/Rakefile
+%{gem_instdir}/test
+%{gem_instdir}/lib
+%{gem_dir}/cache/%{gem_name}-%{version}.gem
+%{gem_dir}/specifications/%{gem_name}-%{version}.gemspec
+%{gem_extdir_mri}/ext/%{libname}
+%doc %{gem_instdir}/COPYING
+%doc %{gem_instdir}/LICENSE
+%doc %{gem_instdir}/MANIFEST
+%doc %{gem_instdir}/README
+%doc %{gem_instdir}/ChangeLog
+%doc %{gem_dir}/doc
 
 %changelog
+* Mon May 05 2014 Bryan Kearney <bkearney at redhat.com> - 1.5.4-17
+- Rebuilt with new macros. Also, per the standard, removed the non gem version.
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.5.4-16
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 
 * Tue Apr 16 2013 Bryan Kearney <bkearney at redhat.com> - 1.5.4-15
 - Change ruby(abi) to ruby(release)
 
-* Sun Mar 27 2013 Bryan Kearney <bkearney at redhat.com> - 1.5.4-14
+* Wed Mar 27 2013 Bryan Kearney <bkearney at redhat.com> - 1.5.4-14
 - Rebuild to get the latest dependencies
 
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.5.4-13
@@ -145,5 +128,5 @@ rm -rf $RPM_BUILD_ROOT
 * Tue Aug 19 2008 Bryan Kearney <bkearney at redhat.com> - 1.5.2-2
 - Fixes according to Fedora review
 
-* Mon Aug 6 2008 Bryan Kearney <bkearney at redhat.com> - 1.5.2-1
+* Wed Aug 6 2008 Bryan Kearney <bkearney at redhat.com> - 1.5.2-1
 - Initial specfile


More information about the scm-commits mailing list