packages: R/R.spec - autogenerate locale and library file lists, using %lan...

qboosh qboosh at pld-linux.org
Tue Nov 15 20:44:27 CET 2011


Author: qboosh                       Date: Tue Nov 15 19:44:27 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- autogenerate locale and library file lists, using %lang() flags

---- Files affected:
packages/R:
   R.spec (1.155 -> 1.156) 

---- Diffs:

================================================================
Index: packages/R/R.spec
diff -u packages/R/R.spec:1.155 packages/R/R.spec:1.156
--- packages/R/R.spec:1.155	Tue Nov 15 16:56:37 2011
+++ packages/R/R.spec	Tue Nov 15 20:44:21 2011
@@ -138,13 +138,44 @@
 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/include $RPM_BUILD_ROOT%{_includedir}/R
 ln -sf %{_includedir}/R $RPM_BUILD_ROOT%{_libdir}/R/include
 
+gen_lang() {
+	dir="$1"
+	for d in $RPM_BUILD_ROOT${dir}/* ; do
+		bd=$(basename $d)
+		lang="${bd%@*}"
+		echo "%lang($lang) ${dir}/${bd}"
+	done
+}
+
+gen_lang %{_libdir}/R/share/locale > R.files
+for moddir in $RPM_BUILD_ROOT%{_libdir}/R/library/* ; do
+	module=$(basename $moddir)
+	echo "%dir %{_libdir}/R/library/${module}"
+	for f in $moddir/* ; do
+		bf=$(basename $f)
+		case "$bf" in
+		  po)
+			echo "%dir %{_libdir}/R/library/${module}/po"
+			gen_lang %{_libdir}/R/library/${module}/po
+			;;
+		  libs)
+			echo "%dir %{_libdir}/R/library/${module}/libs"
+			echo "%attr(755,root,root) %{_libdir}/R/library/${module}/libs/*.so"
+			;;
+		  *)
+			echo "%{_libdir}/R/library/${module}/${bf}"
+			;;
+		esac
+	done
+done >> R.files
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post	-p /sbin/ldconfig
 %postun	-p /sbin/ldconfig
 
-%files
+%files -f R.files
 %defattr(644,root,root,755)
 %doc NEWS README doc/{AUTHORS,COPYRIGHTS,FAQ,RESOURCES,THANKS}
 %attr(755,root,root) %{_bindir}/R
@@ -167,35 +198,7 @@
 %{_libdir}/R/etc
 %{_libdir}/R/include
 %dir %{_libdir}/R/library
-%{_libdir}/R/library/KernSmooth
-%{_libdir}/R/library/MASS
-%{_libdir}/R/library/Matrix
-%{_libdir}/R/library/base
-%{_libdir}/R/library/boot
-%{_libdir}/R/library/class
-%{_libdir}/R/library/cluster
-%{_libdir}/R/library/codetools
-%{_libdir}/R/library/compiler
-%{_libdir}/R/library/datasets
-%{_libdir}/R/library/foreign
-%{_libdir}/R/library/grDevices
-%{_libdir}/R/library/graphics
-%{_libdir}/R/library/grid
-%{_libdir}/R/library/lattice
-%{_libdir}/R/library/methods
-%{_libdir}/R/library/mgcv
-%{_libdir}/R/library/nlme
-%{_libdir}/R/library/nnet
-%{_libdir}/R/library/parallel
-%{_libdir}/R/library/rpart
-%{_libdir}/R/library/spatial
-%{_libdir}/R/library/splines
-%{_libdir}/R/library/stats
-%{_libdir}/R/library/stats4
-%{_libdir}/R/library/survival
-%{_libdir}/R/library/tcltk
-%{_libdir}/R/library/tools
-%{_libdir}/R/library/utils
+# library files list is autogenerated (see R.files above)
 %attr(755,root,root) %{_libdir}/R/modules
 %dir %{_libdir}/R/share
 %{_libdir}/R/share/R
@@ -203,21 +206,7 @@
 %{_libdir}/R/share/java
 %{_libdir}/R/share/licenses
 %dir %{_libdir}/R/share/locale
-%lang(de) %{_libdir}/R/share/locale/de
-%lang(en) %{_libdir}/R/share/locale/en
-%lang(en) %{_libdir}/R/share/locale/en at quot
-%lang(en_GB) %{_libdir}/R/share/locale/en_GB
-%lang(es) %{_libdir}/R/share/locale/es
-%lang(fr) %{_libdir}/R/share/locale/fr
-%lang(it) %{_libdir}/R/share/locale/it
-%lang(ja) %{_libdir}/R/share/locale/ja
-%lang(ko) %{_libdir}/R/share/locale/ko
-%lang(nn) %{_libdir}/R/share/locale/nn
-%lang(pt_BR) %{_libdir}/R/share/locale/pt_BR
-%lang(ru) %{_libdir}/R/share/locale/ru
-%lang(tr) %{_libdir}/R/share/locale/tr
-%lang(zh_CN) %{_libdir}/R/share/locale/zh_CN
-%lang(zh_TW) %{_libdir}/R/share/locale/zh_TW
+# locale files list is autogenerated (see R.files above)
 %{_libdir}/R/share/make
 %{_libdir}/R/share/sh
 %{_libdir}/R/share/texmf
@@ -234,6 +223,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.156  2011/11/15 19:44:21  qboosh
+- autogenerate locale and library file lists, using %lang() flags
+
 Revision 1.155  2011/11/15 15:56:37  qboosh
 - updated to 2.14.0
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/R/R.spec?r1=1.155&r2=1.156&f=u



More information about the pld-cvs-commit mailing list