Hi,
Paul Johnson asked:
While I'm on the RPM subject, can I ask an R RPM packaging question? I
want the R RPM to install so that post install then R starts and runs
> update.packages()
as well as
install.packages(c("Design","Hmisc","lmtest","car","rgl","effects"))
well, you get the idea. I want to add in more packages, of course. Can
I ask what might be the best way to package this?
You can add scripts to the %post macro section.
If you look at the recent R.spec you'll see that there are already some :
%post
# Create directory entries for info files
# (optional doc files, so we must check that they are installed)
for doc in admin exts FAQ intro lang; do
file=%{_infodir}/R-${doc}.info.gz
if [ -e $file ]; then
/sbin/install-info ${file} %{_infodir}/dir
fi
done
# Update package indices
%{_bindir}/R CMD perl %{_libdir}/R/share/perl/build-help.pl --htmllists
%__cat %{_libdir}/R/library/*/CONTENTS >
%{_libdir}/R/doc/html/search/index.txt
One way to do what you want would be to add something like the following
at the beginning:
%post
cat > /tmp/RPM_postinstall.R << EOF
update.packages(ask=F)
install.packages(c("Design","Hmisc","lmtest","car","rgl","effects"))
EOF
%{_bindir}/R BATCH /tmp/RPM_postinstall.R
echo "Please check /tmp/RPM_postinstall.Rout for the update
results"
This may not be the best way to do it. You'll need to decide what kind
of error checking to do, whether you want to run that batch command in
the background, and so on. However, this is how such tasks are often
dome in rpm spec files.
Chris
chris albert <christopher.albert at mcgill.ca> writes:> Hi, > > Paul Johnson asked: > > While I'm on the RPM subject, can I ask an R RPM packaging question? I > want the R RPM to install so that post install then R starts and runs > > update.packages() > > as well as > > install.packages(c("Design","Hmisc","lmtest","car","rgl","effects")) > > well, you get the idea. I want to add in more packages, of course. Can > I ask what might be the best way to package this? > > You can add scripts to the %post macro section....etc... Erm, but would you really want the result of installing an RPM to depend on the install date and the previous configuration of the system? I can appreciate Paul's desire to automate, but when designing an RPM, you also have to consider that you'd be doing things that the user may not even know what mean. That sort of thing easily becomes a support nightmare. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Seemingly Similar Threads
- Post processing need for installing packages in rpms.
- debian packages and html help on linux
- loading error of the Rcmdr library on Debian Sid
- updating r-cran- packages on a new Ubuntu lucid system
- R-release.diff + R-1.9 -> success on Fedora Core 2, R RPM available; ess-emacs-5.1.20 also available