Bug 19897

Summary: Allow building more then 1 SENDMAIL_CF
Product: Base System Reporter: James Housley <jim>
Component: binAssignee: Gregory Neil Shapiro <gshapiro>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description James Housley 2000-07-13 20:20:02 UTC
	Currently SENDMAIL_CF specified a single file to be compiled
	and installed as sendmail.cf.  However if you do all building
	on a single machine for your network there might be a need for
	different sendmail.cf's.

	The attached patch adds ADDITIONAL_SENDMAIL_CF will multiple
	files maybe specified to be built.  None are installed, only
	the file specified by SENDMAIL_CF is installed.
Comment 1 Garrett A. Wollman 2000-07-13 21:03:45 UTC
<<On Thu, 13 Jul 2000 15:11:39 -0400 (EDT), jim@thehousleys.net said:

> 	The attached patch adds ADDITIONAL_SENDMAIL_CF will multiple
> 	files maybe specified to be built.  None are installed, only
> 	the file specified by SENDMAIL_CF is installed.

Here is how we do something similar:

RCS file: /home/ncvs/src/etc/sendmail/Makefile,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Makefile
--- Makefile    1999/08/29 14:20:01     1.1.2.1
+++ Makefile    2000/01/08 18:07:34
@@ -15,25 +15,22 @@
            $(M4) -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
        $(CHMOD) $(ROMODE) ${.TARGET}
 
-ALL=   freebsd.cf
+ALL=   freebsd.cf mintaka.cf ossipee.cf lampang.cf
 
-# Local sendmail.cf, may be set in /etc/make.conf.  Warning! If set, this
-# causes 'make install' to always copy it over /etc/sendmail.cf!!!
-# Caveat emptor!  Be sure you want this before you enable it.
-.if defined(SENDMAIL_CF)
-ALL+=  ${SENDMAIL_CF}
-.endif
-
 CLEANFILES+=$(ALL)
 
 all: $(ALL)
 
 depend:
 
+# Local sendmail.cf, may be set in /etc/make.conf.  Warning! If set, this
+# causes 'make install' to always copy it over /etc/sendmail.cf!!!
+# Caveat emptor!  Be sure you want this before you enable it.
 install:
+       ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${ALL} \
+               ${DESTDIR}/etc/mail
 .if defined(SENDMAIL_CF)
-       ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${SENDMAIL_CF} \
-               ${DESTDIR}/etc/sendmail.cf
+       ln -f ${DESTDIR}/etc/mail/${SENDMAIL_CF} /etc/sendmail.cf
 .endif
 
 # Helper for src/etc/Makefile

If I were doing this again, I would probably do it like this:

.if defined(SENDMAIL_CF)
	set ${SENDMAIL_CF}; ln -f ${DESTDIR}/etc/mail/$1 /etc/sendmail.cf
.endif

In our application, we want all of the cf files to be installed; we
define the role of a particular machine by linking the ``official''
configuration file names to the machine-specific versions.

-GAWollman
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-14 15:10:55 UTC
Responsible Changed
From-To: freebsd-bugs->gshapiro

Haha!  We have a new sendmail maintainer! :-)
Comment 3 Gregory Neil Shapiro freebsd_committer freebsd_triage 2001-02-22 05:39:50 UTC
State Changed
From-To: open->feedback

I've checked in changes to the HEAD such that allows you to build any 
number of .cf files from .mc files in /etc/mail/.  Unless I hear otherwise, 
I'll close this PR in the near future.
Comment 4 Gregory Neil Shapiro freebsd_committer freebsd_triage 2001-02-28 02:57:58 UTC
State Changed
From-To: feedback->closed

The changes are now also in RELENG_4 (-STABLE).