rpms/rubygem-zoom/devel rubygem-zoom.spec,1.6,1.7

Mamoru Tasaka mtasaka at fedoraproject.org
Mon Oct 27 08:04:59 UTC 2008


Author: mtasaka

Update of /cvs/extras/rpms/rubygem-zoom/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26427

Modified Files:
	rubygem-zoom.spec 
Log Message:
* Mon Oct 27 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-4
- Better way to set CFLAGS and create debuginfo rpm correctly



Index: rubygem-zoom.spec
===================================================================
RCS file: /cvs/extras/rpms/rubygem-zoom/devel/rubygem-zoom.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- rubygem-zoom.spec	8 Oct 2008 05:31:40 -0000	1.6
+++ rubygem-zoom.spec	27 Oct 2008 08:04:28 -0000	1.7
@@ -10,7 +10,7 @@
 
 Name:		rubygem-%{gemname}
 Version:	0.4.1
-Release:	3%{?dist}
+Release:	4%{?dist}
 Group:		Development/Languages
 Summary:	Ruby binding to ZOOM
 
@@ -54,22 +54,13 @@
 
 
 %prep
-# Compile by myself forcely.
-# Current rubygem install method
-# - does not support CFLAGS (rather, don't know what compiler options
-# . are used)
-# - Does not pass check-buildroot (why?) Also, find-debuginfo.sh does not
-# . create debuginfo rpm, probably compiler options used are wrong.
-#
-# . Other packages avoid check-buildroot complaint by stripping binaries, which
-# . is very improper!!
-
 %setup -q -c
 %{__gzip} -dc data.tar.gz | %{__tar} -x -f -
 
 # Cleanup
 %{__rm} -rf */CVS/
 find sample/ -name \*.rb -print0 | xargs -0 %{__chmod} 0644
+find . -type f -print0 | xargs -0 touch -r %{SOURCE0}
 
 # Repackage to split out unneeded files
 # So unpack source again
@@ -79,9 +70,6 @@
 cd ..
 
 %build
-# Build module with honoring CFLAGS correctly
-rake -v build
-
 # Repackage gem
 cd Repackage
 %{__rm} -rf \
@@ -96,17 +84,35 @@
 %{__rm} -rf %{buildroot}
 
 # 1. gem install
+##
+##  First install gem files under %%builddir (not %%buildroot),
+##  then copy (not move) whole tree to %%buildroot.
+##
+##  Otherwise check-buildroot will complain for ruby
+##  C extention because C extention compilation is done
+##  under %%buildroot.
+##  Also when we "move" whole tree (not copy) to
+##  %%buildroot debuginfo.sh will complain that the sources
+##  are missing.
+##
+%{__rm} -rf ./tmpinstdir
+
+%{__mkdir_p} ./tmpinstdir/%{gemdir}
 %{__mkdir_p} %{buildroot}%{gemdir}
+
+# Set CFLAGS
+export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
 gem install \
+	-V \
 	--local \
-	--install-dir %{buildroot}%{gemdir} \
+	--install-dir ./tmpinstdir/%{gemdir} \
 	--force \
 	*.gem
+%{__cp} -a ./tmpinstdir/%{gemdir}/* %{buildroot}%{gemdir}/
 
-# 2. replace with local build!!
+# 2. move ruby C extention
 %{__mkdir_p} %{buildroot}%{ruby_sitearch}
-%{__install} -cpm 0755 \
-	src/%{gemname}.so \
+%{__mv} -f %{buildroot}%{geminstdir}/lib/*.so \
 	%{buildroot}%{ruby_sitearch}/
 
 # 3. Cleanups
@@ -124,7 +130,7 @@
 rake test
 
 %clean
-rm -rf %{buildroot}
+%{__rm} -rf %{buildroot}
 
 %files
 %defattr(-, root, root,-)
@@ -145,6 +151,9 @@
 %{geminstdir}/Rakefile
 
 %changelog
+* Mon Oct 27 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-4
+- Better way to set CFLAGS and create debuginfo rpm correctly
+
 * Wed Oct  8 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-3
 - Split out unneeded files in better way
 




More information about the scm-commits mailing list