diff options
author | crees <crees@FreeBSD.org> | 2011-07-06 05:22:51 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2011-07-06 05:22:51 +0800 |
commit | 7c180d768b22d36c4d574167bcbe90003c826abe (patch) | |
tree | 4ad5ea4e58aef9b3017e889e5cf73c4eb0831272 /irc/inspircd | |
parent | 6f0d8edc8bd46c452a9714455a5413633fc259ef (diff) | |
download | freebsd-ports-gnome-7c180d768b22d36c4d574167bcbe90003c826abe.tar.gz freebsd-ports-gnome-7c180d768b22d36c4d574167bcbe90003c826abe.tar.zst freebsd-ports-gnome-7c180d768b22d36c4d574167bcbe90003c826abe.zip |
Use USERS and GROUPS
PR: ports/157612
Submitted by: crees (me)
Approved by: rene (mentor, implicit), maintainer timeout
Diffstat (limited to 'irc/inspircd')
-rw-r--r-- | irc/inspircd/Makefile | 15 | ||||
-rw-r--r-- | irc/inspircd/files/pkg-install.in | 109 |
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! -# |