--- /usr/ports/Mk/bsd.port.mk.orig Thu Dec 15 13:50:25 2005 +++ /usr/ports/Mk/bsd.port.mk Thu Dec 15 18:46:20 2005 @@ -1529,6 +1529,10 @@ .endif .endif +.if defined(CONF_FILES) +CONF_SUFX?= .sample +.endif + .if defined(USE_ICONV) LIB_DEPENDS+= iconv.3:${PORTSDIR}/converters/libiconv .endif @@ -3703,8 +3707,8 @@ _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ pre-su-install-script do-install install-desktop-entries \ post-install post-install-script add-plist-info \ - add-plist-docs add-plist-post install-rc-script compress-man \ - run-ldconfig fake-pkg security-check + add-plist-docs add-plist-post install-rc-script install-conf \ + compress-man run-ldconfig fake-pkg security-check _PACKAGE_DEP= install _PACKAGE_SEQ= package-message pre-package pre-package-script \ do-package post-package-script @@ -4832,6 +4836,11 @@ @${MKDIR} `${DIRNAME} ${TMPPLIST}` @if [ ! -f ${DESCR} ]; then ${ECHO_CMD} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi @>${TMPPLIST} +.if defined(CONF_FILES) +.for conf in ${CONF_FILES} + @${ECHO_CMD} "@unexec if cmp -s %D/${conf} %D/${conf}${CONF_SUFX}; then rm %D/${conf}; fi" >> ${TMPPLIST} +.endfor +.endif @for file in ${PLIST_FILES}; do \ ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \ done @@ -4957,6 +4966,22 @@ ${ECHO_CMD} "etc/rc.d/$${i%.sh}.sh" >> ${TMPPLIST}; \ done .endif +.else + @${DO_NADA} +.endif +.endif + +.if !target(install-conf) +install-conf: +.if defined(CONF_FILES) + @${ECHO_CMD} "===> Installing configuration file(s)" + @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST} +.for conf in ${CONF_FILES} + @if [ ! -f ${PREFIX}/${conf} ]; then \ + ${INSTALL_DATA} ${PREFIX}/${conf}${CONF_SUFX} ${PREFIX}/${conf}; \ + fi + @${ECHO_CMD} "@exec [ -f %D/${conf} ] || cp %D/${conf}${CONF_SUFX} %D/${conf}" >> ${TMPPLIST} +.endfor .else @${DO_NADA} .endif