Bug 157538 - [PATCH] Fix port: audio/teamspeak_server should use USERS= and GROUPS=
Summary: [PATCH] Fix port: audio/teamspeak_server should use USERS= and GROUPS=
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-02 20:00 UTC by Chris Rees
Modified: 2011-06-25 21:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rees 2011-06-02 20:00:19 UTC
	

	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.

Fix: - Use USERS and GROUPS

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




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.--PrS7bf7aNPbARCmwUM30GrZwnlRh6NEBELJdhwlDa9hsdAW4
Content-Type: text/plain; name="audio-teamspeak_server.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="audio-teamspeak_server.patch"

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
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-02 20:00:30 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

pgollucci@ wants his PRs (via the GNATS Auto Assign Tool)
Comment 2 Chris Rees freebsd_committer freebsd_triage 2011-06-22 17:50:08 UTC
Responsible Changed
From-To: pgollucci->crees
Comment 3 Chris Rees freebsd_committer freebsd_triage 2011-06-25 20:57:49 UTC
State Changed
From-To: open->closed

Committed.
Comment 4 dfilter service freebsd_committer freebsd_triage 2011-06-25 20:57:55 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"