From owner-freebsd-ports@FreeBSD.ORG Thu Aug 10 13:25:55 2006 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B39A16A4DE for ; Thu, 10 Aug 2006 13:25:55 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.t-hosting.hu (server.t-hosting.hu [217.20.133.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFA7C43D53 for ; Thu, 10 Aug 2006 13:25:48 +0000 (GMT) (envelope-from gabor@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by server.t-hosting.hu (Postfix) with ESMTP id 8FB4399BB79; Thu, 10 Aug 2006 15:25:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at t-hosting.hu Received: from server.t-hosting.hu ([127.0.0.1]) by localhost (server.t-hosting.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EYhrEsWTFPM1; Thu, 10 Aug 2006 15:25:41 +0200 (CEST) Received: from [192.168.2.186] (catv-50635cb6.catv.broadband.hu [80.99.92.182]) by server.t-hosting.hu (Postfix) with ESMTP id C141299B9CC; Thu, 10 Aug 2006 15:25:41 +0200 (CEST) Message-ID: <44DB33D2.4070308@FreeBSD.org> Date: Thu, 10 Aug 2006 15:25:38 +0200 From: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Brooks Davis 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> <17626.30422.650339.960580@gromit.timing.com> <20060810132105.GA20275@lor.one-eyed-alien.net> In-Reply-To: <20060810132105.GA20275@lor.one-eyed-alien.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: ports@freebsd.org, John E Hein Subject: Re: support for DESTDIR: security/openssh-portable X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Aug 2006 13:25:55 -0000 Brooks Davis wrote: > 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 > We wanted to go that way with garga when working on security/clamav, but we realized that we can't just do chroot /foo pkg-install, since the script is not located in the chroot itself. Do you have an another idea, how to chroot those scripts? -- Cheers, Gabor