aboutsummaryrefslogtreecommitdiffstats
path: root/mail/dma/Makefile
blob: e3c0aae6f124f12141e695872cbbc6a633b7d015 (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
# Created by: Daniel Roethlisberger <daniel@roe.ch>
# $FreeBSD$

PORTNAME=   dma
PORTVERSION=    0.11
PORTREVISION=   1
DISTVERSIONPREFIX=  v
PORTEPOCH=  1
CATEGORIES= mail ipv6

MAINTAINER= ports@FreeBSD.org
COMMENT=    DragonFly Mail Agent, a small MTA for local/outbound mail

LICENSE=    BSD3CLAUSE

USE_OPENSSL=    yes
USES=       uidfix

USE_GITHUB= yes
GH_ACCOUNT= corecode

BUILD_WRKSRC=   ${WRKSRC}/bsd
INSTALL_WRKSRC= ${WRKSRC}/bsd
CFLAGS+=    -I${OPENSSLINC} \
        -DCONF_PATH='\"${PREFIX}/etc/dma\"' \
        -DDMA_ROOT_USER='\"mailnull\"' \
        -DDMA_GROUP='\"mail\"'
LDFLAGS+=   -L${OPENSSLLIB}

MAKE_ENV=   __MAKE_CONF=/dev/null SRCCONF=/dev/null NO_WERROR=defined \
        MANDIR=${MANDIRS}/man

USE_RC_SUBR=    dma_flushq
SUB_FILES=  pkg-message
EXTRA_PATCHES=  ${FILESDIR}/fix-security-hole.patch:-p1

# Allow subports to extend.
CONFFILES+= dma.conf auth.conf

.include <bsd.port.pre.mk>

# 11.x has dma imported into base and /var/spool/dma added to mtree
.if ${OSVERSION} < 1100009
PLIST_SUB+= VARDIR=""
.else
PLIST_SUB+= VARDIR="@comment "
.endif

post-patch:
    @${REINPLACE_CMD} -e 's,/etc/dma,${PREFIX}/etc/dma,g' \
        ${WRKSRC}/dma.8
    @${REINPLACE_CMD} -e 's, /etc/dma, ${PREFIX}/etc/dma,g' \
        ${WRKSRC}/dma.conf
    @${REINPLACE_CMD} -e '/^MK_MAN/d' -e 's/^NOMAN/NO_MAN/' \
        ${WRKSRC}/bsd/dma-mbox-create/Makefile
.if ${OSVERSION} < 1000013
    @${REINPLACE_CMD} -e 's,^YFLAGS.*,,' ${WRKSRC}/bsd/dma/Makefile
.endif

post-install:
    ${MKDIR} ${STAGEDIR}${ETCDIR}
    ${MKDIR} ${STAGEDIR}/var/spool/dma
    ${INSTALL_DATA} ${WRKSRC}/dma.conf ${STAGEDIR}${ETCDIR}/dma.conf.sample
    ${INSTALL_DATA} ${WRKSRC}/auth.conf ${STAGEDIR}${ETCDIR}/auth.conf.sample

.include <bsd.port.post.mk>