support for DESTDIR: security/openssh-portable

Brooks Davis brooks at one-eyed-alien.net
Thu Aug 10 13:21:10 UTC 2006


On Wed, Aug 09, 2006 at 05:59:18PM -0600, John E Hein wrote:
> John E Hein wrote at 17:43 -0600 on Aug  9, 2006:
>  > Well, the part that makes it annoying to duplicate in all ports is not
>  > the two separate words (CHROOT DESTDIR), but that you have to test
>  > defined(DESTDIR) && !empty(DESTDIR) before you can figure out whether
>  > to use ${CHROOT} ${DESTDIR} or not.
>  > 
>  > So having that test to assign CHROOTDESTDIR or leave it empty in
>  > bsd.port.mk allows the port writer to just always invoke it without
>  > having to worry about testing for DESTDIR.
> 
> You could pass this var to pkg-install scripts, too (put it in the
> standard *SUB* lists).
> 
> That way you don't have to do the dance that was added to
> security/clamav/files/pkg-install.in:
> 
> if [ -n "%%DESTDIR%%" ]; then
>         PW="/usr/sbin/chroot %%DESTDIR%% pw"
>         CHOWN="/usr/sbin/chroot %%DESTDIR%% chown"
>         MKDIR="/usr/sbin/chroot %%DESTDIR%% mkdir -p"
> else
>         PW="pw"
>         CHOWN="chown"
>         MKDIR="mkdir -p"
> fi
> 
> but rather just:
> 
> PW="%%CHROOTDESTDIR%% pw"
> CHOWN="%%CHROOTDESTDIR%% chown"
> MKDIR="%%CHROOTDESTDIR%% mkdir -p"

This seems bogus.  I can't think of any good reason why packages should
differ based on the valid of DESTDIR.  Instead the pkg-install script
should be run inside the chroot.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20060810/80e2e1b8/attachment.pgp


More information about the freebsd-ports mailing list