[Rd] Building Packages on Windows using .Rbuildignore

Gabor Grothendieck ggrothendieck at myway.com
Wed Nov 17 21:44:48 CET 2004

Duncan Murdoch <murdoch <at> stats.uwo.ca> writes:

: On Wed, 17 Nov 2004 18:10:20 +0000 (UTC), Gabor Grothendieck
: <ggrothendieck <at> myway.com> wrote :
: >
: >I have some questions about building packages in Windows 
: >when using .Rbuildignore .  The part of the process that
: >is of interest here is the part that creates the source
: >tree from the tree that contains the .Rbuildignore file.
: >That is, the part of the process that does a build of
: >the original tree creating a .tar.gz and then extracts
: >this file into a source directory that can be used by
: >check, build --binary and install.
: >
: >1. makefiles
: >
: >I was developing some batch files for myself using R CMD ...
: >but then noticed the Windows makefiles.
: >
: >- Do the makefiles take into account the situation above?
: >
: >- If so, do I need to do anything special to use them this way?
: I don't think I understand exactly what you're asking.  

If one does not use .Rbuildignore then with a pure R package
one can run off the original source files, in this case
in /wherever/mypkg, like this:
...without .Rbuildignore ...
R CMD install /wherever/mypkg
R CMD check /wherever/mypkg
R CMD build /wherever/mypkg
R CMD build /wherever/mypkg --binary

but if one DOES use .Rbuildignore then one must first build the
package to remove the .Rbuildignore cited files and then run off
the built files which were created by unpacking the tar.gz file.
Below we build the files in /wherever/mypkg and put the resulting
.tar.gz in the current diretory and then unpack it and run the
remaining commands off the unpacked directory (unlike the previous
case where we ran everything off the original directory, viz.

... with .Rbuildignore ...

R CMD build /wherever/mypkg
tar xvzf mypkg_0.9-1.tar.gz

... now that we have created a new source directory, mypkg, without
... the .Rbuildignore files we can proceed by running off of that.
... Note that mypkg is different than /wherever/mypkg as the former
... does not contain the ignored files.
R CMD install mypkg
R CMD check mypkg
R CMD build mypkg --binary

I was writing a batch file to handle this second case for me
but was wondering if I was just duplicating work that has
already been done or can easily be done with existing makefiles
or somehow using configure.win.

: >2. configure.win
: >
: >Also I noticed reference to configure.win in the Extensions
: >manual and am not sure if that can be used to address this.
: >I tried creating a one line configure.win which just does
: >an echo of a fixed string "echo XYZ" but I did not see XYZ
: >during my R CMD install.
: >
: >- Is configure.win supposed to be written using Windows batch commands
: >  or UNIX-like commands?
: It is run under "sh", not the standard Windows interpreter, so
: "UNIX-like".  
: I just tried it with "Rcmd install", and I did see the message echoed.
: I didn't see it for "Rcmd build", because that doesn't build the
: package, it just puts it in a tarball, but "Rcmd build --binary" does
: run it.
: >
: >- where does it go.  (I tried putting it in the same directory as
: >  my DESCRIPTION file.)
: It should be in the same directory as DESCRIPTION.
: >- is it a suitable device for handling the .Rbuildignore issue?
: What's the issue exactly?
: Duncan Murd

More information about the R-devel mailing list