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 /www/apc-gui | |
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 'www/apc-gui')
-rw-r--r-- | www/apc-gui/DEINSTALL | 102 | ||||
-rw-r--r-- | www/apc-gui/INSTALL | 63 | ||||
-rw-r--r-- | www/apc-gui/Makefile | 33 |
3 files changed, 8 insertions, 190 deletions
diff --git a/www/apc-gui/DEINSTALL b/www/apc-gui/DEINSTALL deleted file mode 100644 index 7595a08d594..00000000000 --- a/www/apc-gui/DEINSTALL +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -# -# $NetBSD: DEINSTALL,v 1.2 2001/11/05 07:44:49 jlam Exp $ - -PKGNAME=$1 -STAGE=$2 - -CAT="@CAT@" -CMP="@CMP@" -ECHO="@ECHO@" -RM="@RM@" -RMDIR="@RMDIR@" -TR="@TR@" -TRUE="@TRUE@" - -APACHE_SYSCONFDIR=@APACHE_SYSCONFDIR@ -APC_GUI_DIR=${PKG_PREFIX}/@APC_GUI_DIR@ -SAMPLECONFDIR=${PKG_PREFIX}/share/examples/@PKGBASE@ - -CONFFILES=" \ - ${SAMPLECONFDIR}/apc_gui.conf ${APACHE_SYSCONFDIR}/apc_gui.conf : \ - /dev/null ${APC_GUI_DIR}/apc_config_local.php \ - " - -case ${STAGE} in -DEINSTALL) - # Remove configuration files if they don't differ from the default - # config file. - # - ${ECHO} ${CONFFILES} | ${TR} ":" "\012" | while read SAMPLEFILE FILE - do - if ${CMP} -s ${FILE} ${SAMPLEFILE} - then - ${RM} -f ${FILE} - fi - done - ;; - -POST-DEINSTALL) - modified_files='' - for FILE in ${CONFFILES} - do - if [ -f ${FILE} ] - then - modified_files="${modified_files} ${FILE}" - fi - done - - ${RMDIR} ${APC_GUI_DIR} 2>/dev/null || ${TRUE} - ${RMDIR} ${APACHE_SYSCONFDIR} 2>/dev/null || ${TRUE} - - existing_dirs='' - for dir in ${APC_GUI_DIR} ${APACHE_SYSCONFDIR} - 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/www/apc-gui/INSTALL b/www/apc-gui/INSTALL deleted file mode 100644 index 40494591944..00000000000 --- a/www/apc-gui/INSTALL +++ /dev/null @@ -1,63 +0,0 @@ -#! /bin/sh -# -# $NetBSD: INSTALL,v 1.2 2001/11/05 07:47:48 jlam Exp $ - -PKGNAME=$1 -STAGE=$2 - -CAT="@CAT@" -CHMOD="@CHMOD@" -CP="@CP@" -ECHO="@ECHO@" -MKDIR="@MKDIR@" -TR="@TR@" - -APACHE_SYSCONFDIR=@APACHE_SYSCONFDIR@ -APC_GUI_DIR=${PKG_PREFIX}/@APC_GUI_DIR@ -SAMPLECONFDIR=${PKG_PREFIX}/share/examples/@PKGBASE@ - -CONFFILES=" \ - ${SAMPLECONFDIR}/apc_gui.conf ${APACHE_SYSCONFDIR}/apc_gui.conf : \ - /dev/null ${APC_GUI_DIR}/apc_config_local.php \ - " - -case ${STAGE} in -PRE-INSTALL) - ;; - -POST-INSTALL) - ${MKDIR} ${APACHE_SYSCONFDIR} - - ${ECHO} "Installing configuration files:" - ${ECHO} ${CONFFILES} | ${TR} ":" "\012" | while read SAMPLEFILE FILE - do - if [ -f ${FILE} ] - then - ${ECHO} " ${FILE} already exists" - else - ${ECHO} " ${FILE}" - ${CP} ${SAMPLEFILE} ${FILE} - ${CHMOD} 644 ${FILE} - fi - done - ${CAT} << EOF - -=========================================================================== -You may wish to customize the following files: - -EOF - ${ECHO} ${CONFFILES} | ${TR} ":" "\012" | while read SAMPLEFILE FILE - do - ${ECHO} " ${FILE}" - done - ${CAT} << EOF -=========================================================================== -EOF - ;; - -*) - ${ECHO} "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/www/apc-gui/Makefile b/www/apc-gui/Makefile index 70b7edc7349..d96e6601e43 100644 --- a/www/apc-gui/Makefile +++ b/www/apc-gui/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1.1.1 2001/10/29 19:35:04 jlam Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/19 16:23:14 jlam Exp $ DISTNAME= apc_gui-1.0.3 PKGNAME= ${DISTNAME:S/_/-/} @@ -14,7 +14,7 @@ DEPENDS+= php-gd>=4.0.1:../../graphics/php4-gd NO_BUILD= YES -APACHE_SYSCONFDIR?= ${LOCALBASE}/etc/httpd +APACHE_SYSCONFDIR?= ${CONFDIR}/httpd BUILD_DEFS+= APACHE_SYSCONFDIR MESSAGE_SUBST+= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR} @@ -23,37 +23,19 @@ EGDIR= ${PREFIX}/share/examples/${PKGBASE} PLIST_SUBST+= PKGBASE=${PKGBASE} MESSAGE_SUBST+= APC_GUI_DIR=${APC_GUI_DIR} -PLIST_SUBST+= PKGBASE=${PKGBASE} - -DEINSTALL_FILE= ${WRKDIR}/DEINSTALL -INSTALL_FILE= ${WRKDIR}/INSTALL - -FILES_SUBST= APC_GUI_DIR=${APC_GUI_DIR:S/^${PREFIX}\///} -FILES_SUBST+= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR} -FILES_SUBST+= PREFIX=${PREFIX} -FILES_SUBST+= PKGBASE=${PKGBASE} -FILES_SUBST+= CAT=${CAT:Q} -FILES_SUBST+= CHMOD=${CHMOD:Q} -FILES_SUBST+= CMP=${CMP:Q} -FILES_SUBST+= CP=${CP:Q} -FILES_SUBST+= ECHO=${ECHO:Q} -FILES_SUBST+= MKDIR=${MKDIR:Q} -FILES_SUBST+= RM=${RM:Q} -FILES_SUBST+= RMDIR=${RMDIR:Q} -FILES_SUBST+= TR=${TR:Q} -FILES_SUBST+= TRUE=${TRUE:Q} -FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} +CONF_FILES= ${EGDIR}/apc_gui.conf ${APACHE_SYSCONFDIR}/apc_gui.conf +CONF_FILES+= /dev/null ${APC_GUI_DIR}/apc_config_local.php +MAKE_DIRS= ${APACHE_SYSCONFDIR} +OWN_DIRS= ${APC_GUI_DIR} pre-install: ${SED} ${FILES_SUBST_SED} ${FILESDIR}/apc_gui.conf.dist \ > ${WRKDIR}/apc_gui.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: ${INSTALL_DATA_DIR} ${APC_GUI_DIR} ${EGDIR} - cd ${WRKDIR}; ${INSTALL_DATA} apc_gui.conf.dist \ + cd ${WRKDIR}; ${INSTALL_DATA} apc_gui.conf.dist \ ${EGDIR}/apc_gui.conf ${CP} -R ${WRKSRC}/* ${APC_GUI_DIR} ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${APC_GUI_DIR} @@ -62,4 +44,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" |