diff options
author | wiz <wiz> | 2000-12-08 10:09:22 +0000 |
---|---|---|
committer | wiz <wiz> | 2000-12-08 10:09:22 +0000 |
commit | 59f8ee678dd0cd1c99c8ccc4416ee6b124b8b808 (patch) | |
tree | 70151ac9e8f0484060bf7fa210d9228943ec36f0 /mail | |
parent | 45a2fcd0b8c0d7cd1dda45ceb314d98a43cc998d (diff) | |
download | pkgsrc-59f8ee678dd0cd1c99c8ccc4416ee6b124b8b808.tar.gz |
Replace REQ file by INSTALL file, and modify to suit
sysutils/amanda-common style.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/majordomo/Makefile | 33 | ||||
-rw-r--r-- | mail/majordomo/pkg/INSTALL | 51 | ||||
-rw-r--r-- | mail/majordomo/pkg/REQ | 46 |
3 files changed, 72 insertions, 58 deletions
diff --git a/mail/majordomo/Makefile b/mail/majordomo/Makefile index 8e486979ef4..69a5855b9e3 100644 --- a/mail/majordomo/Makefile +++ b/mail/majordomo/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2000/08/18 15:57:47 wiz Exp $ +# $NetBSD: Makefile,v 1.8 2000/12/08 10:09:22 wiz Exp $ DISTNAME= majordomo-1.94.4 CATEGORIES= mail @@ -26,7 +26,7 @@ ALL_TARGET= wrapper INSTALL_TARGET= install install-wrapper MESSAGE_FILE= ${WRKDIR}/MESSAGE -REQ_FILE= ${WRKDIR}/REQ +INSTALL_FILE= ${WRKDIR}/INSTALL DEINSTALL_FILE= ${WRKDIR}/DEINSTALL MAKEFILE= Makefile.netbsd @@ -40,11 +40,12 @@ PLIST_SUBST= HOME=${MAJORDOMO_HOMEDIR} \ DOCDIR= ${PREFIX}/share/doc/majordomo DOCFILES= Changelog FUTURE INSTALL LICENSE NEWLIST README -DOCDOCFILES= FAQ README.sequencer list-owner-info majordomo-faq.html \ - majordomo.lisa6.ps majordomo.ora +DOCDOCFILES= FAQ README.sequencer list-owner-info \ + majordomo-faq.html majordomo.lisa6.ps majordomo.ora EXDIR= ${PREFIX}/share/examples/majordomo -EXDIRS= archives archives/example-l digests digests/example-l-digest lists +EXDIRS= archives archives/example-l digests \ + digests/example-l-digest lists EXFILES= example-l.passwd example-l.info EXLISTS= example-l example-l-digest @@ -52,11 +53,13 @@ BUILD_DEFS+= MAJORDOMO_USER MAJORDOMO_GROUP MAJORDOMO_TMPDIR require-uid: ${_PKG_SILENT}${_PKG_DEBUG} \ - if finger ${MAJORDOMO_USER} 2>&1 | ${GREP} "Login: ${MAJORDOMO_USER}" >/dev/null && ${GREP} -s "^${MAJORDOMO_GROUP}\:" /etc/group 2>/dev/null 1>&2 ; \ - then \ - :; \ - else \ - ${MAKE} ${.MAKEFLAGS} su-require-uid; \ + if ! ${ID} ${MAJORDOMO_USER} >/dev/null 2>&1; then \ + ${TOUCH} "/tmp/grouptestmajordomo1.$$"; \ + if ! ${CHGRP} ${MAJORDOMO_GROUP} \ + "/tmp/grouptestmajordomo1.$$" >/dev/null 2>&1; then \ + ${MAKE} ${.MAKEFLAGS} su-require-uid; \ + fi; \ + ${RM} -f "/tmp/grouptestmajordomo1.$$"; \ fi su-require-uid: @@ -82,7 +85,7 @@ su-require-uid: fi root-require-uid: - @${SH} ${REQ_FILE} ${PKGNAME} INSTALL + @${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL do-configure: @${SED} \ @@ -91,7 +94,11 @@ do-configure: -e 's|@HOME@|${MAJORDOMO_HOMEDIR}|g' \ -e 's|@ADDUSER@|${ADDUSER}|g' \ -e 's|@ADDGROUP@|${ADDGROUP}|g' \ - < ${PKGDIR}/REQ > ${REQ_FILE} + -e 's|@CHGRP@|${CHGRP}|g' \ + -e 's|@ID@|${ID}|g' \ + -e 's|@TOUCH@|${TOUCH}|g' \ + -e 's|@RM@|${RM}|g' \ + < ${PKGDIR}/INSTALL > ${INSTALL_FILE} @${SED} \ -e 's|@MAJORDOMO_USER@|${MAJORDOMO_USER}|g' \ -e 's|@MAJORDOMO_GROUP@|${MAJORDOMO_GROUP}|g' \ @@ -126,6 +133,8 @@ pre-install: -e 's:@MAJORDOMO_USER@:${MAJORDOMO_USER}:g' \ -e 's:@MAJORDOMO_GROUP@:${MAJORDOMO_GROUP}:g' \ < ${PKGDIR}/MESSAGE > ${MESSAGE_FILE} +# for safety's sake, if the user/group got deleted since configuration + @${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL post-install: @${LN} -sf archive2.pl ${PREFIX}/libexec/majordomo/archive diff --git a/mail/majordomo/pkg/INSTALL b/mail/majordomo/pkg/INSTALL new file mode 100644 index 00000000000..e9d363cba6d --- /dev/null +++ b/mail/majordomo/pkg/INSTALL @@ -0,0 +1,51 @@ +#!/bin/sh +# +# $NetBSD: INSTALL,v 1.1 2000/12/08 10:09:23 wiz Exp $ + +PKGNAME=$1 +STAGE=$2 + +HOME=@HOME@ +MAJORDOMO_USER=@MAJORDOMO_USER@ +MAJORDOMO_GROUP=@MAJORDOMO_GROUP@ +ADDUSER=@ADDUSER@ +ADDGROUP=@ADDGROUP@ +CHGRP=@CHGRP@ +ID=@ID@ +TOUCH=@TOUCH@ +RM=@RM@ + +if [ "$STAGE" != "PRE-INSTALL" ]; +then + exit 0 +fi + +# We need to check that ${MAJORDOMO_GROUP} exists before adding the user. +# +${TOUCH} "/tmp/grouptestmajordomo.$$" +${CHGRP} ${MAJORDOMO_GROUP} "/tmp/grouptestmajordomo.$$" >/dev/null 2>&1 +if [ $? -eq 0 ]; then + echo "Group '${MAJORDOMO_GROUP}' already exists...proceeding." +else + echo "Creating '${MAJORDOMO_GROUP}' group..." + ${ADDGROUP} ${MAJORDOMO_GROUP} + echo "Done." +fi +${RM} -f "/tmp/grouptestmajordomo.$$" + +${ID} ${MAJORDOMO_USER} >/dev/null 2>&1 +if [ $? -eq 0 ]; then + echo "User '${MAJORDOMO_USER}' already exists...proceeding." +else + echo "Creating '${MAJORDOMO_USER}' user..." + ${ADDUSER} -c "Majordomo User" -g ${MAJORDOMO_GROUP} \ + -b ${HOME} ${MAJORDOMO_USER} + echo "Done." +fi + +# Home... in case the login exists but not the home directory +# +install -d -m 775 -o ${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} ${HOME}/${MAJORDOMO_USER} +install -d -m 775 -o ${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} ${HOME}/${MAJORDOMO_USER}/archives +install -d -m 775 -o ${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} ${HOME}/${MAJORDOMO_USER}/digests +install -d -m 775 -o ${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} ${HOME}/${MAJORDOMO_USER}/lists diff --git a/mail/majordomo/pkg/REQ b/mail/majordomo/pkg/REQ deleted file mode 100644 index 55be193c587..00000000000 --- a/mail/majordomo/pkg/REQ +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -HOME=@HOME@ -MAJORDOMO_USER=@MAJORDOMO_USER@ -MAJORDOMO_GROUP=@MAJORDOMO_GROUP@ -ADDUSER=@ADDUSER@ -ADDGROUP=@ADDGROUP@ - -PKG=$1 -STAGE=$2 - -if [ "$STAGE" != "INSTALL" ]; -then - exit 0 -fi - - -# Group... the default's shipped with NetBSD -# -if grep "^${MAJORDOMO_GROUP}:" /etc/group 2>&1 >/dev/null -then - echo "Group '$MAJORDOMO_GROUP' already exists, proceeding." -else - echo "Creating '${MAJORDOMO_GROUP}' group..." - ${ADDGROUP} ${MAJORDOMO_GROUP} - echo "Done." -fi - - -# use finger to be able to use NIS, ... -if finger ${MAJORDOMO_USER} 2>&1 | grep >/dev/null "no such user" -then - echo "Creating '$MAJORDOMO_USER' user ..." - ${ADDUSER} -d ${HOME}/${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} \ - ${MAJORDOMO_USER} - echo Done. -else - echo "User '$MAJORDOMO_USER' already exists, proceeding." -fi - -# Home... in case the login exists but not the home directory -# -install -d -m 775 -o ${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} ${HOME}/${MAJORDOMO_USER} -install -d -m 775 -o ${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} ${HOME}/${MAJORDOMO_USER}/archives -install -d -m 775 -o ${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} ${HOME}/${MAJORDOMO_USER}/digests -install -d -m 775 -o ${MAJORDOMO_USER} -g ${MAJORDOMO_GROUP} ${HOME}/${MAJORDOMO_USER}/lists |