diff options
author | jlam <jlam> | 2001-11-19 16:23:08 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-11-19 16:23:08 +0000 |
commit | 921dba3e4056acfac3df83e1629ab22167889846 (patch) | |
tree | d5fafec9bfc1b14f6b1c5da4d0c45beb2b4758b4 /mail/imp | |
parent | e740603fc9e2110613fe030c8dabf0543d664a81 (diff) | |
download | pkgsrc-921dba3e4056acfac3df83e1629ab22167889846.tar.gz |
Adapt to use shared INSTALL/DEINSTALL scripts by using the logic in
bsd.pkg.install.mk:
* Remove old DEINSTALL/INSTALL scripts.
* Move some text printed at POST-INSTALL time into the MESSAGE file.
* Adjust rc.d scripts to respect rc.conf settings, so that the
script may be directly copied into /etc/rc.d.
Diffstat (limited to 'mail/imp')
-rw-r--r-- | mail/imp/DEINSTALL | 117 | ||||
-rw-r--r-- | mail/imp/INSTALL | 79 | ||||
-rw-r--r-- | mail/imp/Makefile | 56 |
3 files changed, 34 insertions, 218 deletions
diff --git a/mail/imp/DEINSTALL b/mail/imp/DEINSTALL deleted file mode 100644 index 637f7db0914..00000000000 --- a/mail/imp/DEINSTALL +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# -# $NetBSD: DEINSTALL,v 1.1 2001/11/01 01:00:16 zuntum Exp $ - -PKGNAME=$1 -STAGE=$2 - -CAT="@CAT@" -CMP="@CMP@" -RM="@RM@" -RMDIR="@RMDIR@" -TRUE="@TRUE@" - -APACHE_SYSCONFDIR="@APACHE_SYSCONFDIR@" -SAMPLECONFDIR=${PKG_PREFIX}/share/examples/imp -CONFDIR=${APACHE_SYSCONFDIR} -IMPDIR=${PKG_PREFIX}/@IMPDIR@ - -CONFFILES=" ${IMPDIR}/config/defaults.php3 \ - ${IMPDIR}/config/ldap.php3 \ - ${IMPDIR}/config/servers.php3" -NONCONFFILES=" ${IMPDIR}/config/MOTD.html \ - ${IMPDIR}/config/header.txt \ - ${IMPDIR}/config/html.php3 \ - ${IMPDIR}/config/imp_module_config.php3 \ - ${IMPDIR}/config/lang.php3 \ - ${IMPDIR}/config/mailbox.php3 \ - ${IMPDIR}/config/menu.txt \ - ${IMPDIR}/config/mime.php3 \ - ${IMPDIR}/config/trailer.txt" - -case ${STAGE} in -DEINSTALL) - # Remove configuration files if they don't differ from the default - # config file. - # - FILE=${CONFDIR}/imp.conf - SAMPLEFILE=${SAMPLECONFDIR}/imp.conf - if ${CMP} -s ${FILE} ${SAMPLEFILE} - then - ${RM} -f ${FILE} - fi - for FILE in ${CONFFILES} ${NONCONFFILES} - do - SAMPLEFILE=${FILE}.dist - if ${CMP} -s ${FILE} ${SAMPLEFILE} - then - ${RM} -f ${FILE} - fi - done - ;; - -POST-DEINSTALL) - modified_files='' - for FILE in ${CONFDIR}/imp.conf ${CONFFILES} ${NONCONFFILES} - do - if [ -f ${FILE} ] - then - modified_files="${modified_files} ${FILE}" - fi - done - - ${RMDIR} ${IMPDIR}/config 2>/dev/null || ${TRUE} - ${RMDIR} ${IMPDIR} 2>/dev/null || ${TRUE} - ${RMDIR} ${CONFDIR} 2>/dev/null || ${TRUE} - - existing_dirs='' - for dir in ${IMPDIR} - do - if [ -d ${dir} ] - then - existing_dirs="${existing_dirs} ${dir}" - fi - done - - if [ -n "${modified_files}" -o -n "${existing_dirs}" ] - then - ${CAT} << EOF -=========================================================================== -If you won't be using ${PKGNAME} any longer, you may want to remove: -EOF - if [ -n "${modified_files}" ] - then - ${CAT} << EOF - - * the following files: - -EOF - for file in ${modified_files} - do - echo " ${file}" - done - fi - if [ -n "${existing_dirs}" ] - then - ${CAT} << EOF - - * the following directories: - -EOF - for dir in ${existing_dirs} - do - echo " ${dir}" - done - fi - ${CAT} << EOF -=========================================================================== -EOF - fi - ;; - -*) - echo "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/mail/imp/INSTALL b/mail/imp/INSTALL deleted file mode 100644 index 59d56707c9c..00000000000 --- a/mail/imp/INSTALL +++ /dev/null @@ -1,79 +0,0 @@ -#! /bin/sh -# -# $NetBSD: INSTALL,v 1.1 2001/11/01 01:00:17 zuntum Exp $ - -PKGNAME=$1 -STAGE=$2 - -CAT="@CAT@" -CHMOD="@CHMOD@" -CP="@CP@" - -APACHE_SYSCONFDIR="@APACHE_SYSCONFDIR@" -SAMPLECONFDIR=${PKG_PREFIX}/share/examples/imp -CONFDIR=${APACHE_SYSCONFDIR} -IMPDIR=${PKG_PREFIX}/@IMPDIR@ - -CONFFILES=" ${IMPDIR}/config/defaults.php3 \ - ${IMPDIR}/config/ldap.php3 \ - ${IMPDIR}/config/servers.php3" -NONCONFFILES=" ${IMPDIR}/config/MOTD.html \ - ${IMPDIR}/config/header.txt \ - ${IMPDIR}/config/html.php3 \ - ${IMPDIR}/config/imp_module_config.php3 \ - ${IMPDIR}/config/lang.php3 \ - ${IMPDIR}/config/mailbox.php3 \ - ${IMPDIR}/config/menu.txt \ - ${IMPDIR}/config/mime.php3 \ - ${IMPDIR}/config/prefs.php3 \ - ${IMPDIR}/config/trailer.txt" - -case ${STAGE} in -PRE-INSTALL) - ;; - -POST-INSTALL) - echo "Installing configuration files:" - FILE=${CONFDIR}/imp.conf - SAMPLEFILE=${SAMPLECONFDIR}/imp.conf - if [ -f ${FILE} ] - then - echo " ${FILE} already exists" - else - echo " ${FILE}" - ${CP} ${SAMPLEFILE} ${FILE} - ${CHMOD} 644 ${FILE} - fi - for FILE in ${CONFFILES} ${NONCONFFILES} - do - SAMPLEFILE=${FILE}.dist - if [ -f ${FILE} ] - then - echo " ${FILE} already exists" - else - echo " ${FILE}" - ${CP} ${SAMPLEFILE} ${FILE} - ${CHMOD} 644 ${FILE} - fi - done - ${CAT} << EOF - -=========================================================================== -Some files you might need to customize include the following: - -EOF - for FILE in ${CONFFILES} - do - echo " ${FILE}" - done - ${CAT} << EOF -=========================================================================== -EOF - ;; - -*) - echo "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/mail/imp/Makefile b/mail/imp/Makefile index 6f2d15982e8..da6608f1102 100644 --- a/mail/imp/Makefile +++ b/mail/imp/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2001/11/11 19:29:10 bouyer Exp $ +# $NetBSD: Makefile,v 1.14 2001/11/19 16:23:10 jlam Exp $ DISTNAME= imp-2.2.7 CATEGORIES= mail www @@ -11,11 +11,6 @@ COMMENT= Internet Messaging Program DEPENDS+= horde-1.2.7:../../www/horde DEPENDS+= php-imap>3.0.17:../../mail/php4-imap -NO_CONFIGURE= # defined - -DEINSTALL_FILE= ${WRKDIR}/DEINSTALL -INSTALL_FILE= ${WRKDIR}/INSTALL - DOCDIR= ${PREFIX}/share/doc/imp EGDIR= ${PREFIX}/share/examples/imp HORDEDIR= ${PREFIX}/share/horde @@ -25,26 +20,44 @@ MESSAGE_SUBST+= IMPDIR=${IMPDIR} .include "../../mk/bsd.prefs.mk" -APACHE_SYSCONFDIR?= ${LOCALBASE}/etc/httpd +APACHE_SYSCONFDIR?= ${CONFDIR}/httpd BUILD_DEFS+= APACHE_SYSCONFDIR MESSAGE_SUBST+= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR} -FILES_SUBST= IMPDIR=${IMPDIR:S/^${PREFIX}\///} -FILES_SUBST+= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR} -FILES_SUBST+= CAT=${CAT:Q} -FILES_SUBST+= CHMOD=${CHMOD:Q} -FILES_SUBST+= CMP=${CMP:Q} -FILES_SUBST+= CP=${CP:Q} -FILES_SUBST+= RM=${RM:Q} -FILES_SUBST+= RMDIR=${RMDIR:Q} -FILES_SUBST+= TRUE=${TRUE:Q} -FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} +CONF_FILES= ${EGDIR}/imp.conf ${APACHE_SYSCONFDIR}/imp.conf +CONF_FILES+= ${IMPDIR}/config/defaults.php3.dist \ + ${IMPDIR}/config/defaults.php3 +CONF_FILES+= ${IMPDIR}/config/ldap.php3.dist \ + ${IMPDIR}/config/ldap.php3 +CONF_FILES+= ${IMPDIR}/config/servers.php3.dist \ + ${IMPDIR}/config/servers.php3 +SUPPORT_FILES+= ${IMPDIR}/config/MOTD.html.dist \ + ${IMPDIR}/config/MOTD.html +SUPPORT_FILES+= ${IMPDIR}/config/header.txt.dist \ + ${IMPDIR}/config/header.txt +SUPPORT_FILES+= ${IMPDIR}/config/html.php3.dist \ + ${IMPDIR}/config/html.php3 +SUPPORT_FILES+= ${IMPDIR}/config/imp_module_config.php3.dist \ + ${IMPDIR}/config/imp_module_config.php3 +SUPPORT_FILES+= ${IMPDIR}/config/lang.php3.dist \ + ${IMPDIR}/config/lang.php3 +SUPPORT_FILES+= ${IMPDIR}/config/mailbox.php3.dist \ + ${IMPDIR}/config/mailbox.php3 +SUPPORT_FILES+= ${IMPDIR}/config/menu.txt.dist \ + ${IMPDIR}/config/menu.txt +SUPPORT_FILES+= ${IMPDIR}/config/mime.php3.dist \ + ${IMPDIR}/config/mime.php3 +SUPPORT_FILES+= ${IMPDIR}/config/prefs.php3.dist \ + ${IMPDIR}/config/prefs.php3 +SUPPORT_FILES+= ${IMPDIR}/config/trailer.txt.dist \ + ${IMPDIR}/config/trailer.txt +MAKE_DIRS= ${APACHE_SYSCONFDIR} post-extract: - cd ${WRKSRC}; \ + cd ${WRKSRC}; \ for file in \ - config/MOTD.html config/header.txt config/html.php3 \ - config/imp_module_config.php3 config/lang.php3 \ + config/MOTD.html config/header.txt config/html.php3 \ + config/imp_module_config.php3 config/lang.php3 \ config/mailbox.php3 config/menu.txt config/trailer.txt ; \ do \ ${MV} $${file} $${file}.dist; \ @@ -77,8 +90,6 @@ do-build: pre-install: ${SED} -e "s|@IMPDIR@|${IMPDIR}|g" \ ${FILESDIR}/imp.conf.dist > ${WRKDIR}/imp.conf.dist - ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} - ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE} PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL do-install: @@ -95,4 +106,5 @@ do-install: post-install: PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL +.include "../../mk/bsd.pkg.install.mk" .include "../../mk/bsd.pkg.mk" |