[rubygem-narray/el5] small improvements

Björn Esser besser82 at fedoraproject.org
Fri Dec 13 10:19:22 UTC 2013


commit 307e85b98525aa7b552cd7c702368a074e2e8244
Author: Björn Esser <bjoern.esser at gmail.com>
Date:   Fri Dec 13 11:18:11 2013 +0100

    small improvements

 rubygem-narray.spec |   51 ++++++++++++++++++++++-----------------------------
 1 files changed, 22 insertions(+), 29 deletions(-)
---
diff --git a/rubygem-narray.spec b/rubygem-narray.spec
index 33ec11f..58cf473 100644
--- a/rubygem-narray.spec
+++ b/rubygem-narray.spec
@@ -74,35 +74,41 @@ for %{name}.
 
 
 %prep
-rm -rf %{gem_name}-%{version}
-gem unpack %{SOURCE0}
-%setup -qDTn  %{gem_name}-%{version}
-gem spec %{SOURCE0} -l %{!?el5:--ruby} > %{gem_name}.gemspec
-
-
-%build
-gem build %{gem_name}.gemspec
-
-%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
-%gem_install
+%setup -qcT
+%if 0%{?fedora} || 0%{?rhel} >= 6
+%gem_install -n %{SOURCE0}
 %else
 export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
-mkdir -p ./%{gem_dir}
+mkdir -p .%{gem_dir}
 gem install								\
-	-V --local --install-dir ./%{gem_dir} --bindir ./%{_bindir}	\
-	--force --backtrace %{gem_name}-%{version}.gem
+	-V --local --install-dir .%{gem_dir} --bindir .%{_bindir}	\
+	--force --backtrace %{SOURCE0}
 %endif
 
 
+%build
+# noop
+
+
 %install
 %{?el5:rm -rf %{buildroot}}
 mkdir -p %{buildroot}%{gem_dir}						\
-	%{buildroot}%{gem_extdir_mri}					\
-	%{buildroot}%{ruby_vendorarchdir}
+	%{buildroot}%{gem_extdir_mri}
+
+# Install the gem to final location
 cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}
 mv -f %{buildroot}%{gem_instdir}/%{gem_name}.so				\
 	%{buildroot}%{gem_extdir_mri}
 
+# Clean-up
+pushd %{buildroot}
+find .%{gem_instdir} -depth -type f -name '*.so' -print0 | xargs -0 rm -rf
+find . -depth -type f -name '.*' -print0 | xargs -0 rm -rf
+find . -depth -type f -name '*.o' -print0 | xargs -0 rm -rf
+find . -depth -size 0 -type f -print0 | xargs -0 rm -rf
+rm -rf .%{gem_cache} .%{gem_instdir}/src .%{gem_instdir}/%{gem_name}.gemspec
+popd
+
 # 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
@@ -110,19 +116,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 |	\
-	xargs -0 rm -rf
-find %{buildroot} -depth -type f -name '.*' -print0 |			\
-	xargs -0 rm -rf
-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	%{buildroot}%{gem_cache}					\
-	%{buildroot}%{gem_instdir}/src					\
-	%{buildroot}%{gem_instdir}/%{gem_name}.gemspec
-
 
 %{?el5:%clean}
 %{?el5:rm -rf %{buildroot}}


More information about the scm-commits mailing list