summaryrefslogtreecommitdiff
path: root/misc/jitterbug
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2000-12-08 09:43:06 +0000
committerwiz <wiz@pkgsrc.org>2000-12-08 09:43:06 +0000
commit271f4772149a4faae2e53f27b3ad6453f51b6dc0 (patch)
tree955197294b6a63071f8caab6872c1b7a598f63ed /misc/jitterbug
parent404acac01b1fc6ebf1676d90e69c49fc2b3cf940 (diff)
downloadpkgsrc-271f4772149a4faae2e53f27b3ad6453f51b6dc0.tar.gz
Replace REQ file by INSTALL file. Do user handling like it's done in
sysutils/amanda-common/pkg/INSTALL.
Diffstat (limited to 'misc/jitterbug')
-rw-r--r--misc/jitterbug/Makefile14
-rw-r--r--misc/jitterbug/pkg/INSTALL54
-rw-r--r--misc/jitterbug/pkg/REQ54
3 files changed, 63 insertions, 59 deletions
diff --git a/misc/jitterbug/Makefile b/misc/jitterbug/Makefile
index 373268920f3..ee422cff3f2 100644
--- a/misc/jitterbug/Makefile
+++ b/misc/jitterbug/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2000/09/12 17:23:01 wennmach Exp $
+# $NetBSD: Makefile,v 1.13 2000/12/08 09:43:06 wiz Exp $
DISTNAME= jitterbug-1.6.2
WRKSRC= ${WRKDIR}/${PKGNAME}/source
@@ -18,7 +18,7 @@ ADDGROUP= ${LOCALBASE}/sbin/groupadd
.endif
PLIST_SRC= ${WRKDIR}/PLIST-src
-REQ_FILE= ${WRKDIR}/REQ
+INSTALL_FILE= ${WRKDIR}/INSTALL
DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
MESSAGE_FILE= ${WRKDIR}/MESSAGE
CONFIGDIR= ${WRKDIR}/${PKGNAME}/config
@@ -135,8 +135,12 @@ pre-install:
-e 's|@PREFIX@|${PREFIX}|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|@JB_DATADIR@|${JB_DATADIR}|g' \
-e 's|@CGIBINDIR@|${CGIBINDIR}|g' \
@@ -175,7 +179,7 @@ pre-install:
-e 's|@PREFIX@|${PREFIX}|g' \
< ${FILESDIR}/httpd.conf \
> ${WRKDIR}/httpd.conf
- ${SH} ${REQ_FILE} ${PKGNAME} INSTALL
+ ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
do-install:
${MKDIR} ${PREFIX}/${JB_CONFIGDIR}
diff --git a/misc/jitterbug/pkg/INSTALL b/misc/jitterbug/pkg/INSTALL
new file mode 100644
index 00000000000..d3bf6b19937
--- /dev/null
+++ b/misc/jitterbug/pkg/INSTALL
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# $NetBSD: INSTALL,v 1.1 2000/12/08 09:43:06 wiz Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+JB_USER=@JB_USER@
+JB_USERID=@JB_USERID@
+JB_GROUP=@JB_GROUP@
+JB_GROUPID=@JB_GROUPID@
+PREFIX=@PREFIX@
+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 ${JB_GROUP} exists before adding the user.
+#
+${TOUCH} "/tmp/grouptestjitterbug.$$"
+${CHGRP} ${JB_GROUP} "/tmp/grouptestjitterbug.$$" >/dev/null 2>&1
+if [ $? -eq 0 ]; then
+ echo "Group '${JB_GROUP}' already exists...proceeding."
+else
+ echo "Creating '${JB_GROUP}' group..."
+ if ! ${ADDGROUP} -g ${JB_GROUPID} ${JB_GROUP}
+ then
+ echo "Can't add group ${JB_GROUP} with gid ${JB_GROUPID}"
+ echo "Please do it manually and restart installation."
+ ${RM} -f "/tmp/grouptestjitterbug.$$"
+ exit 1
+ fi
+ echo "Done."
+fi
+${RM} -f "/tmp/grouptestjitterbug.$$"
+
+${ID} ${JB_USER} >/dev/null 2>&1
+if [ $? -eq 0 ]; then
+ echo "User '${JB_USER}' already exists...proceeding."
+else
+ echo "Creating '${JB_USER}' user..."
+ ${ADDUSER} -c "Jitterbug Administrator" -g ${JB_GROUP} \
+ -b ${PREFIX} -u ${JB_USERID} ${JB_USER}
+ echo "Done."
+fi
+
+exit 0
diff --git a/misc/jitterbug/pkg/REQ b/misc/jitterbug/pkg/REQ
deleted file mode 100644
index 607dcb3a2b8..00000000000
--- a/misc/jitterbug/pkg/REQ
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: REQ,v 1.4 2000/09/12 17:23:02 wennmach Exp $
-
-JB_USER=@JB_USER@
-JB_USERID=@JB_USERID@
-JB_GROUP=@JB_GROUP@
-JB_GROUPID=@JB_GROUPID@
-PREFIX=@PREFIX@
-ADDUSER=@ADDUSER@
-ADDGROUP=@ADDGROUP@
-
-PKG=$1
-STAGE=$2
-
-if [ "$STAGE" != "INSTALL" ];
-then
- exit 0
-fi
-
-# Add group first
-#
-
-if grep "^${JB_GROUP}:" /etc/group 2>&1 >/dev/null
-then
- echo "Group '$JB_GROUP' already exists, proceeding."
-else
- if awk -F: '$3 == $JB_GROUPID {print "notfree"}' /etc/group | grep notfree >/dev/null
-then
- echo "Error: group id $JB_GROUPID already in use in /etc/group"
- echo "Please add group '$JB_GROUP' to /etc/group manually, then restart."
- exit 1
-else
- echo "Adding group $JB_GROUP (gid $JB_GROUPID) to /etc/group ..."
- ${ADDGROUP} -g ${JB_GROUPID} ${JB_GROUP}
-fi
-fi
-
-# use finger to be able to use NIS, ...
-if finger ${JB_USER} 2>&1 | grep >/dev/null "no such user"
-then
- echo "Creating '$JB_USER' user ..."
- ${ADDUSER} -c "Jitterbug Administrator" \
- -b ${PREFIX} \
- -u ${JB_USERID} \
- -g ${JB_GROUP} \
- ${JB_USER}
- echo Done.
-else
- echo "User '$JB_USER' already exists, proceeding."
-fi
-
-
-exit 0