summaryrefslogtreecommitdiff
path: root/mail/postfix-current/scripts/configure.postfix
blob: e1b7d41c028d1f58ec5fba53495aee8344fb8fa6 (plain) (blame)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/sh
# $FreeBSD$

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

tempfile=`mktemp -t checklist`

if [ "${BATCH}" = "yes" ]; then
	set \"PCRE\"
else
	/usr/bin/dialog --title "Postfix configuration options" --clear \
		--checklist "\n\
Please select desired options:" -1 -1 16 \
PCRE		"Perl Compatible Regular Expressions" OFF \
SASL		"Cyrus SASL (Simple Authentication and Security Layer)" OFF \
DB3		"Berkeley DB3 (required if SASL also built with DB3)" OFF \
MySQL		"MySQL map lookups" OFF \
OpenLDAP	"OpenLDAP map lookups" OFF \
Test		"SMTP/LMTP test server and generator" OFF \
TLS		"Secure Sockets Layer and Transport Layer Security" OFF \
IPv6		"IPv6 support" OFF \
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}"

SUB_PCRE="@comment "
SUB_SASL="@comment "
SUB_TLS="@comment "
SUB_LDAP="@comment "
SUB_TEST="@comment "

while [ "$1" ]; do
	case $1 in
		\"PCRE\")
			echo "CONF1+=		pcre_table"
			echo "CONF2+=		sample-pcre.cf"
			echo "MAN5+=		pcre_table.5"
			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/libpcre.a:\${PORTSDIR}/devel/pcre"
			echo "POSTFIX_CCARGS+=	-DHAS_PCRE -I\${LOCALBASE}/include"
			echo "POSTFIX_AUXLIBS+=	\${LOCALBASE}/lib/libpcre.a"
			SUB_PCRE=""
			;;
		\"SASL\")
			echo "CONF2+=		sample-auth.cf"
			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/libsasl.a:\${PORTSDIR}/security/cyrus-sasl"
			echo "POSTFIX_CCARGS+=	-DUSE_SASL_AUTH -I\${LOCALBASE}/include"
			echo "POSTFIX_AUXLIBS+=	\${LOCALBASE}/lib/libsasl.a -lpam -lcrypt"
			echo ".if exists(/usr/lib/libkrb.a)"
			echo "POSTFIX_AUXLIBS+=	-lkrb -ldes -lcom_err"
			echo ".endif"
			SUB_SASL=""
			;;
		\"TLS\")
			echo "CONF2+=		sample-tls.cf"
			echo "BIN1+=		tlsmgr"
			echo "POSTFIX_CCARGS+=	-DHAS_SSL -I/usr/include/openssl"
			echo "POSTFIX_AUXLIBS+=	-lssl -lcrypto"
			echo "DISTFILES+=	\${DISTNAME}.tar.gz pfixtls-0.6.38-snap20010225-0.9.6.tar.gz"
			echo "EXTRA_PATCHES+=	\${WRKDIR}/pfixtls-0.6.38-snap20010225-0.9.6/pfixtls.diff"
			echo "PATCH_STRIP=	-p1"
			SUB_TLS=""
			;;
		\"DB3\")
			echo "LIB_DEPENDS+=	db3.2:\${PORTSDIR}/databases/db3"
			echo "POSTFIX_CCARGS+=	-I\${LOCALBASE}/include/db3"
			echo "POSTFIX_AUXLIBS+=	-L\${LOCALBASE}/lib -ldb3"
			;;
		\"MySQL\")
			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/mysql/libmysqlclient.so:\${PORTSDIR}/databases/mysql323-client"
			echo "POSTFIX_CCARGS+=	-DHAS_MYSQL -I\${LOCALBASE}/include/mysql"
			echo "POSTFIX_AUXLIBS+=	-L\${LOCALBASE}/lib/mysql -lmysqlclient -lm -lz"
			;;
		\"OpenLDAP\")
			echo "CONF2+=		sample-ldap.cf"
			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/libldap.a:\${PORTSDIR}/net/openldap"
			echo "POSTFIX_CCARGS+=	-DHAS_LDAP -I\${LOCALBASE}/include"
			echo "POSTFIX_AUXLIBS+=	\${LOCALBASE}/lib/libldap.a \${PREFIX}/lib/liblber.a"
			SUB_LDAP=""
			;;
		\"Test\")
			echo "BIN3=		smtp-sink smtp-source"
			SUB_TEST=""
			;;
		\"IPv6\")
			if [ `uname -m` != "i386" ]; then
				/usr/bin/dialog --msgbox "IPv6 patch currently only supported on i386!" 5 60 > /dev/stderr
				rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
			exit 1
			fi
			if [ X$SUB_TLS = "X" ]; then
				/usr/bin/dialog --msgbox "IPv6 and TLS patch cannot be used simultaneously!" 5 60 > /dev/stderr
				rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
				exit 1
			fi
			echo "PATCH_SITES+=	ftp://ftp.kame.net/pub/kame/misc/"
			echo "PATCH_SITES+=	\${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/kame/misc/&,}"
			echo "PATCHFILES+=	postfix-20010228release-v6-20010424a.diff.gz"
			echo "PATCH_DIST_STRIP= -p1"
			echo ""
			;;
		*)
			echo "Invalid option(s): $*" > /dev/stderr
			rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
			exit 1
			;;
	esac
	shift
done

echo "PLIST_SUB+=	SUB_PCRE=\"${SUB_PCRE}\""
echo "PLIST_SUB+=	SUB_SASL=\"${SUB_SASL}\""
echo "PLIST_SUB+=	SUB_TLS=\"${SUB_TLS}\""
echo "PLIST_SUB+=	SUB_LDAP=\"${SUB_LDAP}\""
echo "PLIST_SUB+=	SUB_TEST=\"${SUB_TEST}\""