Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Aug 2006 17:59:18 -0600
From:      John E Hein <jhein@timing.com>
To:        =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= <gabor@FreeBSD.org>, ports@FreeBSD.org
Subject:   Re: support for DESTDIR: security/openssh-portable
Message-ID:  <17626.30422.650339.960580@gromit.timing.com>
In-Reply-To: <17626.29481.909830.326948@gromit.timing.com>
References:  <17626.25183.846983.515718@gromit.timing.com> <17626.25444.563099.956775@gromit.timing.com> <44DA6FC9.3040404@FreeBSD.org> <17626.29481.909830.326948@gromit.timing.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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"



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