summaryrefslogtreecommitdiff
path: root/mail/anubis/Makefile
blob: cbfad4714b110b56e803f1e352c4111433e35e6f (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
96
97
98
99
100
101
102
103
104
105
106
107
PORTNAME=	anubis
PORTVERSION=	4.3
PORTREVISION=	1
CATEGORIES=	mail
MASTER_SITES=	GNU

MAINTAINER=	jhale@FreeBSD.org
COMMENT=	Outgoing SMTP mail processor
WWW=		https://www.gnu.org/software/anubis/

LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libgnutls.so:security/gnutls \
		libgcrypt.so:security/libgcrypt \
		libgpg-error.so:security/libgpg-error \
		libgsasl.so:security/libgsasl

USES=		autoreconf charsetfix cpe gettext-tools gmake localbase \
		makeinfo pkgconfig shebangfix
CHARSETFIX_MAKEFILEIN=	gnulib.mk
CPE_VENDOR=	gnu
SHEBANG_FILES=	contrib/msg2smtp.pl
USE_RC_SUBR=	anubis

GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--with-gnutls \
		--with-gsasl

INFO=		anubis
PORTEXAMPLES=	1anubisrc 2anubisrc

OPTIONS_DEFINE=		NLS EXAMPLES EMACS GUILE GNUPG LIBWRAP PCRE PAM \
			SOCKS TEST
DB_DESC=		Database backend
OPTIONS_GROUP=		DB
OPTIONS_GROUP_DB=	GDBM MYSQL PGSQL
OPTIONS_DEFAULT=	GDBM GNUPG GUILE
OPTIONS_SUB=		yes
NO_OPTIONS_SORT=	yes

.if !exists(/usr/include/tcpd.h)
OPTIONS_EXCLUDE+=	LIBWRAP
.endif
.if !exists(/usr/lib/libpam.so)
OPTIONS_EXCLUDE+=	PAM
.endif

EMACS_DESC=		Install EMACS lisp files (requires emacs)
EMACS_USES=		emacs:build
EMACS_CONFIGURE_ON=	--with-lispdir=${PREFIX}/${EMACS_SITE_LISPDIR}/anubis
EMACS_CONFIGURE_OFF=	--with-lispdir=no

GDBM_LIB_DEPENDS=	libgdbm.so:databases/gdbm
GDBM_CONFIGURE_WITH=	gdbm

GNUPG_LIB_DEPENDS=	libgpgme.so:security/gpgme
GNUPG_CONFIGURE_WITH=	gpgme

GUILE_USES=		guile:2.2,alias
GUILE_CONFIGURE_WITH=	guile
GUILE_PORTEXAMPLES=	anubis.scm anubisrc.guile

LIBWRAP_CONFIGURE_WITH=	tcp-wrappers

MYSQL_USES=		mysql
MYSQL_CONFIGURE_WITH=	mysql
MYSQL_VARS=		REQUIRE+=mysql

NLS_CONFIGURE_ENABLE=	nls

PAM_CONFIGURE_WITH=	pam
PAM_PORTEXAMPLES=	pam

PCRE_LIB_DEPENDS=	libpcre.so:devel/pcre
PCRE_CONFIGURE_WITH=	pcre

PGSQL_USES=		pgsql
PGSQL_CONFIGURE_WITH=	postgres
PGSQL_VARS=		REQUIRE+=postgresql

SOCKS_CONFIGURE_WITH=	socks-proxy

TEST_TEST_TARGET=	check

.include <bsd.port.options.mk>

# Default requirement for anubis rc script
REQUIRE+=	mail
SUB_LIST+=	REQUIRE="${REQUIRE}"

post-patch-TEST-off:
	@${REINPLACE_CMD} -e 's| tests||' ${WRKSRC}/Makefile.am

post-install-EXAMPLES-on:
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/examples/*rc ${STAGEDIR}${EXAMPLESDIR}
.if ${PORT_OPTIONS:MGUILE}
	cd ${WRKSRC}/examples && \
		${INSTALL_DATA} ${GUILE_PORTEXAMPLES} ${STAGEDIR}${EXAMPLESDIR}
.endif
.if ${PORT_OPTIONS:MPAM}
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/pam
	${INSTALL_DATA} ${WRKSRC}/examples/pam/anubis* ${STAGEDIR}${EXAMPLESDIR}/pam
.endif

.include <bsd.port.mk>