freebsd-ports/security/cyrus-sasl/pkg-deinstall
Tilman Keskinoz aaeff08d60 * Fix some problems with building the Kerberos IV and 5 mechs.
* Made the port to optionally not build the mechs, define
WITHOUT_[ANONYMOUS,CRAM,DIGEST,LOGIN,OTP,GSSAPI,PLAIN].

* The Kerberos IV case is special, as we can use the base kerberos 4x
(<=5.0-RELEASE), or use the security/krb4 port.
    WITH_KERBEROS4 - use security/krb4 port
        if <=5.0-RELEASE, use krb4 port only if /usr/lib/libkrb.a
	doesn't exist
    WITHOUT_KERBEROS4 - disables using the base systems /usr/lib/libkrb.a
	(<=5.0), if it exists and MAKE_KERBEROS4 defined in /etc/make.conf

* Changed the combined rcNG/rcOG scripts, so that the defaults are at the top
of the rc.d script and not in an external file to the script.

PR:		51505
Submitted by:	maintainer
2003-05-09 12:41:21 +00:00

68 lines
1.3 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# Created by: hetzels@westbend.net
#set -vx
PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
SASLDB_NAME=${PKG_PREFIX}/etc/%%SASLDB%%
CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
CYRUS_GROUP=${CYRUS_GROUP:=%%CYRUS_GROUP%%}
remove_file()
{
file=$1
if cmp -s ${file} ${file}.tmp; then
rm -f ${file}
fi
rm -f ${file}.tmp
}
# delete sasldb database
delete_sasldb() {
if [ -f ${SASLDB_NAME} ] ; then
if [ `${PKG_PREFIX}/sbin/sasldblistusers | wc -l` -eq 0 ] ; then
rm ${SASLDB_NAME}
else
echo "WARNING: Users SASL passwords are in ${SASLDB_NAME}, keeping this file"
fi
fi
}
delete_user() {
if pw usershow ${CYRUS_USER} 2>/dev/null 1>&2; then
echo "To delete Cyrus user permanently, use 'pw userdel ${CYRUS_USER}'"
fi
if pw groupshow ${CYRUS_GROUP} 2>/dev/null 1>&2; then
echo "To delete Cyrus group permanently, use 'pw groupdel ${CYRUS_GROUP}'"
fi
}
# This should really be uninstalled by Sendmail
sendmail_conf() {
if [ -f ${PKG_PREFIX}/lib/sasl/Sendmail.conf ]; then
echo "pwcheck_method: %%PWCHECK_METHOD%%" > ${PKG_PREFIX}/lib/sasl/Sendmail.conf.tmp
remove_file ${PKG_PREFIX}/lib/sasl/Sendmail.conf
fi
}
case $2 in
DEINSTALL)
delete_sasldb
sendmail_conf
;;
POST-DEINSTALL)
delete_user
;;
esac