diff options
author | jmmv <jmmv@pkgsrc.org> | 2003-07-29 17:25:58 +0000 |
---|---|---|
committer | jmmv <jmmv@pkgsrc.org> | 2003-07-29 17:25:58 +0000 |
commit | 48e3ab19428914287d0f3bb44ff7b1a76d62f5e2 (patch) | |
tree | 89b289746a212662591d17902f46846208b144be | |
parent | 0b27543ed11af257591bdf6e15522ba7bfb3bbe5 (diff) | |
download | pkgsrc-48e3ab19428914287d0f3bb44ff7b1a76d62f5e2.tar.gz |
Convert to the bsd.pkg.install.mk framework to handle the daemon's user and
group, the creation of log files and automatic handling of the rc.d script.
Bump PKGREVISION to 1. Ok'ed by seb@, the maintainer.
-rw-r--r-- | chat/ircd-hybrid/DEINSTALL | 45 | ||||
-rw-r--r-- | chat/ircd-hybrid/INSTALL | 48 | ||||
-rw-r--r-- | chat/ircd-hybrid/Makefile | 74 | ||||
-rw-r--r-- | chat/ircd-hybrid/files/ircd-hybrid.sh (renamed from chat/ircd-hybrid/files/ircd-hybrid) | 4 |
4 files changed, 23 insertions, 148 deletions
diff --git a/chat/ircd-hybrid/DEINSTALL b/chat/ircd-hybrid/DEINSTALL deleted file mode 100644 index ce56f5fbcc6..00000000000 --- a/chat/ircd-hybrid/DEINSTALL +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# -# $NetBSD: DEINSTALL,v 1.1 2001/10/31 20:06:31 zuntum Exp $ -# - -PKGNAME=$1 -STAGE=$2 - -USER=@USER@ -GROUP=@GROUP@ -DPATH=@DPATH@ -LPATH=@LPATH@ -USERLOG=@USERLOG@ -OPERLOG=@OPERLOG@ - -CAT="@CAT@" - -case ${STAGE} in -DEINSTALL) - :;; - -POST-DEINSTALL) - - ${CAT} << EOF -=========================================================================== -If you won't be using ${PKGNAME} any longer, you may want to remove: - - * the \`${USER}' user - * the \`${GROUP}' group - * the \`${DPATH}' directory and its content - * various logfiles if they exist: - \`${LPATH} - \`${USERLOG}' - \`${OPERLOG} - -=========================================================================== -EOF - ;; - -*) - echo "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/chat/ircd-hybrid/INSTALL b/chat/ircd-hybrid/INSTALL deleted file mode 100644 index 53a5e5ffeaf..00000000000 --- a/chat/ircd-hybrid/INSTALL +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# $NetBSD: INSTALL,v 1.1 2001/10/31 20:06:32 zuntum Exp $ - -PKGNAME=$1 -STAGE=$2 - -USER=@USER@ -GROUP=@GROUP@ -ADDUSER=@ADDUSER@ -ADDGROUP=@ADDGROUP@ -CHGRP="@CHGRP@" -ID="@ID@" -RM="@RM@" -TOUCH="@TOUCH@" - -case ${STAGE} in -PRE-INSTALL) - ${TOUCH} "/tmp/grouptestirc.$$" - ${CHGRP} ${GROUP} "/tmp/grouptestirc.$$" >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "Group '${GROUP}' already exists...proceeding." - else - echo "Creating '${GROUP}' group..." - ${ADDGROUP} ${GROUP} - echo "Done." - fi - ${RM} -f "/tmp/grouptestirc.$$" - - ${ID} ${USER} >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "User '${USER}' already exists...proceeding." - else - echo "Creating '${USER}' user..." - ${ADDUSER} -c "IRC User" -g ${GROUP} -s /sbin/nologin ${USER} - echo "Done." - fi - ;; - -POST-INSTALL) - :;; - -*) - echo "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/chat/ircd-hybrid/Makefile b/chat/ircd-hybrid/Makefile index 5fee7b3b049..760efcba3fb 100644 --- a/chat/ircd-hybrid/Makefile +++ b/chat/ircd-hybrid/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.4 2003/06/19 16:21:08 grant Exp $ +# $NetBSD: Makefile,v 1.5 2003/07/29 17:26:00 jmmv Exp $ # DISTNAME= ircd-hybrid-6.2 +PKGREVISION= 1 CATEGORIES= chat MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ircd-hybrid/} EXTRACT_SUFX= .tgz @@ -13,9 +14,7 @@ COMMENT= Irc server with many options GNU_CONFIGURE= YES USE_BUILDLINK2= # defined - -DEINSTALL_FILE= ${WRKDIR}/DEINSTALL -INSTALL_FILE= ${WRKDIR}/INSTALL +USE_PKGINSTALL= YES .include "../../mk/bsd.prefs.mk" @@ -97,50 +96,11 @@ BUILD_DEFS+= IRCD_HYBRID_USE_LOGFILE BUILD_DEFS+= IRCD_HYBRID_LPATH .endif -# to handle user and group creation... -.if ${OPSYS} == "NetBSD" -. if exists(/usr/sbin/user) -ADDUSER= /usr/sbin/useradd -ADDGROUP= /usr/sbin/groupadd -. else -DEPENDS+= user>=20000313:../../sysutils/user -ADDUSER= ${LOCALBASE}/sbin/useradd -ADDGROUP= ${LOCALBASE}/sbin/groupadd -. endif -.elif ${OPSYS} == "SunOS" -ADDUSER= useradd -ADDGROUP= groupadd -.endif - -# tuning of INSTALL and DEINSTALL scripts -INSTALL_SUBST+= USER=${IRCD_HYBRID_IRC_USER} -INSTALL_SUBST+= GROUP=${IRCD_HYBRID_IRC_GROUP} -INSTALL_SUBST+= DPATH=${IRCD_HYBRID_DPATH} -INSTALL_SUBST+= LPATH=${IRCD_HYBRID_LPATH} -INSTALL_SUBST+= USERLOG=${IRCD_HYBRID_FNAME_USERLOG} -INSTALL_SUBST+= OPERLOG=${IRCD_HYBRID_FNAME_OPERLOG} - -INSTALL_SUBST+= ADDUSER=${ADDUSER:Q} -INSTALL_SUBST+= ADDGROUP=${ADDGROUP:Q} -INSTALL_SUBST+= CAT=${CAT:Q} -INSTALL_SUBST+= CHGRP=${CHGRP:Q} -INSTALL_SUBST+= ID=${ID:Q} -INSTALL_SUBST+= RM=${RM:Q} -INSTALL_SUBST+= TOUCH=${TOUCH:Q} - -INSTALL_SUBST_SED= ${INSTALL_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} - # tuning of "etc script" -SCRIPT_SUBST+= PPATH=${IRCD_HYBRID_PPATH:Q} -SCRIPT_SUBST+= SPATH=${IRCD_HYBRID_SPATH:Q} -SCRIPT_SUBST+= USER=${IRCD_HYBRID_IRC_USER:Q} -SCRIPT_SUBST+= DPATH=${IRCD_HYBRID_DPATH:Q} - -SCRIPT_SUBST+= TOUCH=${TOUCH:Q} -SCRIPT_SUBST+= CHOWN=${CHOWN:Q} -SCRIPT_SUBST+= CHMOD=${CHMOD:Q} - -SCRIPT_SUBST_SED= ${SCRIPT_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} +FILES_SUBST+= PPATH=${IRCD_HYBRID_PPATH:Q} +FILES_SUBST+= SPATH=${IRCD_HYBRID_SPATH:Q} +FILES_SUBST+= USER=${IRCD_HYBRID_IRC_USER:Q} +FILES_SUBST+= DPATH=${IRCD_HYBRID_DPATH:Q} # tuning of document file DOC_SUBST= PREFIX=${PREFIX} @@ -152,8 +112,21 @@ DOC_SUBST+= OPERLOG=${IRCD_HYBRID_FNAME_OPERLOG} DOC_SUBST+= USERLOG=${IRCD_HYBRID_FNAME_USERLOG} DOC_SUBST+= SYSLOG_FACILITY=${IRCD_HYBRID_SYSLOG_FACILITY} +RCD_SCRIPTS= ircd-hybrid + +PKG_USERS= ${IRCD_HYBRID_IRC_USER}:${IRCD_HYBRID_IRC_GROUP}::IRC\\ User::/sbin/nologin +PKG_GROUPS= ${IRCD_HYBRID_IRC_GROUP} + +SUPPORT_FILES_PERMS= /dev/null ${IRCD_HYBRID_FNAME_OPERLOG} \ + ${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 600 +SUPPORT_FILES_PERMS+= /dev/null ${IRCD_HYBRID_FNAME_USERLOG} \ + ${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 600 +.if ${IRCD_HYBRID_USE_LOGFILE} == "YES" +SUPPORT_FILES_PERMS+= /dev/null ${IRCD_HYBRID_LPATH} \ + ${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 600 +.endif + post-build: - ${SED} ${SCRIPT_SUBST_SED} ${FILESDIR}/ircd-hybrid > ${WRKDIR}/ircd-hybrid ${CP} ${FILESDIR}/pkg-setup.txt ${WRKDIR}/pkg-setup.txt .if ${IRCD_HYBRID_USE_LOGFILE} != "YES" ${MV} ${WRKDIR}/pkg-setup.txt ${WRKDIR}/.pkg-setup.txt @@ -169,11 +142,6 @@ post-build: ${SED} ${DOC_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}\ ${WRKDIR}/.pkg-setup.txt > ${WRKDIR}/pkg-setup.txt -pre-install: - ${SED} ${INSTALL_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} - ${SED} ${INSTALL_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE} - PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL - post-install: ${INSTALL_SCRIPT} ${WRKDIR}/ircd-hybrid ${PREFIX}/etc/rc.d/ircd-hybrid ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/ircd-hybrid diff --git a/chat/ircd-hybrid/files/ircd-hybrid b/chat/ircd-hybrid/files/ircd-hybrid.sh index 298fd6514e1..836981a94b7 100644 --- a/chat/ircd-hybrid/files/ircd-hybrid +++ b/chat/ircd-hybrid/files/ircd-hybrid.sh @@ -1,6 +1,6 @@ -#! /bin/sh +#!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: ircd-hybrid,v 1.2 2002/07/06 20:36:58 tv Exp $ +# $NetBSD: ircd-hybrid.sh,v 1.1 2003/07/29 17:26:02 jmmv Exp $ # # PROVIDE: ircdhybrid # REQUIRE: DAEMON |