ports/157928: Fix port: audio/ventrilo-server directly uses pw in pkg-install

Chris Rees crees at FreeBSD.org
Thu Jun 16 19:50:09 UTC 2011


>Number:         157928
>Category:       ports
>Synopsis:       Fix port: audio/ventrilo-server directly uses pw in pkg-install
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 16 19:50:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-RELEASE-p1 i386
>Organization:
bayofrum
>Environment:
System: FreeBSD zeus.bayofrum.net 8.2-RELEASE-p1 FreeBSD 8.2-RELEASE-p1 #0: Sat Apr 30 15:09:06 BST 2011 root at zeus.bayofrum.net:/usr/obj/usr/src/sys/ZEUS i386


	
>Description:
	

	This port uses pkg-install to create new users instead of using USERS= and GROUPS=

>How-To-Repeat:
	
>Fix:

	

	- Use USERS and GROUPS

	I'll add the UIDs/GIDs lines required if this is approved.


--- audio-ventrilo-server.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/ventrilo-server/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	10 Dec 2008 09:20:51 -0000	1.4
+++ Makefile	2 Jun 2011 20:41:18 -0000
@@ -27,6 +27,8 @@
 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 @@
 .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 @@
 post-install:
 	@${CAT} ${PKGMESSAGE}
 
-post-deinstall:
-	@ ${SETENV} PKG_PREFIX=${PREFIX} \
-		${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
-
 PKGDEINSTALL=	${PKGINSTALL}
 
 .include <bsd.port.post.mk>
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	6 Oct 2006 21:26:08 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -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
--- audio-ventrilo-server.patch ends here ---



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list