diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2011-06-11 17:58:32 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2011-06-11 17:58:32 +0000 |
commit | c76287d412921bc159146ecb9b9a5b79656f503b (patch) | |
tree | 4e3e26743784ad5617237aa514e5c98623cfb11d /japanese/tiarra | |
parent | 6f41245cd639608e7075832841a959edab648833 (diff) | |
download | ports-c76287d412921bc159146ecb9b9a5b79656f503b.tar.gz ports-c76287d412921bc159146ecb9b9a5b79656f503b.zip |
Use USERS and GROUPS.
PR: ports/157596
Submitted by: Chris Rees <utisoft__at__gmail.com>
Notes
Notes:
svn path=/head/; revision=275392
Diffstat (limited to 'japanese/tiarra')
-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 |