summaryrefslogtreecommitdiff
path: root/mail/mailwrapper/Makefile
blob: 2393315a2a973fb99e88d50233cd18e80d27b02f (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
# $NetBSD: Makefile,v 1.16 2004/01/20 12:19:43 agc Exp $

DISTNAME=	mailwrapper-19990412
PKGREVISION=	1
CATEGORIES=	mail
MASTER_SITES=	${MASTER_SITE_LOCAL}

MAINTAINER=	tech-pkg@NetBSD.org
COMMENT=	NetBSD 1.4's wrapper to support arbitrary Mail Transport Agents

NO_SRC_ON_FTP=		Already in MASTER_SITE_LOCAL

WRKSRC=			${WRKDIR}/mailwrapper
USE_PKGINSTALL=		yes
NO_CONFIGURE=		yes
MANCOMPRESSED_IF_MANZ=	yes

.if exists(/usr/sbin/mailwrapper)
PKG_SKIP_REASON= "${PKGNAME} is part of your ${OPSYS} distribution"
.endif

EGDIR=		${PREFIX}/share/examples/mailwrapper
CONF_FILES=	${EGDIR}/mailer.conf ${PKG_SYSCONFDIR}/mailer.conf

LIBEXECDIR=	/usr/libexec/sendmail
SENDMAIL=	/usr/sbin/sendmail

post-patch:
.for f in mailer.conf.5 mailwrapper.8 mailwrapper.c
	${SED} -e 's|/etc/mailer.conf|${PKG_SYSCONFDIR}/mailer.conf|g' \
		< ${WRKSRC}/$f > ${WRKSRC}/$f.new
	${MV} ${WRKSRC}/$f.new ${WRKSRC}/$f
.endfor
.undef f

post-install:
	${INSTALL_DATA_DIR} ${EGDIR}
	${INSTALL_DATA} ${WRKSRC}/mailer.conf ${EGDIR}/mailer.conf
	${INSTALL_DATA_DIR} ${LIBEXECDIR}
	${MV} -i ${SENDMAIL} ${LIBEXECDIR} </dev/null 2>/dev/null || ${TRUE}
	${LN} -fs ${PREFIX}/sbin/mailwrapper /usr/bin/mailq
	${LN} -fs ${PREFIX}/sbin/mailwrapper /usr/bin/newaliases
	${LN} -fs ${PREFIX}/sbin/mailwrapper ${SENDMAIL}

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