aboutsummaryrefslogtreecommitdiffstats
path: root/irc/tr-ircd
diff options
context:
space:
mode:
authorcrees <crees@FreeBSD.org>2011-07-05 03:07:28 +0800
committercrees <crees@FreeBSD.org>2011-07-05 03:07:28 +0800
commit4cac01476542ce622cae4033970ce6cd1f78fd0e (patch)
tree8be0957df34f7eb563d0d0eb5e63d1b11625ede3 /irc/tr-ircd
parent6e8977f59411d0089f9b71474c1e4e82e6ccbac9 (diff)
downloadfreebsd-ports-gnome-4cac01476542ce622cae4033970ce6cd1f78fd0e.tar.gz
freebsd-ports-gnome-4cac01476542ce622cae4033970ce6cd1f78fd0e.tar.zst
freebsd-ports-gnome-4cac01476542ce622cae4033970ce6cd1f78fd0e.zip
- Use USERS and GROUPS
PR: ports/157602 Approved by: rene (mentor, implicit)
Diffstat (limited to 'irc/tr-ircd')
-rw-r--r--irc/tr-ircd/Makefile15
-rw-r--r--irc/tr-ircd/files/pkg-deinstall.in11
-rw-r--r--irc/tr-ircd/files/pkg-install.in35
3 files changed, 4 insertions, 57 deletions
diff --git a/irc/tr-ircd/Makefile b/irc/tr-ircd/Makefile
index 84d72d0b5b36..a83a60f9c457 100644
--- a/irc/tr-ircd/Makefile
+++ b/irc/tr-ircd/Makefile
@@ -21,6 +21,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
USE_GMAKE= yes
GNU_CONFIGURE= yes
+USERS= ${TRIRCD_USER}
+GROUPS= ${TRIRCD_GROUP}
TRIRCD_MAXCLIENTS?= 128
TRIRCD_USER?= trircd
@@ -45,13 +47,10 @@ CONFIGURE_ENV+= MD5SUMS="\"${MD5} -r\""
USE_RC_SUBR= trircd
-SUB_LIST+= TRIRCD_USER="${TRIRCD_USER}" TRIRCD_GROUP="${TRIRCD_GROUP}" \
- TRIRCD_RUNDIR="${TRIRCD_RUNDIR}" TRIRCD_LOGDIR="${TRIRCD_LOGDIR}" \
+SUB_LIST+= TRIRCD_RUNDIR="${TRIRCD_RUNDIR}" TRIRCD_LOGDIR="${TRIRCD_LOGDIR}" \
TRIRCD_CONFDIR="${TRIRCD_CONFDIR}"
-SUB_FILES+= pkg-install pkg-deinstall pkg-message
-PKGINSTALL= ${WRKDIR}/pkg-install
-PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+SUB_FILES+= pkg-deinstall pkg-message
PKGMESSAGE= ${WRKDIR}/pkg-message
.if !defined(NO_INSTALL_MANPAGES)
@@ -68,9 +67,6 @@ CONFIGURE_ARGS+=--enable-openssl=${OPENSSLBASE}
.include <bsd.port.pre.mk>
-PW?= /usr/sbin/pw
-SUB_LIST+= MKDIR="${MKDIR}" PW="${PW}" CHMOD="${CHMOD}" CHOWN="${CHOWN}"
-
.if ${ARCH} == "amd64" || ${ARCH} == "ia64"
CFLAGS+= -fPIC
.endif
@@ -90,9 +86,6 @@ post-patch:
post-configure:
@${REINPLACE_CMD} -e "s,/var/log/tr-ircd,${TRIRCD_LOGDIR}," ${WRKSRC}/include/ircpath.h
-pre-install:
- @${SH} ${PKGINSTALL}
-
post-install:
@${MKDIR} ${TRIRCD_CONFDIR}
@${INSTALL_DATA} ${WRKSRC}/doc/configuration/example.conf ${TRIRCD_CONFDIR}/ircd.conf.sample
diff --git a/irc/tr-ircd/files/pkg-deinstall.in b/irc/tr-ircd/files/pkg-deinstall.in
index e78a33e049fe..4da1c1433c38 100644
--- a/irc/tr-ircd/files/pkg-deinstall.in
+++ b/irc/tr-ircd/files/pkg-deinstall.in
@@ -4,19 +4,8 @@ if [ "$2" != "POST-DEINSTALL" ]; then
exit 0
fi
-TRIRCD_USER="%%TRIRCD_USER%%"
-TRIRCD_GROUP="%%TRIRCD_GROUP%%"
TRIRCD_RUNDIR="%%TRIRCD_RUNDIR%%"
TRIRCD_LOGDIR="%%TRIRCD_LOGDIR%%"
-PW="%%PW%%"
-if pw usershow "${TRIRCD_USER}" 2>/dev/null 1>&2; then
- echo "This port may have created the user: ${TRIRCD_USER}"
- echo "To delete this user, use '${PW} userdel \"${TRIRCD_USER}\"'"
-fi
-if pw usershow "${TRIRCD_GROUP}" 2>/dev/null 1>&2; then
- echo "This port may have created the group: ${TRIRCD_GROUP}"
- echo "To delete this group, use '${PW} groupdel \"${TRIRCD_GROUP}\"'"
-fi
echo "You may need to remove ${TRIRCD_RUNDIR} and ${TRIRCD_LOGDIR} manually."
exit 0
diff --git a/irc/tr-ircd/files/pkg-install.in b/irc/tr-ircd/files/pkg-install.in
deleted file mode 100644
index 47c0593fd172..000000000000
--- a/irc/tr-ircd/files/pkg-install.in
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-TRIRCD_USER="%%TRIRCD_USER%%"
-TRIRCD_GROUP="%%TRIRCD_GROUP%%"
-TRIRCD_RUNDIR="%%TRIRCD_RUNDIR%%"
-TRIRCD_LOGDIR="%%TRIRCD_LOGDIR%%"
-TRIRCD_CONFDIR="%%TRIRCD_CONFDIR%%"
-
-MKDIR="%%MKDIR%%"
-PW="%%PW%%"
-
-if ! ${PW} groupshow "${TRIRCD_GROUP}" 2>/dev/null 1>&2; then
- if pw groupadd ${TRIRCD_GROUP}; then
- echo "Added group \"${TRIRCD_GROUP}\"."
- else
- echo "Adding group \"${TRIRCD_GROUP}\" failed..."
- exit 1
- fi
-else
- echo "You already have a group \"${TRIRCD_GROUP}\"."
-fi
-
-if ! ${PW} usershow "${TRIRCD_USER}" 2>/dev/null 1>&2; then
- if pw useradd ${TRIRCD_USER} -g ${TRIRCD_GROUP} -h - \
- -s "/usr/sbin/nologin" -d "%%TRIRCD_CONFDIR%%" \
- -c "TR-IRCD pseudo-user"; \
- then
- echo "Added user \"${TRIRCD_USER}\"."
- else
- echo "Adding user \"${TRIRCD_USER}\" failed..."
- exit 1
- fi
-else
- echo "You already have a user \"${TRIRCD_USER}\"."
-fi