Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2006 00:20:09 +0400
From:      Dmitry Marakasov <amdmi3@mail.ru>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        babak@farrokhi.net, John E Hein <jhein@timing.com>, freebsd-ports@FreeBSD.org, G??bor K??vesd??n <gabor@FreeBSD.org>
Subject:   Re: DESTDIR implementation [Was:: ATTENTION: is the way DESTDIR was introduced completely wrong?]
Message-ID:  <20060816202009.GB71853@hades.panopticon>
In-Reply-To: <20060816173628.GA14848@xor.obsecurity.org>
References:  <20060814234414.GA57035@hades.panopticon> <44E194BA.2020507@FreeBSD.org> <17634.5246.887894.836856@gromit.timing.com> <20060816173628.GA14848@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Kris Kennaway (kris@obsecurity.org) wrote:
> > The hard part is to get ports writers to think the right way about
> > DESTDIR after ignoring it for so many years.  And once you decide to
> > go about fixing it, there's no way around that problem.
> 
> My preferred solution involves a couple of shell commands, along the
> lines of the following:
> 
> mount_nullfs ${PORTSDIR} ${DESTDIR}${PORTSDIR}
> mount_nullfs ${WRKDIR} ${DESTDIR}${WRKDIR}
> mount_devfs foo ${DESTDIR}/dev
> chroot ${DESTDIR} cd ${.CURDIR} && make install
> 
> A suitable version of the above should allow all ports to be installed
> into a jail-ready filesystem hierarchy, while requiring 0 port
> changes.
This seem pretty obvious solution and it will work in most of cases. But
there are caveats though. What comes to my mind:
* /etc/make.conf vs. ${DESTDIR}/etc/make.conf issue (that's also
  important with real DESTDIR). This can't be resolved easily -
  if DESTDIR is jail, it's likely that /etc/make.conf is need, but if
  remote system is mounted over NFS, ${DESTDIR}/etc/make.conf is to be
  used.
* It was mentioned already, I'll second: I don't trush nullfs much :)
* Both current and nullfs-drived DESTDIR implementations require all
  depends in the DESTDIR. But actually BUILD_DEPENDS from host can be
  used.

I had also thinked over an idea of package-driven DESTDIR
implementation. Like automated building packages on the host system and
then installing them into DESTDIR.
No nullfs, no makefile dualism, no need to change ports, small amount of
changes to Mk/, BUILD_DEPENDS don't get installed into DESTDIR. But, no
support for cross-builds.

-- 
Best regards,
 Dmitry                          mailto:amdmi3@mail.ru



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060816202009.GB71853>