Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Nov 2013 17:09:33 +0000 (UTC)
From:      naddy@mips.inka.de (Christian Weisgerber)
To:        freebsd-ports@freebsd.org
Subject:   Re: How to reference /var/foo in pkg-plist?
Message-ID:  <l53bkd$2dgm$1@lorvorc.mips.inka.de>
References:  <l4eive$e4e$1@lorvorc.mips.inka.de> <CACdU%2Bf9iy2bmv6yxyGyDoEODqfk38oGVTGqxHPEFJgr4cASuQg@mail.gmail.com> <l51947$2f85$1@lorvorc.mips.inka.de> <20131102123306.6dc56e4f@kalimero.tijl.coosemans.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Tijl Coosemans <tijl@coosemans.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?l53bkd$2dgm$1>