Bug 157612

Summary: Fix port: irc/inspircd should use USERS
Product: Ports & Packages Reporter: Chris Rees <utisoft>
Component: Individual Port(s)Assignee: Chris Rees <crees>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Chris Rees 2011-06-04 17:10:06 UTC
	

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

Fix: - Use USERS and GROUPS

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

	I've removed files/pkg-install.in ; the post-install target wasn't being used anyway




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

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/irc/inspircd/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- Makefile	17 Mar 2011 15:51:01 -0000	1.14
+++ Makefile	4 Jun 2011 13:20:07 -0000
@@ -18,21 +18,19 @@
 USE_RC_SUBR=	${PORTNAME}
 MAKEFILE=	BSDmakefile
 
+USERS=		${INSPIRCD_USR}
+GROUPS=		${INSPIRCD_GRP}
+
 INSPIRCD_USR?=	ircd
 INSPIRCD_UID?=	72
 INSPIRCD_GRP?=	ircd
-INSPIRCD_GID?=	72
 INSPIRCD_RUN?=	/var/run/${PORTNAME}
 INSPIRCD_LOG?=	/var/log/${PORTNAME}/ircd.log
 SUB_LIST+=	PORTNAME=${PORTNAME}         \
 		INSPIRCD_USR=${INSPIRCD_USR} \
-		INSPIRCD_UID=${INSPIRCD_UID} \
 		INSPIRCD_GRP=${INSPIRCD_GRP} \
-		INSPIRCD_GID=${INSPIRCD_GID} \
-		INSPIRCD_RUN=${INSPIRCD_RUN} \
-		INSPIRCD_LOG=${INSPIRCD_LOG}
 PLIST_SUB+=	INSPIRCD_GRP=${INSPIRCD_GRP}
-SUB_FILES+=	pkg-install pkg-deinstall
+SUB_FILES+=	pkg-deinstall
 
 # Configure script is written in perl
 USE_PERL5_BUILD=yes
@@ -98,7 +96,7 @@
 .endif
 
 .if defined(WITH_OPENSSL) && !defined(WITHOUT_OPENSSL)
-.include <${PORTSDIR}/Mk/bsd.openssl.mk>
+.include <bsd.openssl.mk>
 CONFIGURE_ARGS+=	--enable-openssl
 PLIST_SUB+=	OPENSSL=""
 .else
@@ -107,13 +105,9 @@
 
 CONFIGURE_ARGS+=	--enable-extras=${EXTRAS}
 
-pre-install:
-	${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
 post-install:
 	@${STRIP_CMD} ${PREFIX}/lib/${PORTNAME}/modules/*.so
 	@${STRIP_CMD} ${PREFIX}/bin/${PORTNAME}
-	${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 .for FILE in inspircd.censor inspircd.conf inspircd.filter inspircd.helpop-full \
 	inspircd.helpop inspircd.motd inspircd.quotes inspircd.rules links.conf modules.conf opers.conf
 	@if ${TEST} -f ${ETCDIR}/${FILE} &&              \
Index: files/pkg-install.in
===================================================================
RCS file: files/pkg-install.in
diff -N files/pkg-install.in
--- files/pkg-install.in	19 May 2008 07:01:38 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,109 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/irc/inspircd/files/pkg-install.in,v 1.1 2008/05/19 07:01:38 beech Exp $
-#
-
-PATH=/usr/sbin:/usr/bin:/bin ; export PATH
-
-inspircd_usr=%%INSPIRCD_USR%%
-inspircd_uid=%%INSPIRCD_UID%%
-inspircd_grp=%%INSPIRCD_GRP%%
-inspircd_gid=%%INSPIRCD_GID%%
-inspircd_name=%%PORTNAME%%
-etcdir=%%ETCDIR%%
-
-inspircd_gcos="IRC daemon"
-inspircd_home=/nonexistent
-inspircd_shell=/sbin/nologin
-
-create_group() {
-    local user uid group gid gcos home shell
-
-    user=$1
-    uid=$2
-    group=$3
-    gid=$4
-    gcos=$5
-    home=$6
-    shell=$7
-
-    if pw groupadd -n $group -g $gid ; then
-	echo "===> Group $group created"
-    else
-	cat <<-EOERRORMSG
-	*** Failed to create the $group group.
-
-	Please add the $user user and $group group
-	manually with the commands:
-
-	    pw groupadd -n $group -g $gid
-	    pw useradd -n $user -u $uid -g $group -c "$gcos" \\
-	        -d $home -s $shell -h -
-
-	and retry installing this package.
-	EOERRORMSG
-	exit 1
-    fi
-}
-
-
-create_user() {
-    local user uid group gid gcos home shell
-
-    user=$1
-    uid=$2
-    group=$3
-    gid=$4
-    gcos=$5
-    home=$6
-    shell=$7
-
-    if pw useradd -n $user -u $uid -g $group -c "$gcos" -d $home \
-	-s $shell -h - ; then
-	echo "===> Created $user user"
-    else
-	cat <<-EOERRORMSG
-	*** Failed to create the $user user.
-
-	Please add the $user user manually with the command:
-
-	    pw useradd -n $user -u $uid -g $group -c "$gcos" \\
-		        -d $home -s $shell -h -
-
-	and retry installing this package.
-	EOERRORMSG
-	exit 1
-    fi
-}
-
-
-case $2 in
-    PRE-INSTALL)
-
-        # Create the inspircd user and group if they do not already exist
-
-        if pw user show -n $inspircd_usr >/dev/null 2>&1 ; then
-	    echo "===> Using pre-existing user $inspircd_usr"
-	else
-	    if ! pw group show -n $inspircd_grp >/dev/null 2>&1 ; then
-		create_group $inspircd_usr $inspircd_uid $inspircd_grp \
-		    $inspircd_gid "$inspircd_gcos" $inspircd_home      \
-		    $inspircd_shell
-	    fi
-	    create_user $inspircd_usr $inspircd_uid $inspircd_grp \
-		$inspircd_gid "$inspircd_gcos" $inspircd_home     \
-	        $inspircd_shell
-	fi
-	;;
-
-    POST-INSTALL)
-
-	# Make sure access to the etc dir is limited to $inspircd_grp
-	chmod 750 $etcdir
-	chgrp $inspircd_grp $etcdir
-	;;
-esac
-
-#
-# That's All Folks!
-#
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 17:10:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

pgollucci@ wants his PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 17:10:20 UTC
Maintainer of irc/inspircd,

Please note that PR ports/157612 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157612

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 17:10:23 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Chris Rees freebsd_committer freebsd_triage 2011-06-22 17:54:38 UTC
Responsible Changed
From-To: pgollucci->crees

Invalid autoassignment
Comment 5 Chris Rees freebsd_committer freebsd_triage 2011-06-22 18:02:48 UTC
Responsible Changed
From-To: crees->freebsd-ports-bugs

To pool to correct assign message
Comment 6 Chris Rees freebsd_committer freebsd_triage 2011-06-22 18:25:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

Invalid autoassignment to pgollucci
Comment 7 Chris Rees freebsd_committer freebsd_triage 2011-06-26 17:43:26 UTC
State Changed
From-To: feedback->open

Maintainer has timed out.
Comment 8 dfilter service freebsd_committer freebsd_triage 2011-07-05 22:23:00 UTC
crees       2011-07-05 21:22:51 UTC

  FreeBSD ports repository

  Modified files:
    irc/inspircd         Makefile 
  Removed files:
    irc/inspircd/files   pkg-install.in 
  Log:
  Use USERS and GROUPS
  
  PR:             ports/157612
  Submitted by:   crees (me)
  Approved by:    rene (mentor, implicit), maintainer timeout
  
  Revision  Changes    Path
  1.16      +5 -10     ports/irc/inspircd/Makefile
  1.2       +0 -109    ports/irc/inspircd/files/pkg-install.in (dead)
_______________________________________________
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"
Comment 9 Chris Rees freebsd_committer freebsd_triage 2011-07-05 22:23:04 UTC
State Changed
From-To: open->closed

Committed. Thanks!