freebsd-ports/mail/majordomo/pkg-install
Anders Nordby 8a3af76424 Make port build, install and run as package.
Give warning upon installing, majordomo is legacy.

PR:		104686
Submitted by:	erwin, anders
2007-03-01 20:56:42 +00:00

48 lines
1.3 KiB
Bash

#!/bin/sh
# $FreeBSD$
MAJORDOMOUSER=majordom
MAJORDOMOGROUP=majordom
UID=54
GID=$UID
case $2 in
PRE-INSTALL|ADDUSER)
if ! pw groupshow ${MAJORDOMOGROUP} 2>/dev/null 1>&2; then
if pw groupadd ${MAJORDOMOGROUP} -g $GID; then
echo "=> Added group \"${MAJORDOMOGROUP}\"."
else
echo "=> Adding group \"${MAJORDOMOGROUP}\" failed..."
exit 1
fi
fi
if ! pw usershow ${MAJORDOMOUSER} 2>/dev/null 1>&2; then
if pw useradd ${MAJORDOMOUSER} -u $UID -g ${MAJORDOMOGROUP} -h - \
-s "/nonexistent" -d "/usr/local/majordomo" \
-c "Majordomo Pseudo User"; \
then
pw groupmod ${MAJORDOMOGROUP} -m ${MAJORDOMOUSER}
echo "=> Added user \"${MAJORDOMOUSER}\"."
else
echo "=> Adding user \"${MAJORDOMOUSER}\" failed..."
exit 1
fi
fi
;;
POST-INSTALL)
# Add misc empty dirs, correct permissions
for dir in tmp lists/test-l.archive lists/test-l-digest.archive digests/test-l-digest doc; do
mkdir -p ${PKG_PREFIX}/majordomo/$dir
done
chown -R majordom:majordom ${PKG_PREFIX}/majordomo
chmod 700 ${PKG_PREFIX}/majordomo/tmp
chmod 755 ${PKG_PREFIX}/majordomo
for dir in digests lists/*.archive digests/test-l-digest doc; do
chmod 775 ${PKG_PREFIX}/majordomo/$dir
done
chmod 755 ${PKG_PREFIX}/majordomo/lists ${PKG_PREFIX}/majordomo
;;
esac
exit 0