Replace REQ file by INSTALL file. Do user handling like it's done in
sysutils/amanda-common/pkg/INSTALL.
This commit is contained in:
parent
404acac01b
commit
271f477214
3 changed files with 63 additions and 59 deletions
|
@ -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}
|
||||
|
|
54
misc/jitterbug/pkg/INSTALL
Normal file
54
misc/jitterbug/pkg/INSTALL
Normal file
|
@ -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
|
|
@ -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
|
Loading…
Reference in a new issue