diff options
author | Ying-Chieh Liao <ijliao@FreeBSD.org> | 2002-06-20 04:35:36 +0000 |
---|---|---|
committer | Ying-Chieh Liao <ijliao@FreeBSD.org> | 2002-06-20 04:35:36 +0000 |
commit | a6db5359801715d44a4bf9203f960cefb92dc073 (patch) | |
tree | a09f42fb60180eed490f4985d04f83649d529653 /www/apache13-fp | |
parent | Update to 1.2.6 (diff) |
handle unremoved files more properly
bump portrevision
PR: 39557
Submitted by: maintainer
Notes
Notes:
svn path=/head/; revision=61613
Diffstat (limited to 'www/apache13-fp')
-rw-r--r-- | www/apache13-fp/Makefile | 2 | ||||
-rw-r--r-- | www/apache13-fp/pkg-deinstall | 107 | ||||
-rw-r--r-- | www/apache13-fp/pkg-install | 6 | ||||
-rw-r--r-- | www/apache13-fp/pkg-plist | 4 |
4 files changed, 115 insertions, 4 deletions
diff --git a/www/apache13-fp/Makefile b/www/apache13-fp/Makefile index 6ff746f3edf3..1263c30c1ed9 100644 --- a/www/apache13-fp/Makefile +++ b/www/apache13-fp/Makefile @@ -8,7 +8,7 @@ PORTNAME= apache PKGNAMESUFFIX= _fp PORTVERSION= 1.3.26 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= http://www.apache.org/dist/httpd/ \ http://www.freebsd.org/gifs/ \ diff --git a/www/apache13-fp/pkg-deinstall b/www/apache13-fp/pkg-deinstall new file mode 100644 index 000000000000..bfe402316e80 --- /dev/null +++ b/www/apache13-fp/pkg-deinstall @@ -0,0 +1,107 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# Created by: hetzels@westbend.net + +PKG_USER=${PKG_USER:=www} +PKG_GROUP=${PKG_GROUP:=www} + +PKG_PREFIX=${PKG_PREFIX} +HOST_NAME=`/bin/hostname` + +AP_CGI=${PKG_PREFIX}/www/cgi-bin +AP_CONF=${PKG_PREFIX}/etc/apache +AP_DATA=${PKG_PREFIX}/www/data +AP_SHARE=${PKG_PREFIX}/share/doc/apache + +IMAGES_DIR=${AP_SHARE}/manual/images +IMAGES_VTI=${AP_DATA}/images/_vti_cnf + +remove_user() +{ + if [ ! -x /usr/sbin/pw ]; then + echo "*** Unable to remove the Apache user and group (${PKG_USER}/${PKG_GROUP})" + exit 69 + fi + + if pw usershow ${PKG_USER} -q > /dev/null; then + olduid=`pw show user ${PKG_USER} 2> /dev/null | cut -d: -f3` + oldgid=`pw show group ${PKG_GROUP} 2> /dev/null | cut -d: -f3` + if [ ${olduid} -ne 80 ]; then + echo "To delete Apache user permanently, use 'pw userdel ${PKG_USER}'" + fi + if [ ${oldgid} -ne 80 ]; then + echo "To delete Apache group permanently, use 'pw groupdel ${PKG_GROUP}'" + fi + fi +} + +remove_file() +{ + local source_dir=$1 + local target_dir=$2 + local file=$3 + local ret=1 + + if [ -f ${target_dir}/${file} ]; then + if cmp -s ${source_dir}/${file} ${target_dir}/${file} ; then + rm -f ${target_dir}/${file} + ret=0 + fi + fi + + return ${ret} +} + +remove_apache_doc_root () +{ + if [ -d ${AP_CGI} ]; then + for file in `ls ${AP_CGI}.default` + { + remove_file ${AP_CGI}.default ${AP_CGI} ${file} + } + fi + + if [ -d ${AP_DATA} ]; then + if [ -d ${AP_DATA}/images ] ; then + for file in apache_pb.gif fplogo.gif powerlogo.gif + { + if remove_file ${IMAGES_DIR} ${AP_DATA}/images ${file}; then + if [ -d ${IMAGES_VTI} -a -f ${IMAGES_VTI}/${file} ] ; then + rm ${IMAGES_VTI}/${file} + fi + fi + } + if [ -d ${IMAGES_VTI} ]; then + rmdir ${IMAGES_VTI} + fi + fi + + remove_file ${AP_SHARE} ${AP_DATA} index.html.en + fi +} + +remove_httpd_conf () +{ + if [ -f ${AP_CONF}/httpd.conf ] ; then + /bin/cat ${AP_CONF}/httpd.conf.default | \ + /usr/bin/sed -e 's;@@HOSTNAME@@;'${HOST_NAME}';' \ + > ${AP_CONF}/httpd.conf.tmp + if cmp -s ${AP_CONF}/httpd.conf ${AP_CONF}/httpd.conf.tmp ; then + rm -f ${AP_CONF}/httpd.conf + fi + rm ${AP_CONF}/httpd.conf.tmp + fi +} + +case $2 in + DEINSTALL) + remove_apache_doc_root + remove_httpd_conf + ;; + POST-DEINSTALL) + remove_user + ;; + +esac diff --git a/www/apache13-fp/pkg-install b/www/apache13-fp/pkg-install index 0d7a6d54f169..3d9aff03d26a 100644 --- a/www/apache13-fp/pkg-install +++ b/www/apache13-fp/pkg-install @@ -134,10 +134,10 @@ case $2 in create_user ;; POST-INSTALL) + create_apache_doc_root + fix_httpd_conf # If we are not in batch mode - if [ "${PKG_BATCH}" = "NO" ]; then - create_apache_doc_root - fix_httpd_conf + if [ "${PKG_BATCH}" = "NO" ]; then ${FPINSTALL} fix_frontpage_cnf comment_files diff --git a/www/apache13-fp/pkg-plist b/www/apache13-fp/pkg-plist index c2323199a6a2..80389d0981ef 100644 --- a/www/apache13-fp/pkg-plist +++ b/www/apache13-fp/pkg-plist @@ -1,3 +1,4 @@ +bin/checkgid bin/dbmmanage bin/htdigest bin/htpasswd @@ -645,7 +646,10 @@ www/icons/world2.png @dirrm share/doc/apache/manual/vhosts @dirrm share/doc/apache/manual @dirrm share/doc/apache +@dirrm www/cgi-bin @dirrm www/cgi-bin.default +@dirrm www/data/images +@dirrm www/data @dirrm www/icons/small @dirrm www/icons @dirrm www/proxy |