Paul Johnson
2010-Jun-03 16:14 UTC
[R-sig-Fedora] How to go about getting a change in the SPEC file from which R is built on EPEL?
I asked a couple of months ago in r-sig-fedora about a difference I noticed between Ubuntu and RedHat/Fedora. Now I think I've figured out the cause is a little issue in packaging but I don't know how to get it fixed. On Ubuntu, the setup is like this. It i is controlled in a file called Renviron R packages built/distributed in RPM are installed to /usr/lib/R/library. R packages built locally with install.packages by root go to /usr/local/lib/R/site-library Ordinary users who try to install packages are prompted to create a folder in their HOME/~R/... and install there. In my Ubuntu Renviron file, I have this at the end: R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/2.11'} # edd Apr 2003 Allow local install in /usr/local, also add a directory for # Debian packaged CRAN packages, and finally the default dir # edd Jul 2007 Now use R_LIBS_SITE, not R_LIBS R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'} I wondered why the RedHat/Fedora install of the R RPM don't see same/similar options. On Fedora/RedHat using R from RPM as distributed on EPEL, all the packages go into /usr/lib/R and nonroot users are out of luck, pretty much, unless they make some special effort. There was some debate here about what the folder in the user home dir should be called, but none of us realized that R, as it comes from the "factory", will work pretty much the way I want. The problem is that the RPM is built from a SPEC file that inserts a line into R's Renviron that enforces a variable R_LIBS and it has some kind of super power to block the R_LIBS_SITE and R_LIBS_USER variables. Specifically, I mean this line in the SPEC file. %build Add PATHS to Renviron for R_LIBS echo 'R_LIBS=${R_LIBS-'"'%{_libdir}/R/library:%{_datadir}/R/library'"'}'>> etc/Renviron.inOn my systems, I comment out those lines in the spec file and then R works the way the authors intended. Judging from the comments that Dirk Eddelbuettel inserted in the Debian packaging, sometime around 2007 the R LIBS framework changed. pj -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas
Tom "spot" Callaway
2010-Jun-03 17:03 UTC
[R-sig-Fedora] How to go about getting a change in the SPEC file from which R is built on EPEL?
On 06/03/2010 12:14 PM, Paul Johnson wrote:> R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'} > > I wondered why the RedHat/Fedora install of the R RPM don't see > same/similar options. On Fedora/RedHat using R from RPM as distributed > on EPEL, all the packages go into /usr/lib/R and nonroot users are out > of luck, pretty much, unless they make some special effort. > > There was some debate here about what the folder in the user home dir > should be called, but none of us realized that R, as it comes from the > "factory", will work pretty much the way I want. > > The problem is that the RPM is built from a SPEC file that inserts a > line into R's Renviron that enforces a variable > R_LIBS and it has some kind of super power to block the R_LIBS_SITE > and R_LIBS_USER variables. Specifically, I mean this line in the SPEC > file. > > %build > Add PATHS to Renviron for R_LIBS > echo 'R_LIBS=${R_LIBS-'"'%{_libdir}/R/library:%{_datadir}/R/library'"'}' >>> >> etc/Renviron.in > On my systems, I comment out those lines in the spec file and then R > works the way the authors intended. Judging from the comments that > Dirk Eddelbuettel inserted in the Debian packaging, sometime around > 2007 the R LIBS framework changed.So, a few corrections: On Fedora: * Architecture specific R modules go into %{_libdir}/R/library * Architecture independent R modules go into %{_datadir}/R/library I don't believe that without making some change, R will look in %{_datadir}/R/library at all. It looks like we should be overloading R_LIBS_SITE as opposed to R_LIBS. Easy peasy. :) Can you try changing that line in the spec file to this and confirm that it resolves the issue: echo 'R_LIBS_SITE=${R_LIBS_SITE-'"'/usr/local/lib/R/site-library:/usr/local/lib/R/library:%{_libdir}/R/library:%{_datadir}/R/library'"'}'>> etc/Renviron.in(Note: email client wrapped it, but it should be one long line) ~spot
Seemingly Similar Threads
- R CMD check --as-cran attempts to hide R_LIBS_USER but fails
- R CMD check --as-cran attempts to hide R_LIBS_USER but fails
- Renviron settings for Linux Distributions: please tell me R Core's advice
- R CMD check error
- Debian Testing: ~/.Renviron seems to not being read (R_LIBS not set)