leaving behind .sample files and pkg_add alternate registerdb

Scot Hetzel swhetzel at gmail.com
Sat Aug 27 14:31:39 GMT 2005


On 8/27/05, Marco van de Voort <marcov at stack.nl> wrote:
> 
> > I've been working on a port recently, and ran into two small questions:
> >
> > 1) is it evil to leave behind .cfg.sample files? If so, how do I add them
> >   to pkg-plist and avoid errors if the user moved (instead of copied) them
> >   to the .cfg ? @unexec? If so, how would it look for a file?
> >
Yes, it is evil to leave the *.sample files behind, you'll need to add
2 lines to the package:

@unexec if cmp -s %D/etc/example.conf %D/etc/example.conf-dist; then
rm -f %D/etc/example.conf; fi
etc/example.conf-dist
@exec [ -f %B/example.conf ] || cp %B/%f %B/example.conf

the @unexec removes example.conf if it is the same as example.conf-dist
the @exec creates example.conf if it doesn't exist

> 3) Is it possible that pkg_create doesn't add/create empty directories?
> (I copied an example dir from a src archive, and it had empty CVS/ dirs
> in it)
> 
You'll need to have your port create and remove the empty directories:

@cwd /var
@mode ug=rwx,o=
@exec mkdir -p /var/state/saslauthd1
@exec chown -R cyrus:cyrus state
@exec chmod -R o= state
@unexec rmdir /var/state/saslauthd1
@unexec rmdir /var/state

Scot
-- 
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.


More information about the freebsd-ports mailing list