Subject: handling generated config files (or substitutions within)
To: None <>
From: john heasley <>
List: tech-toolchain
Date: 05/19/2004 15:20:53
Postfix comes with a template which has some required variables
without a valkue.  These are normally filled at post-install time by
a script that comes with Postfix.  However, that script uses postconf
(a binary built w/ Postfix) to get the system-dependent default and I
gather that wouldn't work well for cross builds.

I'd like to just use sed to make the substitutions.  I have that working,
but I'm not sure that my technique is the proper way or necessarily the
most elegant.  Or is altering Postfix's template file the preferred

comments on the following?

SRCS=           ${DIST}/

CONFIGFILES+=                   postfix-script post-install
FILESMODE_postfix-script=       ${BINMODE}
FILESMODE_post-install=         ${BINMODE}

.include "${.CURDIR}/../"


all: ${SRCS} Makefile
        sed -e "/^setgid_group =/s/$$/ maildrop/" \
                -e "\|^html_directory =|s|$$| ${PFIX_HTMLDIR}|" \
                -e "\|^mailq_path =|s|$$| /usr/bin/mailq|" \
                -e "\|^manpage_directory =|s|$$| /usr/share/man|" \
                -e "\|^newaliases_path =|s|$$| /usr/bin/newaliases|" \
                -e "\|^readme_directory =|s|$$| ${PFIX_EXAMPLEDIR}|" \
                -e "\|^sample_directory =|s|$$| ${PFIX_EXAMPLEDIR}|" \
                -e "\|^sendmail_path =|s|$$| /usr/sbin/sendmail|" \
                ${DIST}/ >

.include <>