Using customised usernames in ports

Chris Rees utisoft at gmail.com
Sun Dec 18 16:17:20 UTC 2011


Hi all,

Since we've stopped using pkg-install scripts and started using USERS=
and GROUPS= to create users and groups we've lost the ability to
provide an alternative username/groupname for the port to install
with.

It's still possible to do for a port (ex postgresql):

PG_USER?= pgsql

USERS= ${PG_USER}

but if PG_USER is set to something different, a new line in
/usr/ports/UIDs must be added to match it, and put back every time the
port is upgraded.

The patch at [1] will allow a username already existing on the system
to be used instead, so it'll be easy enough for the end user to create
the user and group then set the PG_USER (or whatever) in make.conf,
and packages will also be built using the correct user.

Thanks to brooks@ for pointing out the use of getent.

Comments?

Chris

[1] http://www.bayofrum.net/~crees/patches/bsd-port-mk-users-existing.diff


More information about the freebsd-ports mailing list