freebsd-dev/usr.sbin/mailwrapper/Makefile
Kyle Evans cb99e93575 pkgbase: resolve mailer.conf conflict WITHOUT_SENDMAIL
When WITHOUT_SENDMAIL is set, we end up with two different mailer.conf that
conflict, and hilarity ensues. There's currently three different places that
we might install mailer.conf:

- ^/etc/Makefile (package=runtime, contingent on MK_MAIL != no)
- ^/libexec/dma/dmagent/Makefile (package=dma, contingent on MK_SENDMAIL !=
no)
- ^/usr.sbin/mailwrapper/Makefile (package=utilities, contingent on
not-installed)

The mailwrapper installation will effectively never happen because the ^/etc
one will first.

This patch simplifies the whole situation; remove the ^/etc/Makefile version
and install it primarily in mailwrapper if MK_MAILWRAPPER != "no". The
scenarios covered in mailwrapper are:

- sendmail(8) is installed, dma(8) may or may not be installed
- neither sendmail(8) nor dma(8) is installed

In the first scenario, sendmail(8) is dominant so we can go ahead and
install the version in ^/etc/mail. In the unlisted scenario, sendmail(8) is
not installed but dma(8) is, we'll let ^/libexec/dma/dmagent do the
installation. In the second listed scenario, we still want to install an
example mailer.conf so just install the base sendmail(8) version.

Reviewed by:	bapt
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24924
2020-06-02 02:38:54 +00:00

41 lines
1.0 KiB
Makefile

# $FreeBSD$
.include <src.opts.mk>
.if ${MK_MAILWRAPPER} != "no"
PROG= mailwrapper
MAN= mailwrapper.8
LIBADD= util
.endif
.if ${MK_MAILWRAPPER} != "no" || ${MK_SENDMAIL} != "no"
SYMLINKS= ../sbin/mailwrapper /usr/bin/mailq \
../sbin/mailwrapper /usr/bin/newaliases \
mailwrapper /usr/sbin/hoststat \
mailwrapper /usr/sbin/purgestat \
mailwrapper /usr/sbin/sendmail
.if ${MK_MAILWRAPPER} == "no" && ${MK_SENDMAIL} != "no"
SYMLINKS+= ../libexec/sendmail/sendmail ${BINDIR}/mailwrapper
.endif
.endif
.if ${MK_MAILWRAPPER} != "no" && ${MK_SENDMAIL} == "no"
SYMLINKS+= ..${BINDIR}/mailwrapper /bin/rmail
.endif
.if ${MK_MAILWRAPPER} != "no"
# We install here if either sendmail(8) is enabled, or dma(8) isn't. In the
# latter scenario, we take care of the possibility that neither sendmail(8) nor
# dma(8) are installed and simply provide a default that can be changed for an
# alternative in ports.
.if ${MK_SENDMAIL} != "no" || ${MK_DMAGENT} == "no"
FILES= ${SRCTOP}/etc/mail/mailer.conf
FILESDIR= /etc/mail
FILESMODE= 644
.endif
.endif
.include <bsd.prog.mk>