diff options
author | zuntum <zuntum@pkgsrc.org> | 2001-11-01 00:57:41 +0000 |
---|---|---|
committer | zuntum <zuntum@pkgsrc.org> | 2001-11-01 00:57:41 +0000 |
commit | c72c1cf5f95cbe537b005028f1743cddb16ef203 (patch) | |
tree | 93b6296152ccfbaa88b43de043b2d69ce6e63fc5 /security/cyrus-sasl/INSTALL | |
parent | 37637e483f1bf6574e9306aebbd013bb63d888d6 (diff) | |
download | pkgsrc-c72c1cf5f95cbe537b005028f1743cddb16ef203.tar.gz |
Move pkg/ files into package's toplevel directory
Diffstat (limited to 'security/cyrus-sasl/INSTALL')
-rw-r--r-- | security/cyrus-sasl/INSTALL | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/security/cyrus-sasl/INSTALL b/security/cyrus-sasl/INSTALL new file mode 100644 index 00000000000..5ae49d96ca3 --- /dev/null +++ b/security/cyrus-sasl/INSTALL @@ -0,0 +1,83 @@ +#! /bin/sh +# +# $NetBSD: INSTALL,v 1.1 2001/11/01 01:16:36 zuntum Exp $ + +PKGNAME=$1 +STAGE=$2 + +USER="@CYRUS_USER@" +GROUP="@CYRUS_GROUP@" + +ADDUSER="@ADDUSER@" +ADDGROUP="@ADDGROUP@" +CHGRP="@CHGRP@" +CHMOD="@CHMOD@" +CHOWN="@CHOWN@" +ID="@ID@" +MKDIR="@MKDIR@" +RM="@RM@" +TOUCH="@TOUCH@" + +SASLDB=/etc/sasldb.db +PWCHECKDIR=/var/pwcheck + +case ${STAGE} in +PRE-INSTALL) + # Group... the default's shipped with NetBSD + # We need to check that ${GROUP} exists before adding the user. + # Do it with chgrp to be able to use NIS. + # + ${TOUCH} "/tmp/grouptest.$$" + ${CHGRP} ${GROUP} "/tmp/grouptest.$$" >/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/grouptest.$$" + + # Use `id' to be able to use NIS. + # + ${ID} ${USER} 2>/dev/null >/dev/null + if [ $? -eq 0 ] + then + echo "User '${USER}' already exists...proceeding." + else + echo "Creating '${USER}' user..." + ${ADDUSER} -c "Cyrus User" -g ${GROUP} -s /bin/sh ${USER} + echo "Done." + fi + ;; + +POST-INSTALL) + # Create empty sasldb shared secrets database with proper permissions + # for saslpasswd. + # + if [ -f ${SASLDB} ] + then + echo "${SASLDB} already exists." + else + echo "Creating empty ${SASLDB}..." + echo password | ${PKG_PREFIX}/sbin/saslpasswd -p user + ${PKG_PREFIX}/sbin/saslpasswd -d user + ${CHOWN} ${USER} ${SASLDB} + ${CHMOD} 600 ${SASLDB} + echo "Done." + fi + + # Create directory with proper permissions for pwcheck socket. + # + ${MKDIR} ${PWCHECKDIR} + ${CHOWN} ${USER} ${PWCHECKDIR} + ${CHMOD} 700 ${PWCHECKDIR} + ;; + +*) + echo "Unexpected argument: ${STAGE}" + exit 1 + ;; +esac +exit 0 |