aboutsummaryrefslogtreecommitdiff
path: root/irc
diff options
context:
space:
mode:
authorChris Rees <crees@FreeBSD.org>2011-07-05 21:22:51 +0000
committerChris Rees <crees@FreeBSD.org>2011-07-05 21:22:51 +0000
commitb012f2fd0425bc3ec4ef7b36d314dc2ff136bca2 (patch)
tree04631447d625e161e34c0f86d147bdacd0291996 /irc
parent8ad17aaad7491b34e515ecad552a168a711171a3 (diff)
downloadports-b012f2fd0425bc3ec4ef7b36d314dc2ff136bca2.tar.gz
ports-b012f2fd0425bc3ec4ef7b36d314dc2ff136bca2.zip
Use USERS and GROUPS
PR: ports/157612 Submitted by: crees (me) Approved by: rene (mentor, implicit), maintainer timeout
Notes
Notes: svn path=/head/; revision=277142
Diffstat (limited to 'irc')
-rw-r--r--irc/inspircd/Makefile15
-rw-r--r--irc/inspircd/files/pkg-install.in109
2 files changed, 5 insertions, 119 deletions
diff --git a/irc/inspircd/Makefile b/irc/inspircd/Makefile
index c5be65886037..f64fea4fc884 100644
--- a/irc/inspircd/Makefile
+++ b/irc/inspircd/Makefile
@@ -19,6 +19,9 @@ USE_BZIP2= yes
USE_RC_SUBR= ${PORTNAME}
MAKEFILE= BSDmakefile
+USERS= ${INSPIRCD_USR}
+GROUPS= ${INSPIRCD_GRP}
+
INSPIRCD_USR?= ircd
INSPIRCD_UID?= 72
INSPIRCD_GRP?= ircd
@@ -27,13 +30,9 @@ 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
@@ -99,7 +98,7 @@ PLIST_SUB+= GNUTLS="@comment "
.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
@@ -108,13 +107,9 @@ PLIST_SUB+= OPENSSL="@comment "
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} && \
diff --git a/irc/inspircd/files/pkg-install.in b/irc/inspircd/files/pkg-install.in
deleted file mode 100644
index 66d7d9e97dce..000000000000
--- a/irc/inspircd/files/pkg-install.in
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-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!
-#