summaryrefslogtreecommitdiff
path: root/www/apache6
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-11-19 16:23:08 +0000
committerjlam <jlam@pkgsrc.org>2001-11-19 16:23:08 +0000
commitb23d2e86260aaa8ed2013bf77ad605b63e34b0ed (patch)
treed5fafec9bfc1b14f6b1c5da4d0c45beb2b4758b4 /www/apache6
parentc850f81b615ba9e58563fe40c1075ad3aea9ffa4 (diff)
downloadpkgsrc-b23d2e86260aaa8ed2013bf77ad605b63e34b0ed.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/apache6')
-rw-r--r--www/apache6/DEINSTALL112
-rw-r--r--www/apache6/INSTALL73
-rw-r--r--www/apache6/Makefile34
3 files changed, 14 insertions, 205 deletions
diff --git a/www/apache6/DEINSTALL b/www/apache6/DEINSTALL
deleted file mode 100644
index 43993420643..00000000000
--- a/www/apache6/DEINSTALL
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: DEINSTALL,v 1.1 2001/11/01 02:16:12 zuntum Exp $
-
-PKGNAME=$1
-STAGE=$2
-
-CAT="@CAT@"
-CMP="@CMP@"
-RM="@RM@"
-RMDIR="@RMDIR@"
-TRUE="@TRUE@"
-
-SERVERROOT="@APACHE_SYSCONFDIR@"
-DATADIR=${PKG_PREFIX}/share/httpd
-LOGDIR=/var/log/httpd
-SPOOLDIR=/var/spool/httpd
-SAMPLECONFDIR=${PKG_PREFIX}/share/examples/httpd
-CONFDIR=${SERVERROOT}
-CONFFILES="httpd.conf"
-NONCONFFILES="magic mime.types"
-
-case ${STAGE} in
-DEINSTALL)
- # Remove configuration files if they don't differ from the default
- # config file.
- #
- for file in ${CONFFILES} ${NONCONFFILES}
- do
- FILE=${CONFDIR}/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}.default
- if ${CMP} -s ${FILE} ${SAMPLEFILE}
- then
- ${RM} -f ${FILE}
- fi
- done
- ;;
-
-POST-DEINSTALL)
- modified_files=''
- for file in ${CONFFILES} ${NONCONFFILES}
- do
- FILE=${CONFDIR}/${file}
- if [ -f ${FILE} ]
- then
- modified_files="${modified_files} ${FILE}"
- fi
- done
-
- ${RMDIR} ${SPOOLDIR}/proxy 2>/dev/null || ${TRUE}
- ${RMDIR} ${SPOOLDIR} 2>/dev/null || ${TRUE}
- ${RMDIR} ${LOGDIR} 2>/dev/null || ${TRUE}
- ${RMDIR} ${DATADIR}/htdocs 2>/dev/null || ${TRUE}
- ${RMDIR} ${DATADIR} 2>/dev/null || ${TRUE}
- ${RMDIR} ${SERVERROOT}/ssl.prm 2>/dev/null || ${TRUE}
- ${RMDIR} ${SERVERROOT}/ssl.key 2>/dev/null || ${TRUE}
- ${RMDIR} ${SERVERROOT}/ssl.csr 2>/dev/null || ${TRUE}
- ${RMDIR} ${SERVERROOT}/ssl.crt 2>/dev/null || ${TRUE}
- ${RMDIR} ${SERVERROOT}/ssl.crl 2>/dev/null || ${TRUE}
- ${RMDIR} ${SERVERROOT} 2>/dev/null || ${TRUE}
-
- existing_dirs=''
- for dir in ${CONFDIR} ${LOGDIR} ${REQUESTDIR} ${DATADIR}
- 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/apache6/INSTALL b/www/apache6/INSTALL
deleted file mode 100644
index 87ae2dea8a6..00000000000
--- a/www/apache6/INSTALL
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: INSTALL,v 1.1 2001/11/01 02:16:12 zuntum Exp $
-
-PKGNAME=$1
-STAGE=$2
-
-CAT="@CAT@"
-CHMOD="@CHMOD@"
-CHOWN="@CHOWN@"
-CP="@CP@"
-MKDIR="@MKDIR@"
-
-SERVERROOT="@APACHE_SYSCONFDIR@"
-LOGDIR=/var/log/httpd
-SPOOLDIR=/var/spool/httpd
-SAMPLECONFDIR=${PKG_PREFIX}/share/examples/httpd
-CONFDIR=${SERVERROOT}
-CONFFILES="httpd.conf"
-NONCONFFILES="magic mime.types"
-
-case ${STAGE} in
-PRE-INSTALL)
- ;;
-
-POST-INSTALL)
- ${MKDIR} ${SERVERROOT}
- ${MKDIR} ${SERVERROOT}/ssl.crl
- ${MKDIR} ${SERVERROOT}/ssl.crt
- ${MKDIR} ${SERVERROOT}/ssl.csr
- ${MKDIR} ${SERVERROOT}/ssl.key
- ${MKDIR} ${SERVERROOT}/ssl.prm
- ${MKDIR} ${LOGDIR}
- ${MKDIR} ${SPOOLDIR}
- ${MKDIR} ${SPOOLDIR}/proxy
- ${CHOWN} nobody:nobody ${SPOOLDIR}/proxy
-
- echo "Installing configuration files:"
- for file in ${CONFFILES} ${NONCONFFILES}
- do
- FILE=${CONFDIR}/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}.default
- 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
- FILE=${CONFDIR}/${file}
- echo " ${FILE}"
- done
- ${CAT} << EOF
-===========================================================================
-EOF
- ;;
-
-*)
- echo "Unexpected argument: ${STAGE}"
- exit 1
- ;;
-esac
-exit 0
diff --git a/www/apache6/Makefile b/www/apache6/Makefile
index 8afb89fc35e..5a3ed3cf9ff 100644
--- a/www/apache6/Makefile
+++ b/www/apache6/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2001/10/22 18:10:28 jlam Exp $
+# $NetBSD: Makefile,v 1.43 2001/11/19 16:23:13 jlam Exp $
#
# This package does not compile in mod_ssl support hooks, as it conflicts
# with IPv6-enable patch.
@@ -46,8 +46,9 @@ BUILD_DEFS+= USE_INET6
IGNORE= "IPv6 only build"
.endif
-APACHE_SYSCONFDIR?= ${LOCALBASE}/etc/httpd
+APACHE_SYSCONFDIR?= ${CONFDIR}/httpd
BUILD_DEFS+= APACHE_SYSCONFDIR
+FILES_SUBST+= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR}
.if defined(APACHE_SUEXEC) && ${APACHE_SUEXEC} == YES
APACHE_USER?= www
@@ -103,23 +104,17 @@ BUILD_DEFS+= APACHE_CUSTOM_CFLAGS
BUILD_DEFS+= APACHE_PERF_TUNING
BUILD_DEFS+= APACHE_SUEXEC
-DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
-INSTALL_FILE= ${WRKDIR}/INSTALL
+EGDIR= ${PREFIX}/share/examples/httpd
-# Given foo=${bar}, replace @foo@ with ${bar}.
-#
-FILES_SUBST= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR}
-FILES_SUBST+= CAT=${CAT:Q}
-FILES_SUBST+= CHMOD=${CHMOD:Q}
-FILES_SUBST+= CHOWN=${CHOWN:Q}
-FILES_SUBST+= CMP=${CMP:Q}
-FILES_SUBST+= CP=${CP:Q}
-FILES_SUBST+= MKDIR=${MKDIR:Q}
-FILES_SUBST+= PREFIX=${PREFIX}
-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}/httpd.conf.default ${APACHE_SYSCONFDIR}/httpd.conf
+SUPPORT_FILES= ${EGDIR}/magic.default ${APACHE_SYSCONFDIR}/magic
+SUPPORT_FILES+= ${EGDIR}/mime.types.default ${APACHE_SYSCONFDIR}/mime.types
+RCD_SCRIPTS= ${PREFIX}/etc/rc.d/apache /etc/rc.d/apache
+
+MAKE_DIRS= ${APACHE_SYSCONFDIR}
+OWN_DIRS= /var/log/httpd
+OWN_DIRS+= /var/spool/httpd
+OWN_DIRS_PERMS+= /var/spool/httpd/proxy nobody nobody 0755
pre-patch:
${FIND} ${WRKSRC} -name '*.orig' -print | ${XARGS} ${RM} -f
@@ -149,8 +144,6 @@ pre-configure:
pre-install:
${FIND} ${WRKSRC}/htdocs -name '*.orig' -print | ${XARGS} ${RM} -f
${SED} ${FILES_SUBST_SED} ${FILESDIR}/apache.sh > ${WRKDIR}/apache.sh
- ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
- ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
post-install:
.if !defined(NOPIC)
@@ -168,4 +161,5 @@ post-install:
PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
.include "../../textproc/expat/buildlink.mk"
+.include "../../mk/bsd.pkg.install.mk"
.include "../../mk/bsd.pkg.mk"