Hello! I use Debian GNU/Linux at work and I really like apt-get tool. As far as I understand the whole picture, there are now some Debian packages of R packages. Build of Debian packages is done automagically by Perl script. By the way, what is the status of Debianizing R packages? Is it stopped, just holded, ... I don't know so I am asking There is also Bioconductor and I am aware that the list of packages is growing quite fast and afterall I understand that there is probably to few people to work on Debianization. The main point of this mail is however installation. I usually first try to use apt-get install and if there is no Debian package I use R tools. However some packages that I have already installed with R tools might eventually appear as Debian packages, ... or I might use update.packages() for Debian packages. By the way is field 'Package-Manager: Debian' already implemented. I would check, but I unfortunately don't have Debain at home. I was thinking on some functions or eventually an R package r-debian, which would ease this installation dilemma. Actually I wrote something already in december but put it off. It is given bellow. It is probably far from optimal but it was just a proof of concept. Many more functions would be needed to fuzz everything up. Any comments? debian.install.packages <- function(package, ...) { # Description: # Installs package on Debian GNU/Linux system. For given R package it # tries to get Debian package and install/upgrade it with apt-get if it # exists. Otherwise install.packages() is used. # Gregor GORJANC 2004-12-30 # Arguments: # package: R package name as character, only one # ...: other parameters for install.packages() or update.packages() # Examples: # debian.install.packages("Design") # Code: # apt-get update i.e. refresh list of Debian packages system(apt-get update) # Transform R package name to Debian package name policy i.e change R # package name to lowercase and test if this Debian package exists # (test1). This could be done without grep, but then it is not possible # to test on exit status, since apt-cache search always returns 0. packagelow <- tolower(package) tmp1 <- c("system(\"apt-cache search ^r- | grep") tmp2 <- c("| awk '{print $1}'\", intern = TRUE\)") tmp3 <- as.expression(paste(tmp1, packagelow, tmp2, "\n")) deb <- eval(parse(file = "", text = tmp3)) cat("\nR package:", package, "\n") cat("Corresponding Debian package name:", deb, "\n") # Package install/update or upgrade in apt meaning if (length(deb) != 0) { # Debian package does exist cat("Debian package", deb, "exists: yes\n") cat("Proceeding with apt-get.\n") # apt-get install, which can also be used for package upgrade tmp1 <- c("system(\"apt-get install") tmp2 <- as.expression(paste(tmp1, deb, "\")", "\n")) eval(parse(file = "", text = tmp2)) } else { # Debian package doesn't exist or something went wrong in test1 cat("Debian package", deb, "exists: no\n") # cat("Proceeding with install/update.packages().\n") # install.update.packages(package, ...) cat("Proceeding with install.packages().\n") install.packages(package, ...) } } One more thing. Why is r-noncran-lindsey and not r-other-lindsey? -- Lep pozdrav / With regards, Gregor Gorjanc ------------------------------------------------------------------------ University of Ljubljana Biotechnical Faculty URI: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department email: gregor.gorjanc <at> bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia
YMMV, but what I do is to install duplicates (i.e. R CMD INSTALL places things in /usr/local/, and apt-get in /usr/), and resolve the library I want at load time. This has a few advantages, and the obvious disadvantage that you can shoot yourself in the foot REALLY EASILY if you don't pay attention to what you've got configured. best, -tony On 4/24/05, Gorjanc Gregor <Gregor.Gorjanc@bfro.uni-lj.si> wrote:> Hello! > > I use Debian GNU/Linux at work and I really like apt-get tool. As far as > I understand the whole picture, there are now some Debian packages of R > packages. Build of Debian packages is done automagically by Perl script. > > By the way, what is the status of Debianizing R packages? Is it stopped, > just holded, ... I don't know so I am asking > There is also Bioconductor and I am aware that the list of packages is > growing quite fast and afterall I understand that there is probably to > few people to work on Debianization. > > The main point of this mail is however installation. I usually first > try to use apt-get install and if there is no Debian package I use > R tools. However some packages that I have already installed with R tools > might eventually appear as Debian packages, ... or I might use > update.packages() for Debian packages. By the way is field > 'Package-Manager: Debian' already implemented. I would check, but I > unfortunately don't have Debain at home. > > I was thinking on some functions or eventually an R package r-debian, > which would ease this installation dilemma. Actually I wrote something > already in december but put it off. It is given bellow. It is probably > far from optimal but it was just a proof of concept. Many more functions > would be needed to fuzz everything up. Any comments? > > debian.install.packages <- function(package, ...) { > > # Description: > # Installs package on Debian GNU/Linux system. For given R package it > # tries to get Debian package and install/upgrade it with apt-get if it > # exists. Otherwise install.packages() is used. > # Gregor GORJANC 2004-12-30 > > # Arguments: > # package: R package name as character, only one > # ...: other parameters for install.packages() or update.packages() > > # Examples: > # debian.install.packages("Design") > > # Code: > # apt-get update i.e. refresh list of Debian packages > system(apt-get update) > > # Transform R package name to Debian package name policy i.e change R > # package name to lowercase and test if this Debian package exists > # (test1). This could be done without grep, but then it is not possible > # to test on exit status, since apt-cache search always returns 0. > packagelow <- tolower(package) > tmp1 <- c("system(\"apt-cache search ^r- | grep") > tmp2 <- c("| awk '{print $1}'\", intern = TRUE\)") > tmp3 <- as.expression(paste(tmp1, packagelow, tmp2, "\n")) > deb <- eval(parse(file = "", text = tmp3)) > > cat("\nR package:", package, "\n") > cat("Corresponding Debian package name:", deb, "\n") > > # Package install/update or upgrade in apt meaning > if (length(deb) != 0) { # Debian package does exist > cat("Debian package", deb, "exists: yes\n") > cat("Proceeding with apt-get.\n") > > # apt-get install, which can also be used for package upgrade > tmp1 <- c("system(\"apt-get install") > tmp2 <- as.expression(paste(tmp1, deb, "\")", "\n")) > eval(parse(file = "", text = tmp2)) > } > else { # Debian package doesn't exist or something went wrong in test1 > cat("Debian package", deb, "exists: no\n") > # cat("Proceeding with install/update.packages().\n") > # install.update.packages(package, ...) > cat("Proceeding with install.packages().\n") > install.packages(package, ...) > } > } > > One more thing. Why is r-noncran-lindsey and not r-other-lindsey? > > -- > Lep pozdrav / With regards, > Gregor Gorjanc > > ------------------------------------------------------------------------ > University of Ljubljana > Biotechnical Faculty URI: http://www.bfro.uni-lj.si/MR/ggorjan > Zootechnical Department email: gregor.gorjanc <at> bfro.uni-lj.si > Groblje 3 tel: +386 (0)1 72 17 861 > SI-1230 Domzale fax: +386 (0)1 72 17 888 > Slovenia > > _______________________________________________ > R-SIG-Debian mailing list > R-SIG-Debian@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-debian >-- best, -tony "Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes" (AJR, 4Jan05). A.J. Rossini blindglobe@gmail.com
Dirk Eddelbuettel
2005-Apr-24 19:46 UTC
[R-sig-Debian] "Debain" way of installing packages
Hi Gregor, Your enthusiasm in this matter is greatly appreciated. I am CC'ing this to the existing list on the alioth.debian.org hosting system: pkg-bioc-devel. This was initially set up my Matt Hope to foster debianising BioC, I then threw my exisiting Perl infrastructure (used previously for Quantian) at it and Egon Willighagen carried it from there with further improvements, incl. large scale builds of amd64 packages. With a little push from all of us (Hi Tony, Hi Matt, Hi Egon, Hi anybody-else-willing-to-chip-in :) we can make this even better and hopefully have something proper by the summer, maybe for DSC 20003. On 24 April 2005 at 16:04, Gorjanc Gregor wrote: | Hello! | | I use Debian GNU/Linux at work and I really like apt-get tool. As far as | I understand the whole picture, there are now some Debian packages of R | packages. Build of Debian packages is done automagically by Perl script. | | By the way, what is the status of Debianizing R packages? Is it stopped, | just holded, ... I don't know so I am asking | There is also Bioconductor and I am aware that the list of packages is | growing quite fast and afterall I understand that there is probably to | few people to work on Debianization. | | The main point of this mail is however installation. I usually first | try to use apt-get install and if there is no Debian package I use | R tools. However some packages that I have already installed with R tools | might eventually appear as Debian packages, ... or I might use | update.packages() for Debian packages. By the way is field | 'Package-Manager: Debian' already implemented. I would check, but I | unfortunately don't have Debain at home. | | I was thinking on some functions or eventually an R package r-debian, | which would ease this installation dilemma. Actually I wrote something | already in december but put it off. It is given bellow. It is probably | far from optimal but it was just a proof of concept. Many more functions | would be needed to fuzz everything up. Any comments? | | debian.install.packages <- function(package, ...) { | | # Description: | # Installs package on Debian GNU/Linux system. For given R package it | # tries to get Debian package and install/upgrade it with apt-get if it | # exists. Otherwise install.packages() is used. | # Gregor GORJANC 2004-12-30 | | # Arguments: | # package: R package name as character, only one | # ...: other parameters for install.packages() or update.packages() | | # Examples: | # debian.install.packages("Design") | | # Code: | # apt-get update i.e. refresh list of Debian packages | system(apt-get update) | | # Transform R package name to Debian package name policy i.e change R | # package name to lowercase and test if this Debian package exists | # (test1). This could be done without grep, but then it is not possible | # to test on exit status, since apt-cache search always returns 0. | packagelow <- tolower(package) | tmp1 <- c("system(\"apt-cache search ^r- | grep") | tmp2 <- c("| awk '{print $1}'\", intern = TRUE\)") | tmp3 <- as.expression(paste(tmp1, packagelow, tmp2, "\n")) | deb <- eval(parse(file = "", text = tmp3)) | | cat("\nR package:", package, "\n") | cat("Corresponding Debian package name:", deb, "\n") | | # Package install/update or upgrade in apt meaning | if (length(deb) != 0) { # Debian package does exist | cat("Debian package", deb, "exists: yes\n") | cat("Proceeding with apt-get.\n") | | # apt-get install, which can also be used for package upgrade | tmp1 <- c("system(\"apt-get install") | tmp2 <- as.expression(paste(tmp1, deb, "\")", "\n")) | eval(parse(file = "", text = tmp2)) | } | else { # Debian package doesn't exist or something went wrong in test1 | cat("Debian package", deb, "exists: no\n") | # cat("Proceeding with install/update.packages().\n") | # install.update.packages(package, ...) | cat("Proceeding with install.packages().\n") | install.packages(package, ...) | } | } As Tony said in his follow-up, the mixing and matching is hard to do properly, which is why I think the high-end solution is to provide a robust script, maybe with a db backend, that debianises what is on CRAN -- similar to what exists on Windows. We'd simply use apt-get instead of install.packages() wherever possible. | One more thing. Why is r-noncran-lindsey and not r-other-lindsey? Because nobody pressed Chris hard enough to implement the change. I am sure he would take a patch from you (hint, hint). Cheers, Dirk PS Adorable type in you Subject line. I have done gazillion times as well :) | | -- | Lep pozdrav / With regards, | Gregor Gorjanc | | ------------------------------------------------------------------------ | University of Ljubljana | Biotechnical Faculty URI: http://www.bfro.uni-lj.si/MR/ggorjan | Zootechnical Department email: gregor.gorjanc <at> bfro.uni-lj.si | Groblje 3 tel: +386 (0)1 72 17 861 | SI-1230 Domzale fax: +386 (0)1 72 17 888 | Slovenia | | _______________________________________________ | R-SIG-Debian mailing list | R-SIG-Debian@r-project.org | https://stat.ethz.ch/mailman/listinfo/r-sig-debian -- Better to have an approximate answer to the right question than a precise answer to the wrong question. -- John Tukey as quoted by John Chambers
On 4/24/05, Dirk Eddelbuettel <edd@debian.org> wrote:> Because nobody pressed Chris hard enough to implement the change. I am sure > he would take a patch from you (hint, hint).-lindsey is sufficiently annoying for this and other reasons that I plan to either orphan it or ask for its removal. Chris -- Chris Lawrence - http://blog.lordsutch.com/
Hello! Sorry for late response. I just had to check all this allioth stuf etc.> -----Original Message----- > From: Dirk Eddelbuettel [mailto:edd@debian.org] > Sent: ned 2005-04-24 19:45 > To: Gorjanc Gregor > Cc: r-sig-debian@r-project.org; pkg-bioc-devel@lists.alioth.debian.org; lawrencc@debian.org > Subject: Re: [R-sig-Debian] "Debain" way of installing packages > > Hi Gregor, > > Your enthusiasm in this matter is greatly appreciated. I am CC'ing this to > the existing list on the alioth.debian.org hosting system: pkg-bioc-devel. > This was initially set up my Matt Hope to foster debianising BioC, I then > threw my exisiting Perl infrastructure (used previously for Quantian) at it > and Egon Willighagen carried it from there with further improvements, > incl. large scale builds of amd64 packages. > > With a little push from all of us (Hi Tony, Hi Matt, Hi Egon, Hi > anybody-else-willing-to-chip-in :) we can make this even better and hopefully > have something proper by the summer, maybe for DSC 20003.[... snip ...]> As Tony said in his follow-up, the mixing and matching is hard to doYes, mixing is hard and confusing.> properly, which is why I think the high-end solution is to provide a robust > script, maybe with a db backend, that debianises what is on CRAN -- similarWhat do you mean by a db (I suppose databse) backend, that debianises ...? If I understand you propose to debianize all R packages and then simply use apt-get. This would probably be the easisest way, however only if this is really achivable. My help on debianization can be very small since I have never tried to do that, but I am willing to learn and help. If previous is true, you think that some sort script I proposed is not OK for mixing?> to what exists on Windows. We'd simply use apt-get instead ofWhat is the case with Windows? Do you mean build of binary packages for Windows or what?> | One more thing. Why is r-noncran-lindsey and not r-other-lindsey?> Because nobody pressed Chris hard enough to implement the change. I am sure > he would take a patch from you (hint, hint). >From words of Chris this doesn't seems to be needed, however I don't know what isthe problem with that package from Lindsey. Gregor
Hello!> ----Original Message----- > From: Dirk Eddelbuettel [mailto:edd@debian.org] > Sent: sre 2005-04-27 02:35 > To: Gorjanc Gregor > Cc: r-sig-debian@r-project.org; pkg-bioc-devel@lists.alioth.debian.org; Chris Lawrence > Subject: RE: [R-sig-Debian] "Debain" way of installing packages > > On 26 April 2005 at 12:11, Gorjanc Gregor wrote: > | > properly, which is why I think the high-end solution is to provide a robust > | > script, maybe with a db backend, that debianises what is on CRAN -- similar > | What do you mean by a db (I suppose databse) backend, that debianises ...? > > Yes, to keep track of versions, of what has been packaged, of meta data as > e.g. mapping of package names between Debian and CRAN, of exceptions (CRAN is > somwhat more lenient with licenses) etc pp. "Debianising" is stateful, so we > need memory. Flat files may well do for the time being before we switch to an > actual db (which may just be sqlite, ie a binary file as backend).OK, I see. It's clearer to me now. Thanks!> | If I understand you propose to debianize all R packages and then simply use > | apt-get. This would probably be the easisest way, however only if this is really > | achivable. My help on debianization can be very small since I have never tried > | to do that, but I am willing to learn and help. > | > | If previous is true, you think that some sort script I proposed is not OK for > | mixing? > > We actually have scripts that "work", they simply need testing, extending and > polishing. If you register yourself on alioth.d.o, you can check it out of > the archive and play with it.I will try that and play with scripts. However my idea was to provide apt-get within R i.e. through "debian.install.packages" or something like that. What do you think about that feature? It would be nice to have since we can have all packages debianized, but if someone uses install.packages then ... However, it is truth that Debian packages will be loaded first, since its lib is by default before R packages installed by install.packages. Am I right?> | What is the case with Windows? Do you mean build of binary packages for Windows > | or what? > > That was just an example as CRAN provides binaries for Windows. My medium to > longer-term vision is binaries for Debian and its derivative distros.How does Uwe Ligges perform all those binary builds for Windows? Regards, Gregor