[R-pkg-devel] Running a script after a package has been installed.

Dirk Eddelbuettel edd at debian.org
Wed Jun 3 14:31:12 CEST 2015


On 3 June 2015 at 07:13, Dirk Eddelbuettel wrote:
| 
| On 3 June 2015 at 12:51, Luca Cerone wrote:
| | Dear all,
| | I am writing a package that contains some binaries that should be
| | linked in /usr/bin after the package
| 
| [ Don't do that, /usr is for your system. Use /usr/local/bin. ]
| 
| | has been installed (I placed them in Rpackage/inst/bin)
| | 
| | I know I can use a script "configure" or "configure.win" to be run
| | before the package has been installed, is there a way I can write a
| | script that is run after the package has been correctly installed?
| 
| You can't. I miss that too.
| 
| We do the same thing at work -- scripts (often via Rscript or littler) go
| into into/scripts inside a package, we then have to (at least _one time_)
| create a softlink from /usr/local/bin into (on our systems with Debian/Ubuntu
| paths) /usr/local/lib/R/site-library/PKG/script/SCRIPT where PKG and SCRIPT
| vary.
| 
| Having more 'hooks' in the R CMD INSTALL ... process would be nice, but it
| doesn't exist now.

I just realized that you could abuse configure to create the link described 
above.  Not elegant, and in the wrong order ("don't know yet if build will
succeed") but a hack.

Dirk
 
| One alternative is to package the R package as a .deb package to use the
| proper postinst.  But that may be overkill / does not help on other OS.
| 
| Dirk
| 
| -- 
| http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
| 
| ______________________________________________
| R-package-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-package-devel mailing list