From bf25f044454eb7856fbe55acbe4439a4e0928d68 Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Sat, 15 Apr 2006 16:05:33 +0000 Subject: After a recent discussion on freebsd-ports, I have modified the Horde ports, so that they now do not overwrite existing configuration files. Rather than backing up the old ones and allowing the user to merge the files by hand, config files are left untouched. Submitted by: Shaun Amott --- mail/horde4-turba/Makefile | 9 +++------ mail/horde4-turba/files/pkg-deinstall.in | 9 +++------ mail/horde4-turba/files/pkg-install.in | 23 +++++++++++++++++++++++ mail/horde4-turba/pkg-plist | 5 ----- 4 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 mail/horde4-turba/files/pkg-install.in (limited to 'mail/horde4-turba') diff --git a/mail/horde4-turba/Makefile b/mail/horde4-turba/Makefile index 76740d503218..f18b1d2cb54c 100644 --- a/mail/horde4-turba/Makefile +++ b/mail/horde4-turba/Makefile @@ -53,7 +53,7 @@ LTURBADIR?= ${LHORDEDIR}/turba PLIST_SUB= TURBADIR=${LTURBADIR} HORDE_INC=${HORDE_INC:S|^${LOCALBASE}/||} PKGMESSAGE= ${WRKDIR}/pkg-message PKGDEINSTALL= ${WRKDIR}/pkg-deinstall -SUB_FILES= pkg-message pkg-deinstall +SUB_FILES= pkg-message pkg-install pkg-deinstall SUB_LIST= TURBADIR=${TURBADIR} CONFDIR=${CONFDIR} TURBADIR= ${PREFIX}/${LTURBADIR} @@ -90,11 +90,7 @@ do-install: @${CP} -Rp ${WRKSRC}/${REP} ${TURBADIR} .endfor @${CP} -p ${WRKSRC}/*.php ${TURBADIR} -.for FILE in ${CONFFILE} - @if [ ! -f ${CONFDIR}/${FILE} ]; then \ - ${CP} ${CONFDIR}/${FILE}.dist ${CONFDIR}/${FILE} ; \ - fi -.endfor + @${CHOWN} -R ${WWWOWN}:${WWWGRP} ${TURBADIR} @${CHMOD} -R o-rwx ${CONFDIR} @${INSTALL_DATA} ${WRKDIR}/httpd-turba.conf ${HORDE_INC} @@ -107,6 +103,7 @@ do-install: .endif post-install: + @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @${ECHO_MSG} @${CAT} ${PKGMESSAGE} @${ECHO_MSG} diff --git a/mail/horde4-turba/files/pkg-deinstall.in b/mail/horde4-turba/files/pkg-deinstall.in index afe8f9215da2..fced5020f1b0 100644 --- a/mail/horde4-turba/files/pkg-deinstall.in +++ b/mail/horde4-turba/files/pkg-deinstall.in @@ -12,13 +12,10 @@ if [ -z "${PACKAGE_BUILDING}" ]; then for cf in `ls %%TURBADIR%%/config/*php`; do diff -bBqw $cf $cf.dist >/dev/null 2>&1 case $? in - 0) # original config file, will be deleted by pkg-plist + 0) # original config file, delete it + rm -f $cf ;; - 1) # config file has been updated, must be backuped - cp -p $cf $cf.previous - echo "===> Backing-up..." - echo "---> $cf has been saved ***" - echo "---> as $cf.previous ***" + 1) # config file has been updated, leave it alone ;; *) # not found? ;; diff --git a/mail/horde4-turba/files/pkg-install.in b/mail/horde4-turba/files/pkg-install.in new file mode 100644 index 000000000000..e0611782bf84 --- /dev/null +++ b/mail/horde4-turba/files/pkg-install.in @@ -0,0 +1,23 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +PATH=/usr/sbin:/usr/bin:/bin ; export PATH + +case $2 in + PRE-INSTALL) + ;; + + POST-INSTALL) + if [ -z "${PACKAGE_BUILDING}" ]; then + # Copy over sample config files unless they already exist + + for cf in `ls %%TURBADIR%%/config/*.dist | sed -e 's/\.dist//g'`; do + if [ ! -f $cf ]; then + cp -p $cf.dist $cf + fi + done + fi + ;; +esac diff --git a/mail/horde4-turba/pkg-plist b/mail/horde4-turba/pkg-plist index f6fd94a1e219..ad3564974fa4 100644 --- a/mail/horde4-turba/pkg-plist +++ b/mail/horde4-turba/pkg-plist @@ -10,16 +10,11 @@ %%TURBADIR%%/addressbooks.php %%TURBADIR%%/browse.php %%TURBADIR%%/config/.htaccess -%%TURBADIR%%/config/attributes.php %%TURBADIR%%/config/attributes.php.dist %%TURBADIR%%/config/conf.xml -%%TURBADIR%%/config/menu.php %%TURBADIR%%/config/menu.php.dist -%%TURBADIR%%/config/mime_drivers.php %%TURBADIR%%/config/mime_drivers.php.dist -%%TURBADIR%%/config/prefs.php %%TURBADIR%%/config/prefs.php.dist -%%TURBADIR%%/config/sources.php %%TURBADIR%%/config/sources.php.dist %%TURBADIR%%/data.php %%TURBADIR%%/delete.php -- cgit v1.2.3