summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2000-12-08 10:09:22 +0000
committerwiz <wiz@pkgsrc.org>2000-12-08 10:09:22 +0000
commitbef9e409f7fb9feb74892cb52110767d9a7de950 (patch)
tree70151ac9e8f0484060bf7fa210d9228943ec36f0 /mail
parenta313c5c296bd4b276206dfa61bab7b0ae2529c73 (diff)
downloadpkgsrc-bef9e409f7fb9feb74892cb52110767d9a7de950.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/Makefile33
-rw-r--r--mail/majordomo/pkg/INSTALL51
-rw-r--r--mail/majordomo/pkg/REQ46
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