an easy and consistent way of installing software ported to FreeBSD
#!/bin/sh
if [ -n "${PACKAGE_BUILDING}" ]; then
exit 0
fi
if [ "$2" != "POST-DEINSTALL" ]; then
exit 0
fi
USER=avenger
GROUP=avenger
AVDIR=/var/spool/avenger
AVETC=/etc/avenger
PW=/usr/sbin/pw
if ${PW} groupshow "${GROUP}" >/dev/null 2>&1; then
echo
echo "If you're done with Mail Avenger permanently, delete the $GROUP group manually: pw groupdel ${GROUP}" | fmt
fi
if ${PW} usershow "${USER}" >/dev/null 2>&1; then
echo
echo "If you're done with Mail Avenger permanently, delete the $USER user manually: pw userdel ${USER}" | fmt
fi
for dir in "$AVETC" "$AVDIR"; do
if [ -d "$dir" ] && ! rmdir $dir 2>/dev/null; then
echo
echo "You may wish to investigate the contents of $dir and delete the directory if you're done with Mail Avenger permanently." | fmt
fi
echo
done
Mail Avenger is a highly-configurable, MTA-independent SMTP server
daemon. It lets users run messages through filters like ClamAV and
SpamAssassin during SMTP transactions, so the server can reject mail
before assuming responsibility for its delivery. Other unique features
include TCP SYN fingerprint and network route recording, verification
of sender addresses through SMTP callbacks, SPF (sender policy
framework) as a general policy language, qmail-style control over both
SMTP-level behavior and local delivery of extension addresses,
mail-bomb protection, integration with kernel firewalls, and more.
WWW: http://www.mailavenger.org/
#!/bin/sh
if [ -n "${PACKAGE_BUILDING}" ]; then
exit 0
fi
USER=avenger
GROUP=avenger
AVDIR=/var/spool/avenger
PW=/usr/sbin/pw
if [ "$2" = "PRE-INSTALL" ]; then
echo -n "Checking for group '$GROUP'... "
if ! ${PW} groupshow $GROUP >/dev/null 2>&1; then
echo -n "doesn't exist, adding... "
if ${PW} groupadd $GROUP; then
echo "success."
else
echo "FAILED!"
exit 1
fi
else
echo "exists."
fi
echo -n "Checking for user '$USER'... "
if ! ${PW} usershow $USER >/dev/null 2>&1; then
echo -n "doesn't exist, adding... "
if ${PW} useradd $USER -c 'Mail Avenger' \
-d "$AVDIR" -g $GROUP -s /sbin/nologin -h -; then
echo "success."
else
echo "FAILED!"
exit 1
fi
else
echo "exists."
fi
elif [ "$2" = "POST-INSTALL" ]; then
echo "Before using Mail Avenger, you will need to configure it."
echo "Instructions are available in:"
echo ""
echo " ${PKG_PREFIX}/share/avenger/INSTALL"
echo ""
fi
exit 0
bin/aliascheck
bin/dbutil
bin/deliver
bin/dotlock
bin/edinplace
bin/escape
bin/macutil
bin/mailexec
bin/match
bin/sendmac
bin/smtpdcheck
bin/synos
libexec/avenger
libexec/avenger.local
sbin/asmtpd
%%DATADIR%%/INSTALL
%%DATADIR%%/INSTALL.html
%%DATADIR%%/asmtpd.conf
%%DATADIR%%/avsendmail.m4
%%DATADIR%%/smtp-filter.iptables
%%DATADIR%%/smtp-filter.pf
%%DATADIR%%/unknown
share/pf.os
@dirrm %%DATADIR%%