summaryrefslogtreecommitdiffstats
path: root/security/cyrus-sasl/scripts/configure.sasl
blob: 7293d1920bbfb19686436482db16f2fe92409740 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh
# $FreeBSD$

if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then
	exit
fi

tempfile=`mktemp -t checklist`

if [ "${BATCH}" ]; then
	if [ "x${ENABLE_DB3}" = "xYES" ]; then
		OPTIONS=\"DB3\"
	fi
	if [ "x${ENABLE_MYSQL}" = "xYES" ]; then
		OPTIONS="${OPTIONS} \"MySQL\""
	fi
	if [ "x${ENABLE_LDAP}" = "xYES" ]; then
		OPTIONS="${OPTIONS} \"OpenLDAP\""
	fi
	if [ "x${OPTIONS}" != "x" ]; then
		set ${OPTIONS}
	fi
else

	if [ "x${ENABLE_DB3}" = "xYES" -o -f ${PREFIX}/lib/libdb3.so.1 ] ; then
		SET_DB3="ON"
	else
		SET_DB3="OFF"
	fi
	if [ "x${ENABLE_MYSQL}" = "xYES" -o -f ${PREFIX}/lib/mysql/libmysqlclient.so ] ; then
		SET_MYSQL="ON"
	else
		SET_MYSQL="OFF"
	fi
	if [ "x${ENABLE_LDAP}" = "xYES" -o \
	     -f ${PREFIX}/lib/libldap.so -a -f ${PREFIX}/lib/liblber.so ] ; then
		SET_LDAP="ON"
	else
		SET_LDAP="OFF"
	fi

	/usr/bin/dialog --title "Additional SASL options" --clear \
		--checklist "\n\
Please select desired options:" -1 -1 16 \
DB3		"Berkeley DB package, revision 3" ${SET_DB3} \
MySQL		"MySQL password Authentication" ${SET_MYSQL} \
OpenLDAP	"OpenLDAP password Authentication" ${SET_LDAP} \
2> $tempfile

	retval=$?

	if [ -s $tempfile ]; then
		set `cat $tempfile`
	fi
	rm -f $tempfile

	case $retval in
		0)	if [ -z "$*" ]; then
				echo "Nothing selected"
			fi
			;;
		1)	echo "Cancel pressed."
			exit 1
			;;
	esac
fi

${MKDIR} ${WRKDIRPREFIX}${CURDIR}
exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc

echo "PREFIX=	${PREFIX}"

while [ "$1" ]; do
	case $1 in
		\"DB3\")
			echo "LIB_DEPENDS+=	db3.3:\${PORTSDIR}/databases/db3"
			echo "CONFIGURE_ARGS+=--with-dblib=berkeley"
			;;
		\"MySQL\")
			echo "LIB_DEPENDS+=	mysqlclient.10:\${PORTSDIR}/databases/mysql323-client"
			echo "CONFIGURE_ARGS+=--with-mysql=\${PREFIX}"
			;;
		\"OpenLDAP\")
			echo "LIB_DEPENDS+=	ldap.1:\${PORTSDIR}/net/openldap"
			echo "LIB_DEPENDS+=	lber.1:\${PORTSDIR}/net/openldap"
			echo "CONFIGURE_ARGS+=--with-ldap=\${PREFIX}"
			;;
		*)
			echo "Invalid option(s): $*" > /dev/stderr
			rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
			exit 1
			;;
	esac
	shift
done
OpenPOWER on IntegriCloud