From 0dbca1978017d4a0545b308ca1df49dcf1fdf2f7 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Thu, 7 Jul 2011 18:14:36 +0000 Subject: [PATCH] audio/ventrilo-server now uses USERS and GROUPS PR: ports/157928 Submitted by: crees (me) Approved by: rene (mentor, implicit), maintainer timeout (20 days) --- GIDs | 1 + UIDs | 1 + audio/ventrilo-server/Makefile | 8 +--- audio/ventrilo-server/pkg-install | 67 ------------------------------- 4 files changed, 4 insertions(+), 73 deletions(-) delete mode 100644 audio/ventrilo-server/pkg-install diff --git a/GIDs b/GIDs index 04185eef56d1..2fd530afef6d 100644 --- a/GIDs +++ b/GIDs @@ -77,6 +77,7 @@ ladvd:*:142: dovecot:*:143: dovenull:*:144: webcamd:*:145: +ventrilo:*:146: rbldns:*:153: sfs:*:171: agk:*:172: diff --git a/UIDs b/UIDs index c7c7e3a108d1..5216c6c250ab 100644 --- a/UIDs +++ b/UIDs @@ -85,6 +85,7 @@ ladvd:*:142:142::0:0:Ladvd User:/var/empty:/usr/sbin/nologin dovecot:*:143:143::0:0:Dovecot User:/var/empty:/usr/sbin/nologin dovenull:*:144:144::0:0:Dovecot login User:/var/empty:/usr/sbin/nologin webcamd:*:145:145::0:0:Webcamd user:/var/empty:/usr/sbin/nologin +ventrilo:*:146:146::0:0:& server:/usr/local/ventrilo-server:/usr/sbin/nologin rbldns:*:153:153::0:0:rbldnsd pseudo-user:/nonexistent:/usr/sbin/nologin sfs:*:171:171::0:0:Self-Certifying File System:/nonexistent:/usr/sbin/nologin agk:*:172:172::0:0:AquaGateKeeper:/nonexistent:/nonexistent diff --git a/audio/ventrilo-server/Makefile b/audio/ventrilo-server/Makefile index d671ce37720c..c4d5d39dc3dc 100644 --- a/audio/ventrilo-server/Makefile +++ b/audio/ventrilo-server/Makefile @@ -27,6 +27,8 @@ RESTRICTED= Redistribution of pre-compiled binaries is not permitted INSTALL_DIR= ${PREFIX}/ventrilo-server USE_RC_SUBR= ${PORTNAME}${PKGNAMESUFFIX}.sh VENT_USER= ${PORTNAME} +USERS= ${VENT_USER} +GROUPS= ${USERS} WRKSRC= ${WRKDIR}/ventsrv SUB_FILES= pkg-message @@ -35,8 +37,6 @@ IGNORE= distfile can only be fetched if you accept the license. Go to http://www .endif do-install: - @ ${SETENV} PKG_PREFIX=${PREFIX} \ - ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL @${MKDIR} ${INSTALL_DIR} @${CHOWN} ${VENT_USER} ${INSTALL_DIR} ${INSTALL_PROGRAM} ${WRKSRC}/ventrilo_srv ${INSTALL_DIR} @@ -54,10 +54,6 @@ do-install: post-install: @${CAT} ${PKGMESSAGE} -post-deinstall: - @ ${SETENV} PKG_PREFIX=${PREFIX} \ - ${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL - PKGDEINSTALL= ${PKGINSTALL} .include diff --git a/audio/ventrilo-server/pkg-install b/audio/ventrilo-server/pkg-install deleted file mode 100644 index e4ae65b108d2..000000000000 --- a/audio/ventrilo-server/pkg-install +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh - -PATH=/bin:/usr/sbin -HOMEDIR=${PKG_PREFIX}/ventrilo-server -NAME="Ventrilo" - -USER=ventrilo -UID=117 -GROUP=${USER} -GID=117 - -case $2 in -PRE-INSTALL) - if pw group show "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if pw groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - if pw user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - else - if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d ${HOMEDIR} -s /sbin/nologin -c "${NAME} Server" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - - if ! [ -x ~${USER} ] ; then - mkdir -p "${HOMEDIR}" - chown ${USER}:${GROUP} "${HOMEDIR}" - fi - ;; - -POST-DEINSTALL) - if pw group show "${GROUP}" 2>/dev/null; then - if pw groupdel ${GROUP}; then - echo "Removed group \"${GROUP}\"." - else - echo "Removing group \"${GROUP}\" failed..." - exit 1 - fi - else - echo "Group \"${GROUP}\" doesn't exist!" - fi - - if pw user show "${USER}" 2>/dev/null; then - if pw userdel ${USER}; then - echo "Removed user \"${USER}\"." - else - echo "Removing user \"${USER}\" failed..." - exit 1 - fi - else - echo "User \"${USER}\" doesn't exist!" - fi - ;; -esac