ports/157612: Fix port: irc/inspircd should use USERS
Chris Rees
utisoft at gmail.com
Sat Jun 4 16:10:07 UTC 2011
>Number: 157612
>Category: ports
>Synopsis: Fix port: irc/inspircd should use USERS
>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: Sat Jun 04 16:10:06 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
Submitted by: Chris Rees (utisoft at gmail.com)
I've removed files/pkg-install.in ; the post-install target wasn't being used anyway
--- irc-inspircd.patch begins here ---
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!
-#
--- irc-inspircd.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