summaryrefslogtreecommitdiff
path: root/mail/anubis/Makefile
blob: b7c806d2b5e07433e7c2ce7b6e8496a66e9b097d (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
138
139
140
141
142
143
144
145
146
147
148
149
150
# Ports collection makefile for:	anubis
# Date created:			Jul 31, 2002
# Whom:				ijliao
#
# $FreeBSD$
#

PORTNAME=	anubis
PORTVERSION=	4.1.1
PORTREVISION=	5
CATEGORIES=	mail
MASTER_SITES=	${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR=	${PORTNAME}

MAINTAINER=	bsdkaffee@gmail.com
COMMENT=	Outgoing SMTP mail processor

USE_RC_SUBR=	anubis
USE_AUTOTOOLS=	aclocal autoheader autoconf automake
ACLOCAL_ARGS=	-I m4 -I am
AUTOMAKE_ARGS=	--force

LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/COPYING

MAN1=		anubis.1
INFO=		anubis
PORTEXAMPLES=	1anubisrc 2anubisrc

CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib
MAKE_JOBS_UNSAFE=	yes

OPTIONS=	NLS "Native language support" on \
		GUILE "Guile support" on \
		GPGME "GPG support via gpgme" on \
		GNUTLS "GNU TLS support" on \
		GSASL "GSASL support (required for databases)" on \
		GDBM "GDBM database support" off \
		MYSQL "MySQL database support" off \
		PGSQL "PostgreSQL database support" off \
		PCRE "Perl-style regular expressions" off \
		PAM "PAM support" off \
		SOCKS "SOCKS proxy support" off \
		TCPWRAP "TCP wrappers" off

.include <bsd.port.options.mk>

# Default requirement for anubis rc script
_REQUIRE=	mail

.if defined(WITHOUT_NLS)
CONFIGURE_ARGS+=--disable-nls
PLIST_SUB+=	NLS="@comment "
.else
USE_ICONV=	yes
USE_GETTEXT=	yes
PLIST_SUB+=	NLS=""
.endif

.if defined(WITHOUT_GUILE)
CONFIGURE_ARGS+=--without-guile
PLIST_SUB+=	GUILE="@comment "
.else
LIB_DEPENDS+=	guile:${PORTSDIR}/lang/guile
PORTEXAMPLES+=	anubis.scm anubisrc.guile
PLIST_SUB+=	GUILE=""
.endif

.if defined(WITHOUT_GPGME)
CONFIGURE_ARGS+=--without-gpgme
.else
LIB_DEPENDS+=	gpgme.19:${PORTSDIR}/security/gpgme
.endif

.if defined(WITHOUT_GNUTLS)
CONFIGURE_ARGS+=--without-gnutls
.else
LIB_DEPENDS+=	gnutls.47:${PORTSDIR}/security/gnutls
.endif

.if defined(WITH_GDBM)
.undef WITHOUT_GSASL
WITH_GSASL=	yes
LIB_DEPENDS+=	gdbm:${PORTSDIR}/databases/gdbm
CONFIGURE_ARGS+=--with-gdbm
.endif

.if defined(WITH_MYSQL)
.undef WITHOUT_GSASL
WITH_GSASL=	yes
USE_MYSQL=	yes
CONFIGURE_ARGS+=--with-mysql
_REQUIRE+=	mysql
.endif

.if defined(WITH_PGSQL)
.undef WITHOUT_GSASL
WITH_GSASL=	yes
USE_PGSQL=	yes
CONFIGURE_ARGS+=--with-postgres
_REQUIRE+=	postgresql
.endif

.if defined(WITHOUT_GSASL)
CONFIGURE_ARGS+=--without-gsasl
PLIST_SUB+=	GSASL="@comment "
.else
LIB_DEPENDS+=	gsasl.15:${PORTSDIR}/security/gsasl
PLIST_SUB+=	GSASL=""
.endif

.if defined(WITH_PCRE)
LIB_DEPENDS+=	pcre:${PORTSDIR}/devel/pcre
CONFIGURE_ARGS+=--with-pcre
.endif

.if defined(WITH_PAM) && exists(/usr/lib/libpam.so)
CONFIGURE_ARGS+=--with-pam
PORTEXAMPLES+=	pam
.endif

.if defined(WITH_TCPWRAP) && exists(/usr/include/tcpd.h)
CONFIGURE_ARGS+=--with-tcp-wrappers
.endif

.if defined(WITH_SOCKS)
CONFIGURE_ARGS+=--with-socks-proxy
.endif

SUB_LIST+=	REQUIRE="${_REQUIRE}"

post-patch:
	@${REINPLACE_CMD} -e "s|/etc|${PREFIX}/etc|g" ${WRKSRC}/src/headers.h

.if !defined(NOPORTEXAMPLES)
post-install:
	@${MKDIR} ${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/examples/*rc ${EXAMPLESDIR}
.if defined(WITH_GUILE)
	cd ${WRKSRC}/examples && \
		${INSTALL_DATA} anubis.scm anubisrc.guile ${EXAMPLESDIR}
.endif
.if defined(WITH_PAM)
	@${MKDIR} ${EXAMPLESDIR}/pam
	${INSTALL_DATA} ${WRKSRC}/examples/pam/anubis* ${EXAMPLESDIR}/pam
.endif
.endif

.include <bsd.port.mk>