head	1.14;
access;
symbols
	RELEASE_5_EOL:1.13
	RELEASE_7_0_0:1.13
	RELEASE_6_3_0:1.13
	PRE_XORG_7:1.13
	RELEASE_4_EOL:1.13
	RELEASE_6_2_0:1.13
	RELEASE_6_1_0:1.12
	RELEASE_5_5_0:1.12
	RELEASE_6_0_0:1.12
	RELEASE_5_4_0:1.12
	RELEASE_4_11_0:1.12
	RELEASE_5_3_0:1.12
	RELEASE_4_10_0:1.12
	RELEASE_5_2_1:1.12
	RELEASE_5_2_0:1.12
	RELEASE_4_9_0:1.12
	RELEASE_5_1_0:1.12
	RELEASE_4_8_0:1.11
	RELEASE_5_0_0:1.10
	RELEASE_4_7_0:1.10
	RELEASE_4_6_2:1.8
	RELEASE_4_6_1:1.8
	RELEASE_4_6_0:1.8
	RELEASE_5_0_DP1:1.6
	RELEASE_4_5_0:1.6
	RELEASE_4_4_0:1.4
	RELEASE_4_3_0:1.4
	RELEASE_4_2_0:1.3
	RELEASE_4_1_1:1.2
	RELEASE_4_1_0:1.1
	RELEASE_3_5_0:1.1
	RELEASE_4_0_0:1.1;
locks; strict;
comment	@# @;


1.14
date	2008.06.17.19.01.58;	author pav;	state dead;
branches;
next	1.13;

1.13
date	2006.05.26.18.49.05;	author ume;	state Exp;
branches;
next	1.12;

1.12
date	2003.05.09.12.41.21;	author arved;	state Exp;
branches;
next	1.11;

1.11
date	2003.02.26.11.25.55;	author edwin;	state Exp;
branches;
next	1.10;

1.10
date	2002.08.14.18.39.45;	author knu;	state Exp;
branches;
next	1.9;

1.9
date	2002.06.26.18.49.21;	author pat;	state Exp;
branches;
next	1.8;

1.8
date	2002.05.24.02.01.13;	author dwcjr;	state Exp;
branches;
next	1.7;

1.7
date	2002.05.21.15.08.58;	author dwcjr;	state Exp;
branches;
next	1.6;

1.6
date	2002.01.17.15.04.35;	author kevlo;	state Exp;
branches;
next	1.5;

1.5
date	2001.12.20.12.18.57;	author ijliao;	state Exp;
branches;
next	1.4;

1.4
date	2000.11.17.15.06.21;	author kevlo;	state Exp;
branches;
next	1.3;

1.3
date	2000.11.01.11.59.16;	author jeh;	state Exp;
branches;
next	1.2;

1.2
date	2000.09.19.02.59.28;	author ade;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.24.05.22.21;	author steve;	state Exp;
branches;
next	;


desc
@@


1.14
log
@Delete security/cyrus-sasl, it has been expired for a year and a half.
@
text
@#!/bin/sh
#
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.13 2006/05/26 18:49:05 ume Exp $
#
# Created by: stb@@FreeBSD.org for the cyrus imap server
# Added to the cyrus-sasl port 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%%}

#
# create 'cyrus' user and group before installing
#

create_user() {
	USER=${CYRUS_USER}
	GROUP=${CYRUS_GROUP}
	PW=/usr/sbin/pw 

	if [ -x /sbin/nologin ]; then   
		shell=/sbin/nologin   
	else   
		shell=/nonexistent   
	fi 
	uhome="/nonexistent"

	if ! ${PW} show group ${GROUP} -q >/dev/null; then
		gid=60
		while ${PW} show group -g ${gid} -q >/dev/null; do
			gid=`expr ${gid} + 1`
		done
		if ! ${PW} add group ${GROUP} -g ${gid}; then
			e=$?
			echo "*** Failed to add group \`${GROUP}'. Please add it manually."
			exit ${e}
		fi
		echo "*** Added group \`${GROUP}' (id ${gid})"
	else
		gid=`${PW} show group ${GROUP} 2>/dev/null | cut -d: -f3`
	fi

	if ! ${PW} show user ${USER} -q >/dev/null; then
		uid=60
		while ${PW} show user -u ${uid} -q >/dev/null; do
			uid=`expr ${uid} + 1`
		done
		if ! ${PW} add user ${USER} -u ${uid} -g ${gid} -d "${uhome}" \
				-c "the cyrus mail server" -s "${shell}" -p "*" \
				; then
			e=$?
			echo "*** Failed to add user \`${USER}'. Please add it manually."
			exit ${e}
		fi
		echo "*** Added user \`${USER}' (id ${uid})"
	else
		if ! ${PW} mod user ${USER} -g ${gid} -d "${uhome}" \
				-c "the cyrus mail server" -s "${shell}" -p "*" \
				; then
			e=$?
			echo "*** Failed to update user \`${USER}'."
			exit ${e}
		fi
		echo "*** Updated user \`${USER}'."
	fi
}

create_sasldb() {
	if [ ! -f ${SASLDB_NAME} ]; then
		echo "test" | ${PKG_PREFIX}/sbin/saslpasswd -p -c cyrus
		if [ `${PKG_PREFIX}/sbin/sasldblistusers | wc -l` -eq 0 ] ; then
                        echo "WARNING: Failed to create ${SASLDB_NAME}"
                else
			${PKG_PREFIX}/sbin/saslpasswd -d cyrus
			chown ${CYRUS_USER}:mail ${SASLDB_NAME}
			chmod 640 ${SASLDB_NAME}
		fi
	fi
}

# This should really be installed by Sendmail

sendmail_conf() {
	if [ ! -f ${PKG_PREFIX}/lib/sasl/Sendmail.conf ]; then
		echo "pwcheck_method: %%PWCHECK_METHOD%%" > ${PKG_PREFIX}/lib/sasl/Sendmail.conf
	fi
}

case $2 in
	PRE-INSTALL)
		create_user
		;;
	POST-INSTALL)
		if [ "${PKG_BATCH}" = "NO" ]; then
			create_sasldb
			sendmail_conf
		fi
		;;

esac
@


1.13
log
@Correct pathname in warning message.

Reported by:	nork
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.12 2003/05/09 12:41:21 arved Exp $
@


1.12
log
@* 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
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.11 2003/02/26 11:25:55 edwin Exp $
d79 1
a79 1
                        echo "WARNING: Failed to create ${PKG_PREFIX}/etc/$SASLDB_NAME}"
@


1.11
log
@security/cyrus-sasl: Bento fails to build libkerberos + Upgrade

	Bento fails to proberly package the port on -CURRENT due
	to -CURRENT no longer has libdes.* as the des functions
	have been moved to the libcrypto.* library.

PR:		48442
Submitted by:	Scot W. Hetzel <hetzels@@westbend.net>
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.10 2002/08/14 18:39:45 knu Exp $
d16 3
d24 2
a25 2
	USER=cyrus
	GROUP=cyrus
d82 1
a82 1
			chown cyrus:mail ${SASLDB_NAME}
a95 17
create_rc_conf_d() {
	PWCHECK_CONF=${PKG_PREFIX}/etc/rc.conf.d/cyrus_pwcheck
	SASLAUTHD_CONF=${PKG_PREFIX}/etc/rc.conf.d/saslauthd1

	if [ ! -d ${PKG_PREFIX}/etc/rc.conf.d ]; then
		mkdir ${PKG_PREFIX}/etc/rc.conf.d
	fi
	if [ ! -f ${SASLAUTHD_CONF} ]; then
		echo "saslauthd1_enable=%%ENABLE_SASLAUTHD%%" > ${SASLAUTHD_CONF}
		echo "saslauthd1_flags=\"-a pam\"" >> ${SASLAUTHD_CONF}
	fi
	if [ ! -f ${PWCHECK_CONF} ]; then
		echo "cyrus_pwcheck_enable=%%ENABLE_PWCHECK%%" > ${PWCHECK_CONF}
		echo "cyrus_pwcheck_program=${PKG_PREFIX}/sbin/%%PWCHECK%%" >> ${PWCHECK_CONF}
	fi
}

a102 1
			create_rc_conf_d
@


1.10
log
@Add saslauthd as default general password checking daemon (replaces
pwcheck{_pam}).

PR:		ports/41653
Submitted by:	"Scot W. Hetzel" <hetzels@@westbend.net> (MAINTAINER)
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.9 2002/06/26 18:49:21 pat Exp $
d93 17
d117 1
@


1.9
log
@- Chase checksum for sasl-1.5.27-ldap-ssl-filter-mysql-patch4.tgz
  author fixed bug in patch but didn't increment version.
- Fix problem when openldap v1 is selected.
- Bump PORTREVISION

PR:		ports/39800
Submitted by:	maintainer
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.8 2002/05/24 02:01:13 dwcjr Exp $
a69 6
# Don't know why we need the daemon user in the cyrus group
# hopefully this doesn't affect anyone. It's a leftover from
# the pre-SASL cyrus-imapd server.
#	if ! ${PW} group mod ${GROUP} -m daemon; then
#		echo "*** can't add user \`daemon' to group \`${GROUP}'"
#	fi
d89 1
a89 1
		echo "pwcheck_method: pwcheck" > ${PKG_PREFIX}/lib/sasl/Sendmail.conf
@


1.8
log
@Do not add a shell to cyrus user.

PR:		38434
Submitted by:	maintainer
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.7 2002/05/21 15:08:58 dwcjr Exp $
d70 6
a75 3
	if ! ${PW} group mod ${USER} -m daemon; then
		echo "*** can't add user \`${USER}' to group \`${GROUP}'"
	fi
@


1.7
log
@Fix for DB3 & KRB4

PR:		38363
Submitted by:	maintainer
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.6 2002/01/17 15:04:35 kevlo Exp $
d21 10
a30 4
	if [ ! -x /usr/sbin/pw ]; then
		echo "*** Please add a user and a group named \`cyrus' before installing this package."
		exit 69
	fi
d32 1
a32 1
	if ! pw show group cyrus -q >/dev/null; then
d34 1
a34 1
		while pw show group -g ${gid} -q >/dev/null; do
d37 1
a37 1
		if ! pw add group cyrus -g ${gid}; then
d39 1
a39 1
			echo "*** Failed to add group \`cyrus'. Please add it manually."
d42 1
a42 1
		echo "*** Added group \`cyrus' (id ${gid})"
d44 1
a44 1
		gid=`pw show group cyrus 2>/dev/null | cut -d: -f3`
d47 1
a47 1
	if ! pw show user cyrus -q >/dev/null; then
d49 1
a49 1
		while pw show user -u ${uid} -q >/dev/null; do
d52 2
a53 2
		if ! pw add user cyrus -u ${uid} -g ${gid} -d "${PKG_PREFIX}/cyrus" \
				-c "the cyrus mail server" -s "/bin/csh" -p "*" \
d56 1
a56 1
			echo "*** Failed to add user \`cyrus'. Please add it manually."
d59 1
a59 1
		echo "*** Added user \`cyrus' (id ${uid})"
d61 2
a62 2
		if ! pw mod user cyrus -g ${gid} -d "${PKG_PREFIX}/cyrus" \
				-c "the cyrus mail server" -s "/bin/csh" -p "*" \
d65 1
a65 1
			echo "*** Failed to update user \`cyrus'."
d68 1
a68 1
		echo "*** Updated user \`cyrus'."
d70 2
a71 2
	if ! pw group mod cyrus -m daemon; then
		echo "*** can't add user \`daemon' to group \`cyrus'"
@


1.6
log
@Update to version 1.5.27

PR: 33603
Submitted by: MAINTAINER
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.5 2001/12/20 12:18:57 ijliao Exp $
a40 5
	if [ -x /sbin/nologin ]; then
		shell=/sbin/nologin
	else
		shell=/nonexistent
	fi
d46 2
a47 2
		if ! pw add user cyrus -u ${uid} -g ${gid} -d "/nonexistent" \
				-c "the cyrus mail server" -s "${shell}" -p "*" \
d55 2
a56 2
		if ! pw mod user cyrus -g ${gid} -d "/nonexistent" \
				-c "the cyrus mail server" -s "${shell}" -p "*" \
d72 7
a78 3
		${PKG_PREFIX}/sbin/saslpasswd -d cyrus
		chown cyrus:mail ${SASLDB_NAME}
		chmod 640 ${SASLDB_NAME}
@


1.5
log
@refer to correct location in pkg-message
correct db filename
fix pkg-install script

PR:		29731
Submitted by:	maintainer
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.4 2000/11/17 15:06:21 kevlo Exp $
d76 2
a77 1
		touch ${SASLDB_NAME}
@


1.4
log
@- Correct misspelling (PGK_PREFIX -> PKG_PREFIX) in pkg-install
- Add support for Heimdal Kerberos V port

PR: 22894
Submitted by: MAINTAINER
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.3 2000/11/01 11:59:16 jeh Exp $
d14 2
d75 4
a78 4
	if [ ! -f ${PGK_PREFIX}/etc/sasldb.db ]; then
		touch ${PKG_PREFIX}/etc/sasldb.db
		chown cyrus:mail ${PKG_PREFIX}/etc/sasldb.db
		chmod 640 ${PKG_PREFIX}/etc/sasldb.db
@


1.3
log
@- Change /var/pwcheck permissions so Postfix can use pwcheck for SASL Authentication.
- Update MySQL & LDAP Authentication Methods
- Correct bento warning for extra file (Sendmail.conf).
- Correct mysql detection code in configure.sasl, and use LIB_DEPENDS for db3.

PR:		22462
Submitted by:	Scot W. Hetzel <hetzels@@westbend.net> MAINTAINER
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg-install,v 1.2 2000/09/19 02:59:28 ade Exp $
d74 3
a76 3
		touch ${PGK_PREFIX}/etc/sasldb.db
		chown cyrus:mail ${PGK_PREFIX}/etc/sasldb.db
		chmod 640 ${PGK_PREFIX}/etc/sasldb.db
@


1.2
log
@Cyrus-SASL 1.5.24 sources changed on Aug 15th
-- changed a hard coded value to a variable.

Kerberos IV detection fails due to double check on krb_mk_priv
(with/without com_err), used cached value from first check for krb_mk_priv.

Added addtional pwcheck methods (MySQL & LDAP Authentication).

PR:		21383
Submitted by:	maintainer
@
text
@d3 1
a3 1
#	$FreeBSD: ports/security/cyrus-sasl/pkg/INSTALL,v 1.1 2000/01/24 05:22:21 steve Exp $
d6 1
a6 1
# Added to the cyrus-sasl port by hetzel@@westbend.net
@


1.1
log
@Update to version 1.5.15.

PR:		16130
Submitted by:	maintainer
@
text
@d3 1
a3 1
#	$FreeBSD$
d10 4
d18 1
a18 1
create() {
d72 16
d90 7
a96 1
		create
@

