Index: bsd.port.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.544 diff -u -r1.544 bsd.port.mk --- bsd.port.mk 30 Sep 2006 19:25:45 -0000 1.544 +++ bsd.port.mk 28 Nov 2006 16:41:48 -0000 @@ -857,6 +857,15 @@ # MTREE_FILE - The name of the mtree file. # Default: /etc/mtree/BSD.x11.dist if USE_X_PREFIX is set, # /etc/mtree/BSD.local.dist otherwise. +# CONF_FILES - This directive should be used to define config files +# installed by a port. The associated default config file should +# also exist and be installed. (DEF_CONF_SUFFIX) Files here are +# relative to PREFIX. This is the equivalent of: +# @unexec if cmp -s %D/etc/foo.conf.sample %D/etc/foo.conf; then +# rm -f %D/etc/foo.conf; fi +# DEF_CONF_SUFFIX +# - Filename suffix for the default CONF_FILES. +# Default: .sample # PLIST_DIRS - Directories to be added to packing list # PLIST_FILES - Files and symbolic links to be added to packing list # @@ -5419,6 +5428,16 @@ done @${ECHO_CMD} '@cwd ${PREFIX}' >> ${TMPPLIST} .endif + +.if !defined(DEF_CONF_SUFFIX) + DEF_CONF_SUFFIX= .sample +.endif +.if defined(CONF_FILES) + @for i in ${CONF_FILES}; do \ + ${ECHO_CMD} "@unexec if cmp -s %D/$${i}${DEF_CONF_SUFFIX} %D/$${i}; then rm -f %D/$${i}; fi" >> ${TMPPLIST}; \ + ${ECHO_CMD} "@unexec rm -f %D/$${i}${DEF_CONF_SUFFIX}" >> ${TMPPLIST}; \ + done +.endif @for i in $$(${ECHO_CMD} ${__MANPAGES} ${_TMLINKS:M${_PREFIX}*:S|^${_PREFIX}/||} ' ' | ${SED} -E -e 's|man([1-9ln])/([^/ ]+) |cat\1/\2 |g'); do \ ${ECHO_CMD} "@unexec rm -f %D/$${i%.gz} %D/$${i%.gz}.gz" >> ${TMPPLIST}; \ done