Makefile 4 KB
Newer Older
jgh's avatar
jgh committed
1
# Created by: Neil Blakey-Milner
2
3
# $FreeBSD$

cpiazza's avatar
cpiazza committed
4
PORTNAME=	courier-imap
madpilot's avatar
madpilot committed
5
PORTVERSION=	5.1.2
6
PORTEPOCH=	2
7
CATEGORIES=	mail
8
MASTER_SITES=	SF/courier/imap/${PORTVERSION}
9

10
MAINTAINER=	madpilot@FreeBSD.org
oliver's avatar
oliver committed
11
12
COMMENT=	IMAP (and POP3) server that provides access to Maildir mailboxes

13
14
15
LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/COPYING

madpilot's avatar
madpilot committed
16
RUN_DEPENDS=	${LOCALBASE}/share/sysconftool/sysconftool:devel/sysconftool
17
LIB_DEPENDS=	libcourier-unicode.so:devel/courier-unicode \
madpilot's avatar
madpilot committed
18
		libcourierauth.so:security/courier-authlib-base \
19
		libidn.so:dns/libidn
madpilot's avatar
madpilot committed
20

21
22
USES=		compiler:c++11-lang gmake localbase:ldflags perl5 pkgconfig ssl \
		tar:bzip2
23
24
25
USE_RC_SUBR=	courier-imap-imapd courier-imap-imapd-ssl \
		courier-imap-pop3d courier-imap-pop3d-ssl

26
27
28
CONFLICTS=	courier-[0-9]* imap-uw-[0-9]* panda-imap-[0-9]*

GNU_CONFIGURE=	yes
29
30
CONFIGURE_ENV=	REHASH=${SCRIPTDIR}/c_rehash

31
MAKE_ENV:=	${CONFIGURE_ENV}
madpilot's avatar
madpilot committed
32
ALL_TARGET=	all makeimapaccess makedat
oliver's avatar
oliver committed
33

34
35
36
SUB_FILES=	pkg-message
SUB_LIST=	CONFDIR=${CONFDIR}

37
38
39
#
# options available:
#
oliver's avatar
oliver committed
40
# WITH_SYSLOG_FACILITY:         The syslogfacility to use
41
#
42

madpilot's avatar
madpilot committed
43
44
OPTIONS_DEFINE= GDBM GNUTLS INOTIFY TRASHQUOTA IPV6

oliver's avatar
oliver committed
45
GNUTLS_DESC=	Use GnuTLS instead of OpenSSL (Enables SNI)
madpilot's avatar
madpilot committed
46
47
INOTIFY_DESC=	Inotify support for IDLE command
TRASHQUOTA_DESC=	Include deleted mails in the quota
oliver's avatar
oliver committed
48
49
50
51

.if exists(${.CURDIR}/../../security/courier-authlib/Makefile.opt)
.include "${.CURDIR}/../../security/courier-authlib/Makefile.opt"
.endif
oliver's avatar
oliver committed
52

nbm's avatar
nbm committed
53
54
55
CONFDIR?=	${PREFIX}/etc/${PORTNAME}
USERDB?=	${PREFIX}/etc/userdb
LIBEXECDIR?=	${PREFIX}/libexec/${PORTNAME}
oliver's avatar
oliver committed
56
57
58
PLIST_SUB=	CONFDIR=${CONFDIR:S,^${PREFIX}/,,} \
		LIBEXECDIR=${LIBEXECDIR:S,^${PREFIX}/,,}

59
CONFIGURE_ARGS=	--sysconfdir=${CONFDIR} \
60
		--localstatedir="${PREFIX}/var" \
nbm's avatar
nbm committed
61
62
		--datadir=${DATADIR} \
		--libexecdir=${LIBEXECDIR} \
nbm's avatar
nbm committed
63
		--enable-workarounds-for-imap-client-bugs \
64
		--enable-unicode \
oliver's avatar
oliver committed
65
		--disable-root-check \
66
		--with-locking-method=fcntl \
67
		--with-notice=unicode
68

69
70
71
72
GNUTLS_LIB_DEPENDS=	libgnutls.so:security/gnutls \
			libgcrypt.so:security/libgcrypt
GNUTLS_CONFIGURE_WITH=	gnutls
GNUTLS_USES=		pkgconfig
oliver's avatar
oliver committed
73

madpilot's avatar
madpilot committed
74
75
INOTIFY_LIB_DEPENDS=	libinotify.so:devel/libinotify

76
77
78
IPV6_CONFIGURE_OFF=	--without-ipv6

TRASHQUOTA_CONFIGURE_ON=--with-trashquota
oliver's avatar
oliver committed
79

oliver's avatar
oliver committed
80
81
.include <bsd.port.pre.mk>

oliver's avatar
oliver committed
82
83
84
85
.if exists(${.CURDIR}/../../security/courier-authlib/Makefile.dep)
.include "${.CURDIR}/../../security/courier-authlib/Makefile.dep"
.endif

jgh's avatar
jgh committed
86
.if ${PORT_OPTIONS:MSYSLOG_FACILITY}
oliver's avatar
oliver committed
87
88
89
CONFIGURE_ARGS+=--with-syslog=${WITH_SYSLOG_FACILITY}
.endif

jgh's avatar
jgh committed
90
91
.if ${PORT_OPTIONS:MAUTH_USERDB}
.if ${PORT_OPTIONS:MGDBM}
oliver's avatar
oliver committed
92
CONFIGURE_ARGS+=--with-db=gdbm --with-userdb=${USERDB}
93
LIB_DEPENDS+=	libgdbm.so:databases/gdbm
nbm's avatar
nbm committed
94
.else
oliver's avatar
oliver committed
95
96
CONFIGURE_ARGS+=--with-db=db  --with-userdb=${USERDB}
.endif
nbm's avatar
nbm committed
97
98
.endif

oliver's avatar
oliver committed
99
100
101
102
103
104
105
106
107
EXTRA_DOCS=	AUTHORS INSTALL NEWS \
		libs/imap/ChangeLog \
		libs/imap/README \
		libs/imap/README.proxy \
		libs/maildir/README.imapkeywords.html \
		libs/maildir/README.maildirfilter.html \
		libs/maildir/README.maildirquota.txt \
		libs/maildir/README.sharedfolders.txt \
		libs/tcpd/README.couriertls \
108

109
post-patch:
oliver's avatar
oliver committed
110
	@${REINPLACE_CMD} -e 's|^case x$$lockmethod in|${TEST} \&\& &|g' \
oliver's avatar
oliver committed
111
		${WRKSRC}/libs/liblock/configure
oliver's avatar
oliver committed
112
	@${REINPLACE_CMD} -e 's|%%INSTALL_MAN%%|${INSTALL_MAN}|' \
113
		${WRKSRC}/Makefile.in
114
	@${REINPLACE_CMD} -e 's|TLS_PROTOCOL=SSL3|TLS_PROTOCOL=SSL23|g' \
oliver's avatar
oliver committed
115
116
		${WRKSRC}/libs/imap/pop3d-ssl.dist.in \
		${WRKSRC}/libs/imap/imapd-ssl.dist.in
117

madpilot's avatar
madpilot committed
118
119
120
121
122
123
124
125
126
post-patch-INOTIFY-on:
	@${REINPLACE_CMD} -e 's|LIBS = @LIBS@|& ${LOCALBASE}/lib/libinotify.a /usr/lib/libpthread.a|' \
		${WRKSRC}/libs/maildir/Makefile.in \
		${WRKSRC}/libs/imap/Makefile.in

post-configure-INOTIFY-on:
	@${ECHO_CMD} '#define HAVE_INOTIFY_INIT 1' >>${WRKSRC}/libs/maildir/config.h
	@${ECHO_CMD} '#define HAVE_INOTIFY_INIT1 1' >>${WRKSRC}/libs/maildir/config.h

nbm's avatar
nbm committed
127
post-install:
madpilot's avatar
madpilot committed
128
129
	${INSTALL_SCRIPT} ${WRKSRC}/makeimapaccess ${STAGEDIR}${PREFIX}/bin/
	${INSTALL_SCRIPT} ${WRKSRC}/makedat ${STAGEDIR}${PREFIX}/bin/
nbm's avatar
nbm committed
130
.for i in imapd pop3d
oliver's avatar
oliver committed
131
	${INSTALL_DATA} ${WRKSRC}/libs/imap/${i}.cnf ${STAGEDIR}${CONFDIR}/${i}.cnf.dist
oliver's avatar
oliver committed
132
.endfor
oliver's avatar
oliver committed
133
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
nbm's avatar
nbm committed
134
.for a in ${EXTRA_DOCS}
oliver's avatar
oliver committed
135
	${INSTALL_DATA} ${WRKSRC}/${a} ${STAGEDIR}${DOCSDIR}
nbm's avatar
nbm committed
136
.endfor
137

oliver's avatar
oliver committed
138
.include <bsd.port.post.mk>