Index: etc/dma/dma.conf =================================================================== --- etc/dma/dma.conf +++ etc/dma/dma.conf @@ -1,64 +0,0 @@ -# $FreeBSD$ -# -# Your smarthost (also called relayhost). Leave blank if you don't want -# smarthost support. -#SMARTHOST - -# Use this SMTP port. Most users will be fine with the default (25) -#PORT 25 - -# Path to your alias file. Just stay with the default. -#ALIASES /etc/aliases - -# Path to your spooldir. Just stay with the default. -#SPOOLDIR /var/spool/dma - -# SMTP authentication -#AUTHPATH /etc/dma/auth.conf - -# Uncomment if yout want TLS/SSL support -#SECURETRANSFER - -# Uncomment if you want STARTTLS support (only used in combination with -# SECURETRANSFER) -#STARTTLS - -# Uncomment if you have specified STARTTLS above and it should be allowed -# to fail ("opportunistic TLS", use an encrypted connection when available -# but allow an unencrypted one to servers that do not support it) -#OPPORTUNISTIC_TLS - -# Path to your local SSL certificate -#CERTFILE - -# If you want to use plain text SMTP login without using encryption, change -# the SECURE entry below to INSECURE. Otherwise plain login will only work -# over a secure connection. Use this option with caution. -#SECURE - -# Uncomment if you want to defer your mails. This is useful if you are -# behind a dialup line. You have to submit your mails manually with dma -q -#DEFER - -# Uncomment if you want the bounce message to include the complete original -# message, not just the headers. -#FULLBOUNCE - -# The internet hostname dma uses to identify the host. -# If not set or empty, the result of gethostname(2) is used. -# If MAILNAME is an absolute path to a file, the first line of this file -# will be used as the hostname. -#MAILNAME mail.example.net - -# Masquerade envelope from addresses with this address/hostname. -# Use this if mails are not accepted by destination mail servers because -# your sender domain is invalid. -# By default, MASQUERADE is not set. -# Format: MASQUERADE [user@][host] -# Examples: -# MASQUERADE john@ on host "hamlet" will send all mails as john@hamlet -# MASQUERADE percolator will send mails as $username@percolator, e.g. fish@percolator -# MASQUERADE herb@ert will send all mails as herb@ert - -# Directly forward the mail to the SMARTHOST bypassing aliases and local delivery -#NULLCLIENT Index: libexec/dma/Makefile =================================================================== --- libexec/dma/Makefile +++ libexec/dma/Makefile @@ -24,6 +24,8 @@ spool.c \ util.c MAN8= dma.8 +CONFS= dma.conf +CONFSDIR= ${ETCDIR}/dma YFLAGS+= -i CLEANFILES= aliases_parse.i Index: share/mk/bsd.README =================================================================== --- share/mk/bsd.README +++ share/mk/bsd.README @@ -18,6 +18,7 @@ bsd.arch.inc.mk - includes arch-specific Makefile.$arch bsd.compiler.mk - defined based on current compiler +bsd.conf.mk - configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) bsd.dep.mk - handle Makefile dependencies bsd.doc.mk - building troff system documents Index: share/mk/bsd.conf.mk =================================================================== --- /dev/null +++ share/mk/bsd.conf.mk @@ -0,0 +1,81 @@ +# $FreeBSD$ + +.if !target(____) +.error bsd.conf.mk cannot be included directly. +.endif + +.if ${MK_INCLUDES} != "no" +CONFGROUPS?= CONFS + +.if !target(buildconfig) +.for group in ${CONFSGROUPS} +buildconfig: ${${group}} +.endfor +.endif + +all: buildconfig + +.if !target(installconfig) +.for group in ${CONFGROUPS} +.if defined(${group}) && !empty(${group}) + +${group}OWN?= ${BINOWN} +${group}GRP?= ${BINGRP} +${group}MODE?= ${NOBINMODE} +${group}DIR?= ${ETCDIR}/ +STAGE_SETS+= ${group} +STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} + +_${group}CONFS= +.for cnf in ${${group}} +.if defined(${group}OWN_${cnf:T}) || defined(${group}GRP_${cnf:T}) || \ + defined(${group}MODE_${cnf:T}) || defined(${group}DIR_${cnf:T}) || \ + defined(${group}NAME_${cnf:T}) || defined(${group}NAME) +${group}OWN_${cnf:T}?= ${${group}OWN} +${group}GRP_${cnf:T}?= ${${group}GRP} +${group}MODE_${cnf:T}?= ${${group}MODE} +${group}DIR_${cnf:T}?= ${${group}DIR} +.if defined(${group}NAME) +${group}NAME_${cnf:T}?= ${${group}NAME} +.else +${group}NAME_${cnf:T}?= ${cnf:T} +.endif +STAGE_AS_SETS+= ${cnf:T} +STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}} +# XXX {group}OWN,GRP,MODE +STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}} +stage_as.${cnf:T}: ${cnf} +stage_config: stage_as.${cnf:T} + +installconfig: _${group}INS_${cnf:T} +_${group}INS_${cnf:T}: ${cnf} + ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \ + -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ + ${.ALLSRC} \ + ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} +.else +_${group}CONFS+= ${cnf} +.endif +.endfor +.if !empty(_${group}CONFS) +stage_files.${group}: ${_${group}CONFS} +stage_config: stage_files.${group} + +installconfig: _${group}INS +_${group}INS: ${_${group}CONFS} +.if defined(${group}NAME) + ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} +.else + ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${.ALLSRC} ${DESTDIR}${${group}DIR} +.endif +.endif + +.endif # defined(${group}) && !empty(${group}) +.endfor + +.endif # !target(installconfig) + +.endif # ${MK_TOOLCHAIN} != "no" Index: share/mk/bsd.lib.mk =================================================================== --- share/mk/bsd.lib.mk +++ share/mk/bsd.lib.mk @@ -390,6 +390,7 @@ .include .include .include +.include .endif .include Index: share/mk/bsd.own.mk =================================================================== --- share/mk/bsd.own.mk +++ share/mk/bsd.own.mk @@ -213,6 +213,7 @@ NLSMODE?= ${NOBINMODE} INCLUDEDIR?= /usr/include +ETCDIR?= /etc # # install(1) parameters. Index: share/mk/bsd.prog.mk =================================================================== --- share/mk/bsd.prog.mk +++ share/mk/bsd.prog.mk @@ -249,6 +249,7 @@ NLSNAME?= ${PROG} .include +.include .include .include .include Index: share/mk/bsd.progs.mk =================================================================== --- share/mk/bsd.progs.mk +++ share/mk/bsd.progs.mk @@ -71,7 +71,7 @@ # These are handled by the main make process. .ifdef _RECURSING_PROGS -_PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS FILESGROUPS SCRIPTS +_PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS FILESGROUPS SCRIPTS CONFGROUPS .for v in ${_PROGS_GLOBAL_VARS} $v = .endfor Index: share/mk/bsd.subdir.mk =================================================================== --- share/mk/bsd.subdir.mk +++ share/mk/bsd.subdir.mk @@ -122,7 +122,7 @@ .endif .endfor -.for __target in files includes +.for __target in files includes config .for __stage in build install ${__stage}${__target}: .if make(${__stage}${__target})