[rubygem-narray/el5] fixed the way ruby(abi) is required dropped the symlinks in %%{ruby_vendorarchdir}, except for <= el

Björn Esser besser82 at fedoraproject.org
Fri Dec 13 09:34:41 UTC 2013


commit 272326e074d7218327a0263ebd615c864b844605
Author: Björn Esser <bjoern.esser at gmail.com>
Date:   Fri Dec 13 10:33:39 2013 +0100

    fixed the way ruby(abi) is required
    dropped the symlinks in %%{ruby_vendorarchdir}, except for <= el6
    fixed directory ownerships on <= el6
    use BuildRequires: rubygems-devel on el6, too

 rubygem-narray.spec |   44 ++++++++++++++++++++++----------------------
 1 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/rubygem-narray.spec b/rubygem-narray.spec
index 33636e4..33ec11f 100644
--- a/rubygem-narray.spec
+++ b/rubygem-narray.spec
@@ -11,17 +11,14 @@
 %{!?gem_docdir:		%global gem_docdir		%{gem_dir}/doc/%{gem_name}-%{version}}
 %{!?gem_extdir_mri:	%global gem_extdir_mri		%{ruby_vendorarchdir}}
 
-# Get the Ruby-version for dependencies
-%{!?ruby_ver:		%global ruby_ver	%(ruby -rrbconfig -W0 -e 'puts Config::CONFIG["RUBY_PROGRAM_VERSION"]' 2>/dev/null || echo 0)}
-
 Name:		rubygem-%{gem_name}
 Version:	0.6.0.8
-Release:	8%{?dist}
+Release:	9%{?dist}
 Summary:	N-dimensional Numerical Array class for Ruby
 %{?el5:Group:	System Environment/Libraries}
 
 License:	BSD and Ruby
-URL:		http://narray.rubyforge.org
+URL:		http://%{gem_name}.rubyforge.org
 Source0:	http://rubygems.org/downloads/%{gem_name}-%{version}.gem
 
 %{?el5:BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)}
@@ -30,11 +27,11 @@ BuildRequires:	ruby-devel
 %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
 BuildRequires:	rubygems-devel
 
-Requires:	ruby(release)			=  %{?ruby_ver}
+Requires:	ruby(release)
 %else
-BuildRequires:	rubygems%{!?rhel:-devel}
+BuildRequires:	rubygems%{!?el5:-devel}
 
-%{?rhel:Requires:	ruby(abi)		=  %{?ruby_ver}}
+%{?rhel:Requires:	ruby(abi)		=  1.8}
 %{!?rhel:Requires:	ruby(abi)		=  1.9.1}
 %endif
 Requires:	rubygems
@@ -106,12 +103,12 @@ cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}
 mv -f %{buildroot}%{gem_instdir}/%{gem_name}.so				\
 	%{buildroot}%{gem_extdir_mri}
 
-# This gem needs to live in %%{ruby_sitearch} to work properly
-[[ ! -f %{buildroot}%{ruby_vendorarchdir}/%{gem_name}.so ]] &&		\
-	ln -fs %{gem_extdir_mri}/%{gem_name}.so				\
-		%{buildroot}%{ruby_vendorarchdir}
-ln -fs %{gem_instdir}/%{gem_name}_ext.rb				\
-	%{buildroot}%{ruby_vendorarchdir}
+# On <= el6 there needs to be a symlink for %%{gem_name}_ext.rb
+# in %%{ruby_vendorarchdir}.  Otherwise the so-plugin can't be loaded.
+%if 0%{?rhel} && 0%{?rhel} <= 6
+ln -fs	%{gem_instdir}/%{gem_name}_ext.rb				\
+	%{buildroot}%{gem_extdir_mri}
+%endif
 
 # Clean-up
 find %{buildroot}%{gem_instdir} -depth -type f -name '*.so' -print0 |	\
@@ -122,10 +119,7 @@ find %{buildroot} -depth -type f -name '*.o' -print0 |			\
 	xargs -0 rm -rf
 find %{buildroot} -depth -size 0 -type f -print0 |			\
 	xargs -0 rm -rf
-rm -rf									\
-%if 0%{?fedora} || 0%{?rhel} >= 7
-	%{buildroot}%{gem_cache}					\
-%endif
+rm -rf	%{buildroot}%{gem_cache}					\
 	%{buildroot}%{gem_instdir}/src					\
 	%{buildroot}%{gem_instdir}/%{gem_name}.gemspec
 
@@ -141,13 +135,13 @@ rm -rf									\
 %exclude %{gem_instdir}/MANIFEST
 %exclude %{gem_instdir}/SPEC.*
 %exclude %{gem_instdir}/*.h
-%if 0%{?rhel} && 0%{?rhel} <= 6
-%{gem_cache}
-%endif
+%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
 %{gem_extdir_mri}
+%else
+%{gem_extdir_mri}/%{gem_name}*
+%endif
 %{gem_instdir}/*.rb
 %{gem_spec}
-%{ruby_vendorarchdir}/%{gem_name}*
 
 %files devel
 %doc %{gem_docdir}
@@ -157,6 +151,12 @@ rm -rf									\
 
 
 %changelog
+* Fri Dec 13 2013 Björn Esser <bjoern.esser at gmail.com> - 0.6.0.8-9
+- fixed the way ruby(abi) is required
+- dropped the symlinks in %%{ruby_vendorarchdir}, except for <= el6
+- fixed directory ownerships on <= el6
+- use BuildRequires: rubygems-devel on el6, too
+
 * Tue Dec 10 2013 Björn Esser <bjoern.esser at gmail.com> - 0.6.0.8-8
 - fixed symlinks in %%{ruby_vendorarchdir}
 


More information about the scm-commits mailing list