Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Aug 2006 01:47:58 +0200
From:      =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= <gabor@FreeBSD.org>
To:        John E Hein <jhein@timing.com>
Cc:        ports@FreeBSD.org
Subject:   Re: support for DESTDIR: security/openssh-portable
Message-ID:  <44DA742E.1060709@FreeBSD.org>
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:
> Gábor Kövesdán wrote at 01:29 +0200 on Aug 10, 2006:
>  > John E Hein wrote:
>  > > John E Hein wrote at 16:31 -0600 on Aug  9, 2006:
>  > >  > Now that ports/Mk does the right thing for DESTDIR (thanks to Gábor),
>  > >  > here's a patch that supports DESTDIR properly for
>  > >  > security/openssh-portable:
>  > >  > 
>  > > [snip]
>  > >  > @@ -171,29 +171,33 @@ post-extract:
>  > >  >  post-patch:
>  > >  >  	@${REINPLACE_CMD} -e 's|-ldes|-lcrypto|g' ${WRKSRC}/configure
>  > >  >  
>  > >  > +.if defined(DESTDIR) && !empty(DESTDIR)
>  > >  > +CHROOTDESTDIR=${CHROOT} ${DESTDIR}
>  > >  > +.endif
>  > >  > +
>  > > [snip]
>  > >  >  .endif
>  > >  > -	if ! pw groupshow sshd; then pw groupadd sshd -g 22; fi
>  > >  > -	if ! pw usershow sshd; then pw useradd sshd -g sshd -u 22 \
>  > >  > +	if ! ${CHROOTDESTDIR} pw groupshow sshd; then ${CHROOTDESTDIR} pw groupadd sshd -g 22; fi
>  > >  > +	if ! ${CHROOTDESTDIR} pw usershow sshd; then ${CHROOTDESTDIR} pw useradd sshd -g sshd -u 22 \
>  > >  >  		-h - -d ${EMPTYDIR} -s /nonexistent -c "sshd privilege separation"; fi
>  > >
>  > > Gabor, you may want to define CHROOTDESTDIR (or name it whatever you
>  > > want) as a convenience var in bsd.port.mk
>  > >
>  > > I suspect lots of ports will want to use it.
>  > >   
>  > Might be good, but personally I think ${CHROOT} ${DESTDIR} is more 
>  > trivial (easier to read and understand) and only longer with 4 
>  > characters. One might wonder at first look what CHROOTDESTDIR is.
>
> 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.
>   
Ah, you mean defining CHROOTDESTDIR only when DESTDIR is set and leave 
it empty when not? It sounds reasonable then. I'll work this out after 
some hours of sleeping. :)

-- 
Cheers,

Gabor




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