[Rd] R-Project build system: DESTDIR support

Claudio Fontana sick_soul at yahoo.it
Tue Feb 28 12:09:34 CET 2006


--- Hin-Tak Leung <hin-tak.leung at cimr.cam.ac.uk>
wrote:

> Claudio Fontana wrote:
> > Hello,
> > 
> > --- Hin-Tak Leung <hin-tak.leung at cimr.cam.ac.uk>
> <snipped>
> >>Change to DESTDIR should be quite simple. I think
> it
> >>is mostly one
> >>line change in R/Makeconf.in,
> >>where
> >>        rhome = ${libdir}/R
> >>to
> >>        rhome = ${DESTDIR}/${libdir}/R
> >>and maybe one or two other places, concerning that
> >>wrapper script.
> > 
> > 
> > Please DON'T. If I understood your idea correctly,
> > this is not the meaning of DESTDIR,
> > and placing DESTDIR there is harmful since its
> meaning
> > is overloaded. The staged installation does _not_
> need
> > to be functional. Its hard coded paths must refer
> to
> > the _final destination_ which is determined by
> prefix
> > only.
> <snipped>
> > Then try this (replace user with your user name):
> > 
> > $ tar -zxvf bc-1.06.tar.gz
> > $ cd bc-1.06
> > $ ./configure --prefix=/home/user/tmp
> > $ make
> > $ make install DESTDIR=/home/user/install-destdir
> > $ ls /home/user/tmp
> > ls: /home/user/tmp: No such file or directory
> > $ find /home/user/install-destdir
> > [study the output of this command]
> 
> I don't think you understand me correctly.

I am now pretty sure I did.

> Doing the insertion as I wrote, (Makeconf.in is
> included by R's top-level Makefile as far as I
> understand it),
> would make "make install DESTDIR=/someotherroot/"
> work.

It works, but not in the way its intended.

> Either way, please study what Makeconf.in
> does.
> 
> HTL

I did, and does not seem ok.
Look:

- make the change in Makeconf.in:
  rhome = $(DESTDIR)${libdir}/R

now I do:

$ ./configure --prefix=/home/claudio/tmp
$ make
$ make install DESTDIR=/home/claudio/install-destdir

$ find /home/claudio/tmp
/home/claudio/tmp
/home/claudio/tmp/man
/home/claudio/tmp/man/man1
/home/claudio/tmp/man/man1/R.1
/home/claudio/tmp/bin
/home/claudio/tmp/bin/R

[not ok, should return: /home/claudio/tmp: No such
file or directory. ]

Now for the more important thing:

$ cat /home/claudio/tmp/bin/R
#!/bin/sh
# Shell wrapper for R executable.

R_HOME_DIR=/home/claudio/install-destdir/home/claudio/tmp/lib/R
if test -n "${R_HOME}" && \
   test "${R_HOME}" != "${R_HOME_DIR}"; then
  echo "WARNING: ignoring environment value of R_HOME"
fi
R_HOME="${R_HOME_DIR}"
export R_HOME
R_SHARE_DIR=/home/claudio/install-destdir/home/claudio/tmp/lib/R/share
export R_SHARE_DIR
R_INCLUDE_DIR=/home/claudio/install-destdir/home/claudio/tmp/lib/R/include
export R_INCLUDE_DIR
R_DOC_DIR=/home/claudio/install-destdir/home/claudio/tmp/lib/R/doc
export R_DOC_DIR

 [
  not ok: the software itself must be DESTDIR unaware.
  Those paths should read for example:
  R_SHARE_DIR=/home/claudio/tmp/lib/R/share

  The binaries, the datafiles, and the content of
  everything else that gets installed should be 
  indistinguishable from a non-DESTDIR installation.
  Moving the staged installation to the
  final place should be (more or less[...]) a matter
  of one mv command.
 ]

Do you see the difference in meaning between your
concept and the DESTDIR concept?

CLaudio



More information about the R-devel mailing list