summaryrefslogtreecommitdiff
path: root/mail/opensmtpd/Makefile
blob: a2874a9f22b1f8c1f4f03cc942a41d9069609e65 (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
# $NetBSD: Makefile,v 1.8 2016/05/01 05:56:40 mef Exp $

VERSION=	5.7.3p2
DISTNAME=	opensmtpd-${VERSION}
CATEGORIES=	mail net
MASTER_SITES=	http://www.opensmtpd.org/archives/

MAINTAINER=	ftigeot@wolfpond.org
HOMEPAGE=	http://www.opensmtpd.org/
COMMENT=	The OpenSMTPD mail transfer agent, a replacement for sendmail
LICENSE=	isc AND modified-bsd AND 2-clause-bsd

CONFLICTS+=	courier-mta-[0-9]* fastforward>=0.51nb2 sendmail-[0-9]*
CONFLICTS+=	esmtp>=1.2 nullmailer-[0-9]* postfix-[0-9]*
BROKEN_FOR_PLATFORM=	OpenBSD-*-*

BUILD_DEFS+=	VARBASE

USE_LANGUAGES=	c
USE_LIBTOOL=	yes
USE_TOOLS+=	pkg-config yacc
USE_TOOLS+=	automake aclocal autoheader autoconf

SMTPD_HOME=	${VARBASE}/chroot/smtpd
OWN_DIRS=	${SMTPD_HOME}

PKG_GROUPS=		_smtpd _smtpq
PKG_USERS=		_smtpd:_smtpd _smtpq:_smtpq
PKG_GECOS._smtpd=	OpenSMTPD pseudo-user
PKG_HOME._smtpd=	${SMTPD_HOME}
PKG_GECOS._smtpq=	OpenSMTPD pseudo-user
PKG_HOME._smtpq=	${SMTPD_HOME}

GNU_CONFIGURE=	yes
USE_DB185=	yes
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+=	--with-mantype=man
CONFIGURE_ARGS+=	--with-privsep-path=${SMTPD_HOME}
CONFIGURE_ARGS+=	--with-ssl-dir=${SSLBASE:Q}
CONFIGURE_ARGS+=	--enable-table-db
CONFIGURE_ARGS+=	--without-zlib-version-check

EXAMPLEDIR=	${PREFIX}/share/examples/opensmtpd
CONF_FILES=	${EXAMPLEDIR}/smtpd.conf ${PKG_SYSCONFDIR}/smtpd.conf

RCD_SCRIPTS=	opensmtpd

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

SUBST_CLASSES+=			exampledir
SUBST_STAGE.exampledir=		pre-configure
SUBST_MESSAGE.exampledir=	Fixing exampledir path
SUBST_FILES.exampledir=		mk/smtpd/Makefile.am
SUBST_SED.exampledir+=		-e 's,@EXAMPLE_DIR@,${EXAMPLEDIR},'

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

pre-configure:
	cd $(WRKSRC) && ${PREFIX}/bin/libtoolize --copy --force
	cd $(WRKSRC) && ${TOOLS_CMD.aclocal}
	cd $(WRKSRC) && ${TOOLS_CMD.autoconf}
	cd $(WRKSRC) && ${TOOLS_CMD.autoheader}
	cd $(WRKSRC) && ${TOOLS_CMD.automake} --foreign --add-missing --copy

post-install:
	${INSTALL_DATA} ${WRKDIR}/mailer.conf \
		${DESTDIR}${EXAMPLEDIR}/mailer.conf

.include "../../databases/db5/buildlink3.mk"
.include "../../devel/libevent/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../net/libasr/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"