diff options
author | crees <crees@FreeBSD.org> | 2011-06-28 01:52:38 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2011-06-28 01:52:38 +0800 |
commit | d31773731c559bad28623eed38171641552f0bdb (patch) | |
tree | cdc360133315221585438ec5275a77b3f7668359 /mail | |
parent | e98a75d951030157383c94c63042e7573797e5ef (diff) | |
download | freebsd-ports-graphics-d31773731c559bad28623eed38171641552f0bdb.tar.gz freebsd-ports-graphics-d31773731c559bad28623eed38171641552f0bdb.tar.zst freebsd-ports-graphics-d31773731c559bad28623eed38171641552f0bdb.zip |
- Use USERS and GROUPS
PR: ports/157576
Submitted by: Chris Rees (utisoft@gmail.com)
Approved by: tabthorpe (co-mentor), maintainer
Diffstat (limited to 'mail')
-rw-r--r-- | mail/dkfilter/Makefile | 14 | ||||
-rw-r--r-- | mail/dkfilter/files/pkg-deinstall.in | 13 | ||||
-rw-r--r-- | mail/dkfilter/files/pkg-install.in | 36 |
3 files changed, 3 insertions, 60 deletions
diff --git a/mail/dkfilter/Makefile b/mail/dkfilter/Makefile index 16d432911c7..089fc2570ce 100644 --- a/mail/dkfilter/Makefile +++ b/mail/dkfilter/Makefile @@ -24,18 +24,10 @@ GNU_CONFIGURE= yes USE_PERL5= yes USE_RC_SUBR= dkfilter_in dkfilter_out +USERS= ${DKFILTER_USERNAME} +GROUPS= ${DKFILTER_GROUPNAME} + DKFILTER_USERNAME?= dkfilter -DKFILTER_USERID?= 325 DKFILTER_GROUPNAME?= ${DKFILTER_USERNAME} -DKFILTER_GROUPID?= ${DKFILTER_USERID} - -SUB_FILES= pkg-install pkg-deinstall -SUB_LIST= USER=${DKFILTER_USERNAME} \ - UID=${DKFILTER_USERID} \ - GROUP=${DKFILTER_GROUPNAME} \ - GID=${DKFILTER_GROUPID} - -pre-install: - ${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL .include <bsd.port.mk> diff --git a/mail/dkfilter/files/pkg-deinstall.in b/mail/dkfilter/files/pkg-deinstall.in deleted file mode 100644 index 65b9aec55e4..00000000000 --- a/mail/dkfilter/files/pkg-deinstall.in +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -if [ "$2" != "POST-DEINSTALL" ]; then - exit 0 -fi - -USERNAME=%%USER%% - -if pw usershow "${USERNAME}" 2>/dev/null 1>&2; then - echo "To delete ${USERNAME} user permanently, use 'pw userdel \"${USERNAME}\"'" -fi -exit 0 diff --git a/mail/dkfilter/files/pkg-install.in b/mail/dkfilter/files/pkg-install.in deleted file mode 100644 index 75041933c0f..00000000000 --- a/mail/dkfilter/files/pkg-install.in +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -# -# $FreeBSD$ - -PATH=/bin:/usr/bin:/usr/sbin - -case $2 in - -PRE-INSTALL) - echo "---> Starting install script:" - - if [ -z "%%USER%%" -o -z "%%GROUP%%" -o \ - -z "%%UID%%" -o -z "%%GID%%" ]; then - echo "ERROR: A required pragma was empty" - exit 1 - fi - - # Create group if required - if pw group show "%%GROUP%%" >/dev/null 2>&1; then - echo "---> Using existing group \"%%GROUP%%\"" - else - echo "---> Adding group \"%%GROUP%%\" (%%GID%%)" - /usr/sbin/pw groupadd %%GROUP%% -g %%GID%% || exit 1 - fi - - # Create user if required - if pw user show "%%USER%%" >/dev/null 2>&1; then - echo "---> Using existing user \"%%USER%%\"" - else - echo "---> Adding user \"%%USER%%\" (%%UID%%)" - pw useradd "%%USER%%" -u "%%UID%%" -g "%%GROUP%%" -h - \ - -d "/nonexistent" -s "/sbin/nologin" -c "DK Filter Owner" || exit 1 - fi - ;; - -esac |