mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
45c675bb86
- respect NOPORTDOCS - bump PORTREVISION Submitted by: QA Rindy run Approved by: maintainer
53 lines
1.4 KiB
Bash
53 lines
1.4 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; 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; do
|
|
chmod 775 ${PKG_PREFIX}/majordomo/$dir
|
|
done
|
|
if [ x"${NOPORTDOCS}" = x ]; then
|
|
mkdir -p ${PKG_PREFIX}/majordomo/doc
|
|
chmod 775 ${PKG_PREFIX}/majordomo/doc
|
|
fi
|
|
chmod 755 ${PKG_PREFIX}/majordomo/lists ${PKG_PREFIX}/majordomo
|
|
;;
|
|
esac
|
|
|
|
exit 0
|