summaryrefslogtreecommitdiff
path: root/mail/postfix/options.mk
blob: 2759aefc0b144ae1daf9d6eb958470d7c89d029a (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
# $NetBSD: options.mk,v 1.43 2021/12/15 20:54:00 adam Exp $

# Global and legacy options

PKG_OPTIONS_VAR=	PKG_OPTIONS.postfix
PKG_SUPPORTED_OPTIONS=	blocklist sasl tls eai
PKG_SUGGESTED_OPTIONS=	blocklist tls

.include "../../mk/bsd.options.mk"

###
### blocklist support
###
.if !empty(PKG_OPTIONS:Mblocklist)
CCARGS+=	-DUSE_BLOCKLIST
.endif

###
### STARTTLS support
###
.if !empty(PKG_OPTIONS:Mtls)
.  include "../../security/openssl/buildlink3.mk"
CCARGS+=	-DUSE_TLS
AUXLIBS+=	-L${BUILDLINK_PREFIX.openssl}/lib			\
		${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.openssl}/lib	\
		-lssl -lcrypto
.else
CCARGS+=	-DNO_TLS
.endif

###
### Cyrus SASL support for SMTP authentication.
### (Dovecot SASL support is built in by default.)
###
PLIST_VARS+=	csasl
.if !empty(PKG_OPTIONS:Msasl)
.  include "../../security/cyrus-sasl/buildlink3.mk"
BUILDLINK_INCDIRS.cyrus-sasl=	include/sasl
SASLLIBDIR=	${PREFIX}/lib/sasl2
PWCHECK_METHOD=	auxprop
CCARGS+=	-DUSE_CYRUS_SASL
AUXLIBS+=	-L${BUILDLINK_PREFIX.cyrus-sasl}/lib			\
		${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.cyrus-sasl}/lib \
		-lsasl2
PLIST.csasl=	yes
MESSAGE_SRC+=	${PKGDIR}/MESSAGE.sasl
MESSAGE_SUBST+=	PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
MESSAGE_SUBST+=	SASLLIBDIR=${SASLLIBDIR}
MAKE_DIRS+=	${SASLLIBDIR}
CONF_FILES+=	${EXAMPLEDIR}/smtpd.conf ${SASLLIBDIR}/smtpd.conf
.else
CCARGS+=	-DDEF_SERVER_SASL_TYPE=\"dovecot\"
.endif

###
### EAI (Email Address Internationalization) support (SMTPUTF8)
###
.if !empty(PKG_OPTIONS:Meai)
.  include "../../textproc/icu/buildlink3.mk"
CCARGS+=	-I${BUILDLINK_PREFIX.icu}/include
AUXLIBS+=	-L${BUILDLINK_PREFIX.icu}/lib -licuuc			\
		${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.icu}/lib
.else
CCARGS+=	-DNO_EAI

post-install:
	cd ${WRKSRC} && ${SETENV} LD_LIBRARY_PATH=${WRKSRC}/lib \
		DYLD_LIBRARY_PATH=${WRKSRC}/lib bin/postconf \
		-c ${DESTDIR}${EXAMPLEDIR} smtputf8_enable=no
.endif