From nobody@FreeBSD.org  Sat Apr 27 21:59:36 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id B1914275
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Apr 2013 21:59:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [69.147.83.34])
	by mx1.freebsd.org (Postfix) with ESMTP id 898151C49
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Apr 2013 21:59:36 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r3RLxawp069586
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Apr 2013 21:59:36 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r3RLxaiY069585;
	Sat, 27 Apr 2013 21:59:36 GMT
	(envelope-from nobody)
Message-Id: <201304272159.r3RLxaiY069585@red.freebsd.org>
Date: Sat, 27 Apr 2013 21:59:36 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] don't build mailwrapper if MK_MAILWRAPPER == no
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         178207
>Category:       conf
>Synopsis:       [build] [patch] don't build mailwrapper if MK_MAILWRAPPER == no
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 27 22:00:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Sun May 04 03:42:55 UTC 2014
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD fuji-current.local 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r+eabe039: Wed Apr 24 09:56:41 PDT 2013     root@fuji-current.local:/usr/obj/usr/src/sys/FUJI  i386
>Description:
The attached patch makes mailwrapper truly optional during the build; the previous code would allow it to be optional. Whether or not MK_MAILWRAPPER == no should be tied to MK_SENDMAIL == no is another good question though...
>How-To-Repeat:
1. Run the following commands:
make buildworld -DWITHOUT_SENDMAIL
make installworld -DWITHOUT_SENDMAIL
2. Reboot the system.
3. You'll see noise from mailwrapper about not finding sendmail.
>Fix:


Patch attached with submission follows:

From 9097caecaa69cd2956e7f79b7ff7191b585ed401 Mon Sep 17 00:00:00 2001
From: Garrett Cooper <yanegomi@gmail.com>
Date: Sat, 27 Apr 2013 14:49:21 -0700
Subject: [PATCH] Don't compile/install mailwrapper per MK_MAILWRAPPER

OptionalObsoleteFiles.inc was doing the wrong thing by
tying the delete to MK_SENDMAIL == no.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
---
 tools/build/mk/OptionalObsoleteFiles.inc | 2 --
 usr.sbin/Makefile                        | 5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index 81708b3..1affe34 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -3555,9 +3555,7 @@ OLD_FILES+=usr/share/misc/mail.tildehelp
 
 .if ${MK_MAILWRAPPER} == no
 OLD_FILES+=etc/mail/mailer.conf
-.if ${MK_SENDMAIL} == no
 OLD_FILES+=usr/sbin/mailwrapper
-.endif
 OLD_FILES+=usr/share/man/man8/mailwrapper.8.gz
 .endif
 
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 02e590e..358351a 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -36,7 +36,6 @@ SUBDIR=	adduser \
 	iostat \
 	isfctl \
 	kldxref \
-	mailwrapper \
 	makefs \
 	memcontrol \
 	mergemaster \
@@ -227,6 +226,10 @@ SUBDIR+=	nscd
 SUBDIR+=	lpr
 .endif
 
+.if ${MK_MAILWRAPPER} != "no"
+SUBDIR+=	mailwrapper
+.endif
+
 .if ${MK_MAN_UTILS} != "no"
 SUBDIR+=	manctl
 .endif
-- 
1.8.2



>Release-Note:
>Audit-Trail:
>Unformatted:
