Add scripts and macros to make R packaging easier.

This commit is contained in:
Tom Callaway 2007-07-06 22:07:47 +00:00
parent 5226c2c1e2
commit 05ba0c124d
3 changed files with 38 additions and 1 deletions

11
R-make-search-index.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# Figure out what RHOME is set to
TMP_R_HOME=`R RHOME`
# Write out all the contents in arch and noarch library locations
cat $TMP_R_HOME/library/*/CONTENTS > $TMP_R_HOME/doc/html/search/index.txt 2>/dev/null
cat /usr/share/R/library/*/CONTENTS >> $TMP_R_HOME/doc/html/search/index.txt 2>/dev/null
exit 0

19
R.spec
View File

@ -1,9 +1,11 @@
Name: R Name: R
Version: 2.5.1 Version: 2.5.1
Release: 1%{?dist} Release: 2%{?dist}
Summary: A language for data analysis and graphics Summary: A language for data analysis and graphics
URL: http://www.r-project.org URL: http://www.r-project.org
Source0: ftp://cran.r-project.org/pub/R/src/base/R-2/R-%{version}.tar.gz Source0: ftp://cran.r-project.org/pub/R/src/base/R-2/R-%{version}.tar.gz
Source1: macros.R
Source2: R-make-search-index.sh
License: GPL License: GPL
Group: Applications/Engineering Group: Applications/Engineering
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -163,13 +165,23 @@ echo "%{_libdir}/R/lib" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
mkdir -p $RPM_BUILD_ROOT%{_datadir}/R/library mkdir -p $RPM_BUILD_ROOT%{_datadir}/R/library
# Install rpm helper macros
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm/
install -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/
# Install rpm helper script
mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm/
install -m0755 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/rpm/
%files %files
%defattr(-, root, root) %defattr(-, root, root)
%{_bindir}/R %{_bindir}/R
%{_bindir}/Rscript %{_bindir}/Rscript
%{_datadir}/R %{_datadir}/R
%{_libdir}/R %{_libdir}/R
/usr/lib/rpm/R-make-search-index.sh
%{_infodir}/R-*.info* %{_infodir}/R-*.info*
%{_sysconfdir}/rpm/macros.R
%{_mandir}/man1/* %{_mandir}/man1/*
/etc/ld.so.conf.d/* /etc/ld.so.conf.d/*
%doc doc/AUTHORS CAPABILITIES doc/COPYING doc/COPYING.LIB doc/COPYRIGHTS doc/FAQ NEWS %doc doc/AUTHORS CAPABILITIES doc/COPYING doc/COPYING.LIB doc/COPYRIGHTS doc/FAQ NEWS
@ -212,6 +224,8 @@ done
# Update package indices # Update package indices
%{_bindir}/R CMD perl %{_libdir}/R/share/perl/build-help.pl --htmllists > /dev/null 2>/dev/null %{_bindir}/R CMD perl %{_libdir}/R/share/perl/build-help.pl --htmllists > /dev/null 2>/dev/null
%__cat %{_libdir}/R/library/*/CONTENTS > %{_libdir}/R/doc/html/search/index.txt 2>/dev/null %__cat %{_libdir}/R/library/*/CONTENTS > %{_libdir}/R/doc/html/search/index.txt 2>/dev/null
# This could fail if there are no noarch R libraries on the system.
%__cat %{_datadir}/R/library/*/CONTENTS >> %{_libdir}/R/doc/html/search/index.txt 2>/dev/null || exit 0
%preun %preun
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
@ -238,6 +252,9 @@ fi
/sbin/ldconfig /sbin/ldconfig
%changelog %changelog
* Thu Jul 5 2007 Tom "spot" Callaway <tcallawa@redhat.com> 2.5.1-2
- add rpm helper macros, script
* Mon Jul 2 2007 Tom "spot" Callaway <tcallawa@redhat.com> 2.5.1-1 * Mon Jul 2 2007 Tom "spot" Callaway <tcallawa@redhat.com> 2.5.1-1
- drop patch, upstream fixed - drop patch, upstream fixed
- bump to 2.5.1 - bump to 2.5.1

9
macros.R Normal file
View File

@ -0,0 +1,9 @@
#
# RPM macros for R packaging
#
#
# Make R search index.txt
#
%_R_make_search_index /usr/lib/rpm/R-make-search-index.sh