summaryrefslogtreecommitdiff
path: root/mail/courier-mta/Makefile
blob: ca70f0a430318b67c39cca34a84472b85f1d452d (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
108
109
110
111
112
113
# $NetBSD: Makefile,v 1.37 2012/10/03 21:56:22 wiz Exp $

DISTNAME=	courier-${COURIER_VERSION}
PKGNAME=	${DISTNAME:S/-/-mta-/}
PKGREVISION=	1
CATEGORIES=	mail
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=courier/}
EXTRACT_SUFX=	.tar.bz2

CONFLICTS+=	esmtp>=1.2 postfix-[0-9]* qmail-[0-9]* sendmail-[0-9]*

MAINTAINER=	pkgsrc-users@NetBSD.org
COMMENT=	Courier mail transport agent
HOMEPAGE=	http://www.courier-mta.org/

DEPENDS+=	courier-maildir>=${COURIER_VERSION}:../../mail/courier-maildir
DEPENDS+=	couriertcpd>=${COURIER_VERSION}:../../net/couriertcpd
DEPENDS+=	maildrop>=2.5.0:../../mail/maildrop

PKG_DESTDIR_SUPPORT=	user-destdir
USE_TOOLS+=		gmake perl:run
USE_LANGUAGES=		c c++
GCC_REQD+=		3.0	# need Standard C++ Library

.include "Makefile.common"

PLIST_SRC+=		${PKGDIR}/PLIST

.include "pkginstall.mk"
.include "options.mk"

.if ${OPSYS} == "NetBSD"
CONFIGURE_ARGS+=	ac_cv_path_REHASH=${FALSE:Q}
.endif

USERGROUP_PHASE=	configure

CONFIGURE_ENV+=		CERTTOOL=${COURIER_CERTTOOL:Q}
CONFIGURE_ENV+=		OPENSSL=${COURIER_OPENSSL:Q}
CONFIGURE_ENV+=		PROCMAIL=${PREFIX}/bin/procmail

CONFIGURE_ARGS+=	--datadir=${DATADIR}
CONFIGURE_ARGS+=	--with-mailuid=${PKG_UID.${COURIER_USER}}
CONFIGURE_ARGS+=	--with-mailgid=${PKG_GID.${COURIER_GROUP}}
CONFIGURE_ARGS+=	--with-paranoid-smtpext
CONFIGURE_ARGS+=	--with-piddir=${COURIER_STATEDIR}/tmp
CONFIGURE_ARGS+=	--with-transport=${COURIER_TRANSPORTS:M*:Q}
#CONFIGURE_ARGS+=	--with-certdb=${SSLCERTS}

# This argument is actually here just to make the "webmail" configure
# script work.  The value is not actually used since in reality, we are
# using the sqwebmail package to provide the Courier webmail component.
CONFIGURE_ARGS+=	--enable-mimetypes=/nonexistent

INSTALL_DIRS=		webadmin courier
INSTALL_AM_MAKEFLAGS+=	sysconfdir=${EGDIR:Q}
INSTALL_AM_MAKEFLAGS+=	htmldocdir=${DOCDIR:Q}
INSTALL_MAKE_FLAGS=	${MAKE_FLAGS} AM_MAKEFLAGS=${INSTALL_AM_MAKEFLAGS:Q}

SUBST_CLASSES+=		courier
SUBST_FILES.courier=	courier/doc/mkesmtpdcert.8.in			\
			courier/doc/mkesmtpdcert.html.in		\
			courier/filters/courierfilter.8.in		\
			courier/filters/courierfilter.html.in		\
			courier/module.esmtp/esmtpd-msa.dist.in		\
			courier/module.esmtp/esmtpd-ssl.dist.in		\
			courier/module.esmtp/esmtpd.cnf.openssl.in	\
			courier/module.esmtp/esmtpd.dist.in		\
			courier/module.esmtp/mkesmtpdcert.in
SUBST_SED.courier=	-e "s|^ESMTPDSTART=.*|ESMTPDSTART=YES|g"	\
			-e "s|^ESMTPDSSLSTART=.*|ESMTPDSSLSTART=YES|g"	\
			-e "s|@mydatadir@|@sysconfdir@|g"		\
			-e "s|@datadir@/esmtpd.pem|@sysconfdir@/esmtpd.pem|g" \
			-e "s|@datadir@/esmtpd.rand|@sysconfdir@/esmtpd.rand|g" \
			-e "s|@libexecdir@/filters|@libexecdir@/courier/filters|g"
SUBST_STAGE.courier=	pre-configure

SUBST_CLASSES+=		perms
SUBST_FILES.perms=	courier/perms.sh.in
SUBST_SED.perms=	-e "s,@REAL_ROOT_USER@,"${REAL_ROOT_USER}",g"	\
			-e "s,@ROOT_USER@,"${ROOT_USER}",g"		\
			-e "s,@ROOT_GROUP@,"${ROOT_GROUP}",g"
SUBST_STAGE.perms=	pre-configure

SUBST_CLASSES+=		paths
SUBST_FILES.paths=	${WRKDIR}/mailer.conf
SUBST_SED.paths+=	-e "s,@PREFIX@,${PREFIX},g"
SUBST_STAGE.paths=	post-patch

REPLACE_PERL+=	courier/webadmin/*.pl courier/webadmin/*.pl.in webadmin/*.pl

SPECIAL_PERMS+=	${DATADIR}/filterctl ${COURIER_USER} ${COURIER_GROUP} 0500
SPECIAL_PERMS+=	${PREFIX}/sbin/courierfilter  ${COURIER_USER} \
		${COURIER_GROUP} 0500

.include "../../lang/perl5/buildlink3.mk"
.include "../../security/courier-authlib/buildlink3.mk"

post-extract:
	${CP} ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf

post-build:
	${TOUCH} ${WRKDIR}/locallowercase

post-install:
	cd ${WRKSRC}/courier && \
		${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} \
		DESTDIR=${DESTDIR} install-permissions
	${INSTALL_DATA} ${WRKDIR}/mailer.conf ${DESTDIR}${EGDIR}
	${INSTALL_DATA} ${WRKDIR}/locallowercase \
		${DESTDIR}${EGDIR}/locallowercase

.include "../../mk/bsd.pkg.mk"