From owner-freebsd-ports@FreeBSD.ORG Sat Nov 2 18:16:01 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D832026D for ; Sat, 2 Nov 2013 18:16:01 +0000 (UTC) (envelope-from mailnull@mips.inka.de) Received: from mail-in-12.arcor-online.net (mail-in-12.arcor-online.net [151.189.21.52]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A96F21AD for ; Sat, 2 Nov 2013 18:16:01 +0000 (UTC) Received: from mail-in-13-z2.arcor-online.net (mail-in-13-z2.arcor-online.net [151.189.8.30]) by mx.arcor.de (Postfix) with ESMTP id 72A79262D9 for ; Sat, 2 Nov 2013 18:09:34 +0100 (CET) Received: from mail-in-10.arcor-online.net (mail-in-10.arcor-online.net [151.189.21.50]) by mail-in-13-z2.arcor-online.net (Postfix) with ESMTP id 6BFA314B259 for ; Sat, 2 Nov 2013 18:09:34 +0100 (CET) X-Greylist: Passed host: 188.105.85.109 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-10.arcor-online.net 4A0522D63F9 Received: from lorvorc.mips.inka.de (dslb-188-105-085-109.pools.arcor-ip.net [188.105.85.109]) by mail-in-10.arcor-online.net (Postfix) with ESMTPS id 4A0522D63F9 for ; Sat, 2 Nov 2013 18:09:34 +0100 (CET) Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.14.7/8.14.7) with ESMTP id rA2H9Xbu086716 for ; Sat, 2 Nov 2013 18:09:33 +0100 (CET) (envelope-from mailnull@lorvorc.mips.inka.de) Received: (from mailnull@localhost) by lorvorc.mips.inka.de (8.14.7/8.14.7/Submit) id rA2H9X6e086715 for freebsd-ports@freebsd.org; Sat, 2 Nov 2013 18:09:33 +0100 (CET) (envelope-from mailnull) From: naddy@mips.inka.de (Christian Weisgerber) Subject: Re: How to reference /var/foo in pkg-plist? Date: Sat, 2 Nov 2013 17:09:33 +0000 (UTC) Message-ID: References: <20131102123306.6dc56e4f@kalimero.tijl.coosemans.org> Originator: naddy@mips.inka.de (Christian Weisgerber) To: freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2013 18:16:01 -0000 Tijl Coosemans wrote: > Try something like this in pkg-plist: > > @unexec rm -d /var/foo 2>/dev/null || true > @exec install -d -o uucp -g uucp -m 0770 /var/foo > > The directory is created on installation and removed (if empty) on > deletion, but is not actually part of the package archive. @exec install -d -o uucp -g uucp -m 0770 /var/spool/bsmtp @unexec rmdir /var/spool/bsmtp 2>/dev/null || true ===> Building package for bsmtp-1.02_5 pkg-static: lstat(/usr/ports/mail/bsmtp/work/stage/var/spool/bsmtp/): No such file or directory We have come full circle in this thread. So even if I use the @unexec/@exec lines above, the directory that does not become part of the package archive must still be created under STAGEDIR. Okay, I can just do that in post-install. It doesn't make sense, but whatever. But even better: $ tar tvf /usr/ports/packages/All/bsmtp-1.02_5.txz [...] drwxr-xr-x 0 naddy wheel 0 Nov 2 17:59 /usr/local/libexec/bsmtp/ drwxr-xr-x 0 naddy wheel 0 Nov 2 17:59 /usr/local/share/doc/bsmtp/ drwxr-xr-x 0 naddy wheel 0 Nov 2 17:59 /usr/local/share/sendmail/ drwxr-xr-x 0 naddy wheel 0 Nov 2 17:59 /var/spool/bsmtp/ The directory still magically becomes part of the package archive! And this seems to override the permissions from the @exec. $ ls -ld /var/spool/bsmtp drwxr-xr-x 2 uucp uucp 512 Nov 2 17:59 /var/spool/bsmtp -- Christian "naddy" Weisgerber naddy@mips.inka.de