diff options
author | ume <ume@FreeBSD.org> | 2011-06-12 01:58:32 +0800 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2011-06-12 01:58:32 +0800 |
commit | 10d199a26726f0ba5ca8b7834edfe88abc90c6e8 (patch) | |
tree | 1fff64a36881ad2082cf4882aefd55f90ca22fac /japanese | |
parent | 5d48cf262ac186681a023b6f035d4871220ec085 (diff) | |
download | freebsd-ports-gnome-10d199a26726f0ba5ca8b7834edfe88abc90c6e8.tar.gz freebsd-ports-gnome-10d199a26726f0ba5ca8b7834edfe88abc90c6e8.tar.zst freebsd-ports-gnome-10d199a26726f0ba5ca8b7834edfe88abc90c6e8.zip |
Use USERS and GROUPS.
PR: ports/157596
Submitted by: Chris Rees <utisoft__at__gmail.com>
Diffstat (limited to 'japanese')
-rw-r--r-- | japanese/tiarra/Makefile | 8 | ||||
-rw-r--r-- | japanese/tiarra/files/pkg-deinstall.in | 21 | ||||
-rw-r--r-- | japanese/tiarra/files/pkg-install.in | 71 |
3 files changed, 4 insertions, 96 deletions
diff --git a/japanese/tiarra/Makefile b/japanese/tiarra/Makefile index e3c906fa0e44..951b6da86456 100644 --- a/japanese/tiarra/Makefile +++ b/japanese/tiarra/Makefile @@ -21,9 +21,10 @@ USE_BZIP2= yes USE_RC_SUBR= tiarra NO_BUILD= yes -SUB_FILES= pkg-install pkg-deinstall pkg-message -SUB_LIST= TIARRA_USER=${TIARRA_USER} \ - TIARRA_GROUP=${TIARRA_GROUP} +USERS= ${TIARRA_USER} +GROUPS= ${TIARRA_GROUP} + +SUB_FILES= pkg-message PLIST_SUB= TIARRA_USER=${TIARRA_USER} \ TIARRA_GROUP=${TIARRA_GROUP} @@ -32,7 +33,6 @@ TIARRA_USER= tiarra TIARRA_GROUP= tiarra do-install: - @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL @${MKDIR} ${PREFIX}/tiarra @${TAR} cfC - ${WRKSRC} . | ${TAR} xfC - ${PREFIX}/tiarra @if [ ! -f ${PREFIX}/tiarra/tiarra.conf ]; then \ diff --git a/japanese/tiarra/files/pkg-deinstall.in b/japanese/tiarra/files/pkg-deinstall.in deleted file mode 100644 index 6e3a84cb6fcd..000000000000 --- a/japanese/tiarra/files/pkg-deinstall.in +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ - -TIARRA_USER=${TIARRA_USER:=%%TIARRA_USER%%} -TIARRA_GROUP=${TIARRA_GROUP:=%%TIARRA_GROUP%%} - -delete_user() { - if pw usershow ${TIARRA_USER} 2>/dev/null 1>&2; then - echo "To delete tiarra user permanently, use 'pw userdel ${TIARRA_USER}'" - fi - if pw groupshow ${TIARRA_GROUP} 2>/dev/null 1>&2; then - echo "To delete tiarra group permanently, use 'pw groupdel ${TIARRA_GROUP}'" - fi -} - -case $2 in -POST-DEINSTALL) - delete_user - ;; -esac diff --git a/japanese/tiarra/files/pkg-install.in b/japanese/tiarra/files/pkg-install.in deleted file mode 100644 index 7108929d2a68..000000000000 --- a/japanese/tiarra/files/pkg-install.in +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ - -TIARRA_USER=${TIARRA_USER:=%%TIARRA_USER%%} -TIARRA_GROUP=${TIARRA_GROUP:=%%TIARRA_GROUP%%} - -UID=398 -GID=398 - -# -# create 'tiarra' user and group before installing -# - -create_user() { - USER=${TIARRA_USER} - GROUP=${TIARRA_GROUP} - PW=/usr/sbin/pw - - if [ -x /usr/sbin/nologin ]; then - shell=/usr/sbin/nologin - elif [ -x /sbin/nologin ]; then - shell=/sbin/nologin - else - shell=/nonexistent - fi - uhome="/nonexistent" - - if ! ${PW} show group ${GROUP} -q >/dev/null; then - gid=${GID} - while ${PW} show group -g ${gid} -q >/dev/null; do - gid=`expr ${gid} + 1` - done - if ! ${PW} add group ${GROUP} -g ${gid}; then - e=$? - echo "*** Failed to add group \`${GROUP}'. Please add it manually." - exit ${e} - fi - echo "*** Added group \`${GROUP}' (id ${gid})" - else - gid=`${PW} show group ${GROUP} 2>/dev/null | cut -d: -f3` - fi - - if ! ${PW} show user ${USER} -q >/dev/null; then - uid=${UID} - while ${PW} show user -u ${uid} -q >/dev/null; do - uid=`expr ${uid} + 1` - done - if ! ${PW} add user ${USER} -u ${uid} -g ${gid} -d "${uhome}" \ - -c "Tiarra IRC Proxy" -s "${shell}" -p "*" \ - ; then - e=$? - echo "*** Failed to add user \`${USER}'. Please add it manually." - exit ${e} - fi - echo "*** Added user \`${USER}' (id ${uid})" - else - if ! ${PW} mod user ${USER} -g ${gid}; then - e=$? - echo "*** Failed to update user \`${USER}'." - exit ${e} - fi - echo "*** Updated user \`${USER}'." - fi -} - -case $2 in -PRE-INSTALL) - create_user - ;; -esac |