From utisoft@hotmail.com  Thu Jun  2 18:50:54 2011
Return-Path: <utisoft@hotmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3FE77106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Jun 2011 18:50:54 +0000 (UTC)
	(envelope-from utisoft@hotmail.com)
Received: from blu0-omc1-s29.blu0.hotmail.com (blu0-omc1-s29.blu0.hotmail.com [65.55.116.40])
	by mx1.freebsd.org (Postfix) with ESMTP id EF0A18FC0A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Jun 2011 18:50:53 +0000 (UTC)
Received: from BLU0-SMTP139 ([65.55.116.9]) by blu0-omc1-s29.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675);
	 Thu, 2 Jun 2011 11:50:53 -0700
Received: from zeus.bayofrum.net ([90.221.7.100]) by BLU0-SMTP139.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675);
	 Thu, 2 Jun 2011 11:50:51 -0700
Received: from zeus.bayofrum.net (crees@localhost [127.0.0.1])
	by zeus.bayofrum.net (8.14.4/8.14.4) with ESMTP id p52IgGkO025599
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 2 Jun 2011 19:42:16 +0100 (BST)
	(envelope-from crees@zeus.bayofrum.net)
Received: (from crees@localhost)
	by zeus.bayofrum.net (8.14.4/8.14.4/Submit) id p52IgGQj025598;
	Thu, 2 Jun 2011 19:42:16 +0100 (BST)
	(envelope-from crees)
Message-Id: <BLU0-SMTP139806A25141A9374AE93CCA97C0@phx.gbl>
Date: Thu, 2 Jun 2011 19:42:16 +0100
From: Chris Rees <utisoft@gmail.com>
Sender: <utisoft@hotmail.com>
Reply-To: Chris Rees <utisoft@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Fix port: audio/teamspeak_server should use USERS= and GROUPS=
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         157538
>Category:       ports
>Synopsis:       [PATCH] Fix port: audio/teamspeak_server should use USERS= and GROUPS=
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 02 19:00:19 UTC 2011
>Closed-Date:    Sat Jun 25 19:57:50 UTC 2011
>Last-Modified:  Sat Jun 25 20:00:23 UTC 2011
>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@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=, and also tries to delete users on deinstall without prompting -- this is a problem if another installed port uses that username.
>How-To-Repeat:
	
>Fix:


	- Use USERS and GROUPS

	Submitted by: Chris Rees (utisoft@gmail.com)


--- audio-teamspeak_server.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/teamspeak_server/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- Makefile	5 Dec 2009 16:20:12 -0000	1.14
+++ Makefile	2 Jun 2011 10:13:03 -0000
@@ -21,14 +21,11 @@
 ONLY_FOR_ARCHS=	i386
 NO_BUILD=	yes
 USE_LINUX=	yes
-PKGDEINSTALL=	${PKGINSTALL}
+USERS=		teamspeak
+GROUPS=		${USERS}
 
 USE_RC_SUBR=	teamspeak-server
 
-pre-install:
-	@${SETENV} PKG_PREFIX=${PREFIX} \
-		${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
-
 do-install:
 	@${MKDIR} ${PREFIX}/lib/teamspeak_server
 	${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${PREFIX}/lib/teamspeak_server -xf -
@@ -39,8 +36,4 @@
 	@${SETENV} PKG_PREFIX=${PREFIX} \
 		${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
 
-post-deinstall:
-	@${SETENV} PKG_PREFIX=${PREFIX} \
-		${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
-
 .include <bsd.port.mk>
Index: pkg-install
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/teamspeak_server/pkg-install,v
retrieving revision 1.1
diff -u -r1.1 pkg-install
--- pkg-install	8 Oct 2003 07:53:26 -0000	1.1
+++ pkg-install	2 Jun 2011 10:12:15 -0000
@@ -9,64 +9,8 @@
 GROUP=${USER}
 
 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}; 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} -g ${GROUP} -h - \
-			-d ${TSHOME} -c "Teamspeak Server"
-		then
-			echo "Added user \"${USER}\"."
-		else
-			echo "Adding user \"${USER}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! [ -x ~${USER} ] ; then 
-		mkdir -p ${TSHOME}
-		chown ${USER}:${GROUP} ${TSHOME}
-	fi
-	;;
-
 POST-INSTALL)
 	chown -R ${USER}:${GROUP} ${TSHOME}
 	chmod -R u+w,o-rx ${TSHOME}
 	;;
-
-
-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-teamspeak_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:
Responsible-Changed-From-To: freebsd-ports-bugs->pgollucci 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Jun 2 19:00:30 UTC 2011 
Responsible-Changed-Why:  
pgollucci@ wants his PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157538 
Responsible-Changed-From-To: pgollucci->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Wed Jun 22 16:50:08 UTC 2011 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=157538 
State-Changed-From-To: open->closed 
State-Changed-By: crees 
State-Changed-When: Sat Jun 25 19:57:49 UTC 2011 
State-Changed-Why:  
Committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157538 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/157538: commit references a PR
Date: Sat, 25 Jun 2011 19:57:55 +0000 (UTC)

 crees       2011-06-25 19:57:41 UTC
 
   FreeBSD ports repository
 
   Modified files:
     audio/teamspeak_server Makefile pkg-install 
   Log:
   - Use USERS and GROUPS
   
   PR:             ports/157538
   Submitted by:   Chris Rees (utisoft@gmail.com) (me)
   Approved by:    tabthorpe (co-mentor)
   
   Revision  Changes    Path
   1.15      +2 -9      ports/audio/teamspeak_server/Makefile
   1.2       +1 -57     ports/audio/teamspeak_server/pkg-install
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
