1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-04 06:15:24 +00:00
freebsd-ports/mail/dma/Makefile
Baptiste Daroussin 2311550ca7 Incorporate a patch from upstream
Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
finding out from BSDNow Episode 152. Comments following were from his commit
which explains better than I. Just taking his change and putting it here as well.

* dma makes an age-old mistake of not properly checking whether a file
  owned by a user is a symlink or not, a bug which the original mail.local
  also had.

* Add O_NOFOLLOW to disallow symlinks.

Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
           about the mail.local bug.
2016-08-20 16:39:51 +00:00

67 lines
1.6 KiB
Makefile

# 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>