# $FreeBSD$

PROG=	mailwrapper
MAN8=	mailwrapper.8

DPADD+=	${LIBUTIL}
LDADD+=	-lutil

SYMLINKS= 	${BINDIR}/mailwrapper /usr/sbin/sendmail  \
		${BINDIR}/mailwrapper /usr/bin/newaliases \
		${BINDIR}/mailwrapper /usr/bin/mailq

afterinstall:
	@if [ ! -f ${DESTDIR}/etc/mail/mailer.conf ]; then \
		${INSTALL} -c -o root -g wheel -m 644 \
		    ${.CURDIR}/../../etc/mail/mailer.conf ${DESTDIR}/etc/mail; \
	fi

.include <bsd.prog.mk>

# $FreeBSD$

PROG=	mailwrapper
MAN8=	mailwrapper.8

DPADD+=	${LIBUTIL}
LDADD+=	-lutil

SYMLINKS= 	${BINDIR}/mailwrapper /usr/sbin/sendmail  \
		${BINDIR}/mailwrapper /usr/bin/newaliases \
		${BINDIR}/mailwrapper /usr/bin/mailq

afterinstall:
.if !exists(${DESTDIR}/etc/mail/mailer.conf)
	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 \
	    ${.CURDIR}/../../etc/mail/mailer.conf ${DESTDIR}/etc/mail
.endif

.include <bsd.prog.mk>

Install mailer.conf as ${BINOWN}, ${BINGRP}, rather than root:wheel. This lets unprivileged installworld: almost work first try and always work second.
Install mailer.conf as ${BINOWN}, ${BINGRP}, rather than root:wheel.  This
lets unprivileged installworld: almost work first try and always work second.

BINOWN isn't quite right for this, but it's not really worth creating
a MAILOWN for this.
