summaryrefslogtreecommitdiff
path: root/mail/courier-imap/Makefile
blob: 619f4dc8134664af0153d93d50c42e4d4d09e1a8 (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
# New ports collection makefile for: courierimap
# Date created:		19 Feb 2000
# Whom:			Neil Blakey-Milner
#
# $FreeBSD$
#

PORTNAME=	courier-imap
PORTVERSION=	1.4.3
PORTREVISION=	0
CATEGORIES=	mail ipv6
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	courier

MAINTAINER=	nbm@FreeBSD.org

GNU_CONFIGURE=	YES
USE_GMAKE=	YES

#
# options available:
#
# WITHOUT_OPENSSL:		Don't build in TLS support
# WITHOUT_PAM:			Don't build in PAM support
# WITH_VPOPMAIL:		Build in vpopmail support
# WITH_MYSQL:			Build in mysql support
# WITH_POSTGRESQL:		Build in postgresql support
#

.if !defined(WITHOUT_OPENSSL)
USE_OPENSSL=	YES
PLIST_SUB=	OPENSSLFLAG=
.else
PLIST_SUB=	OPENSSLFLAG="@comment "
.endif

CONFIGURE_ARGS=	--without-authldap --with-authldaprc=filename \
		--without-authshadow \
		--without-authcram \
		--sysconfdir=${PREFIX}/etc/courier-imap \
		--with-userdb=${PREFIX}/etc/userdb \
		--datadir=${PREFIX}/share/courier-imap \
		--libexecdir=${PREFIX}/libexec/courier-imap \
		--enable-workarounds-for-imap-client-bugs \
		--disable-root-check

VPOPMAILDIR?=	${LOCALBASE}/vpopmail
.if !defined(WITH_VPOPMAIL)
CONFIGURE_ARGS+=	\
		--without-authvchkpw
.else
CONFIGURE_ARGS+=	\
		--with-authvchkpw
BUILD_DEPENDS+=	${VPOPMAILDIR}/lib/libvpopmail.a:${PORTSDIR}/mail/vpopmail
.endif

.if !defined(WITH_MYSQL)
CONFIGURE_ARGS+=	\
		--without-authmysql
PLIST_SUB+=	MYSQLFLAG="@comment "
.else
LIB_DEPENDS+=	mysqlclient.10:${PORTSDIR}/databases/mysql323-client
PLIST_SUB+=	MYSQLFLAG=""
.endif

.if !defined(WITH_POSTGRESQL)
CONFIGURE_ARGS+=	\
		--without-authpgsql
PLIST_SUB+=	PGSQLFLAG="@comment "
.else
LIB_DEPENDS+=	pq.2:${PORTSDIR}/databases/postgresql7
PLIST_SUB+=	PGSQLFLAG=""
.endif

.if !defined(WITHOUT_PAM)
CONFIGURE_ARGS+=	\
		--with-authpam
.else
CONFIGURE_ARGS+=	\
		--without-authpam
.endif

MAN1=		maildirmake.1
MAN8=		authlib.8 makeuserdb.8 userdb.8 userdbpw.8 couriertcpd.8 \
		deliverquota.8 imapd.8 mkimapdcert.8 mkpop3dcert.8

MLINKS=		authlib.8 authpwd.8 \
		authlib.8 authuserdb.8 \
		authlib.8 authshadow.8 \
		authlib.8 authpam.8 \
		authlib.8 authvchkpw.8 \
		authlib.8 authcram.8 \
		authlib.8 authldap.8 \
		authlib.8 authmysql.8 \
		authlib.8 authdaemon.8 \
		authlib.8 authdaemond.8 \
		makeuserdb.8 pw2userdb.8 \
		makeuserdb.8 vchkpw2userdb.8

EXTRA_DOCS=	README INSTALL AUTHORS imap/ChangeLog

.include <bsd.port.pre.mk>

post-patch:
	@perl -i.nbm -pe 'm#^\timapd.cnf pop3d.cnf# && s@[ip][mo][ap][p3]d.cnf@@g;' \
		${WRKSRC}/Makefile.in

post-install:
	@${MKDIR} ${PREFIX}/share/doc/courier-imap
	@${INSTALL_DATA} ${WRKSRC}/imap/imapd.cnf ${PREFIX}/etc/courier-imap/imapd.cnf.dist
	@${INSTALL_DATA} ${WRKSRC}/imap/pop3d.cnf ${PREFIX}/etc/courier-imap/pop3d.cnf.dist
.for a in ${EXTRA_DOCS}
	@${INSTALL_DATA} ${WRKSRC}/${a} ${PREFIX}/share/doc/courier-imap/
.endfor
	ln -s ${PREFIX}/libexec/courier-imap/imapd.rc ${PREFIX}/etc/rc.d/courier-imap-imapd.sh.sample
	ln -s ${PREFIX}/libexec/courier-imap/pop3d.rc ${PREFIX}/etc/rc.d/courier-imap-pop3d.sh.sample
	@echo ""
	@echo "You will have to run ${PREFIX}/share/courier-imap/mkimapdcert to create"
	@echo "a self-signed certificate if you want to use imapd-ssl."
	@echo "And you will have to copy and edit the *.dist files to * in"
	@echo "${PREFIX}/etc/courier-imap ."
	@echo ""

.include <bsd.port.post.mk>