How to reference /var/foo in pkg-plist?
Christian Weisgerber
naddy at mips.inka.de
Sat Nov 2 18:16:01 UTC 2013
Tijl Coosemans <tijl at 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 at mips.inka.de
More information about the freebsd-ports
mailing list