From 926bb919a76a91145ce96aecb0f399e7679da855 Mon Sep 17 00:00:00 2001 From: scrappy Date: Sat, 15 Apr 2006 16:11:25 +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 --- deskutils/horde4-kronolith/Makefile | 9 +++------ deskutils/horde4-kronolith/files/pkg-deinstall.in | 9 +++------ deskutils/horde4-kronolith/files/pkg-install.in | 23 +++++++++++++++++++++++ deskutils/horde4-kronolith/pkg-plist | 3 --- 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 deskutils/horde4-kronolith/files/pkg-install.in (limited to 'deskutils/horde4-kronolith') diff --git a/deskutils/horde4-kronolith/Makefile b/deskutils/horde4-kronolith/Makefile index d88d410b2b7d..57ca84077c3e 100644 --- a/deskutils/horde4-kronolith/Makefile +++ b/deskutils/horde4-kronolith/Makefile @@ -40,7 +40,7 @@ LKRONOLITHDIR?= ${LHORDEDIR}/kronolith PKGMESSAGE= ${WRKDIR}/pkg-message PKGDEINSTALL= ${WRKDIR}/pkg-deinstall -SUB_FILES= pkg-message pkg-deinstall +SUB_FILES= pkg-message pkg-install pkg-deinstall SUB_LIST= KRONOLITHDIR=${KRONOLITHDIR} PLIST_SUB= KRONOLITHDIR=${LKRONOLITHDIR} HORDE_INC=${HORDE_INC:S|^${LOCALBASE}/||} @@ -68,11 +68,7 @@ do-install: @${CP} -Rp ${WRKSRC}/${REP} ${KRONOLITHDIR} .endfor @${CP} -p ${WRKSRC}/*.php ${KRONOLITHDIR} -.for FILE in ${CONFFILE} - @if [ ! -f ${CONFDIR}/${FILE} ]; then \ - ${CP} ${CONFDIR}/${FILE}.dist ${CONFDIR}/${FILE} ; \ - fi -.endfor + @${CHOWN} -R ${WWWOWN}:${WWWGRP} ${KRONOLITHDIR} @${CHMOD} -R o-rwx ${CONFDIR} @${INSTALL_DATA} ${WRKDIR}/httpd-kronolith.conf ${HORDE_INC} @@ -85,6 +81,7 @@ do-install: .endif post-install: + @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @${ECHO_MSG} @${CAT} ${PKGMESSAGE} @${ECHO_MSG} diff --git a/deskutils/horde4-kronolith/files/pkg-deinstall.in b/deskutils/horde4-kronolith/files/pkg-deinstall.in index 896c740dd4da..97d0a7cca145 100644 --- a/deskutils/horde4-kronolith/files/pkg-deinstall.in +++ b/deskutils/horde4-kronolith/files/pkg-deinstall.in @@ -12,13 +12,10 @@ if [ -z "${PACKAGE_BUILDING}" ]; then for cf in `ls %%KRONOLITHDIR%%/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/deskutils/horde4-kronolith/files/pkg-install.in b/deskutils/horde4-kronolith/files/pkg-install.in new file mode 100644 index 000000000000..84722b6dc70a --- /dev/null +++ b/deskutils/horde4-kronolith/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 %%KRONOLITHDIR%%/config/*.dist | sed -e 's/\.dist//g'`; do + if [ ! -f $cf ]; then + cp -p $cf.dist $cf + fi + done + fi + ;; +esac diff --git a/deskutils/horde4-kronolith/pkg-plist b/deskutils/horde4-kronolith/pkg-plist index 86e9d88a32d9..d21da14948c1 100644 --- a/deskutils/horde4-kronolith/pkg-plist +++ b/deskutils/horde4-kronolith/pkg-plist @@ -13,11 +13,8 @@ %%KRONOLITHDIR%%/calendars.php %%KRONOLITHDIR%%/config/.htaccess %%KRONOLITHDIR%%/config/conf.xml -%%KRONOLITHDIR%%/config/keywords.php %%KRONOLITHDIR%%/config/keywords.php.dist -%%KRONOLITHDIR%%/config/menu.php %%KRONOLITHDIR%%/config/menu.php.dist -%%KRONOLITHDIR%%/config/prefs.php %%KRONOLITHDIR%%/config/prefs.php.dist %%KRONOLITHDIR%%/contacts.php %%KRONOLITHDIR%%/data.php -- cgit