[Pkg-apache-commits] [SCM] Debian packaging for apache2 (Apache HTTPD 2.x) branch, next, updated. 0d8605a039852a9303bf5394566490baef400f73

Arno Töll debian at toell.net
Fri Mar 2 20:57:07 UTC 2012


The following commit has been merged in the next branch:
commit bff23bc9a661d540478869d45eaa6271a6918026
Author: Arno Töll <debian at toell.net>
Date:   Fri Mar 2 18:07:53 2012 +0100

    * Drop obsolete maintainer scripts from 2.2
    * Implement some purge logic in postrm
    * Write a NEWS entry
    * Implement a trap door function in postrm
    * Move mod_disk_cache -> mod_cache_disk

diff --git a/debian/NEWS b/debian/NEWS
index c0c6285..35bfb76 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -1,3 +1,37 @@
+apache2 (2.4.1-1) experimental; urgency=low
+
+  This package introduces a new major release of the Apache HTTP server. It is
+  likely the site configuration needs changes to work with this release. Notable
+  changes which need special care are:
+
+  The authorization and authentication system changed. Existing configurations
+  using deprecated Order/Allow/Deny directives should be upgraded to the new
+  system. Please review upstream's "Authentication, Authorization and Access
+  Control Howto" [1]. Existing configurations can load the "mod_access_compat"
+  module for compatibility with 2.2 configurations by loading
+
+  a2enmod access_compat
+
+  Furthermore, MPMs are simple modules now. Thus, the MPM can be changed anytime
+  by (un-)loading a specific module. Note the ITK MPM is not available anymore.
+  Be careful when upgrading. An example of changing the MPM is given below
+
+  a2dismod mpm_worker
+  a2enmod mpm_prefork
+
+  Morevoer, the configuration mechanism in Debian changed. All configurations
+  in sites-enabled and conf-enabled need a ".conf" suffix now. The latter was
+  transitioned from the deprecated /etc/apache2/conf.d/ directory which is not
+  supported anymore and works just like {sites,mods}-{available,enabled} by
+  using the "a2enconf" tool. The upgrade tries to migrate known configuration
+  files from /etc/apache2/conf.d/ to /etc/apache2/conf-available/ - please
+  review this changes. In addition, the default site was renamed to
+  "000-default.conf" to avoid naming confusions.
+
+  [1] http://httpd.apache.org/docs/2.4/howto/auth.html
+
+ -- Arno Töll <debian at toell.net>  Fri, 02 Mar 2012 17:38:23 +0100
+
 apache2 (2.2.15-4) unstable; urgency=low
 
   * Note to people using mod_proxy as forward proxy, i.e. with
diff --git a/debian/apache2.postinst b/debian/apache2.postinst
index 476ac9e..5cc2f57 100755
--- a/debian/apache2.postinst
+++ b/debian/apache2.postinst
@@ -234,8 +234,10 @@ refresh_modules()
                                 echo "disable obsolete module $module"
                                 a2dismod -q $module
 
-				# XXX enable cache_disk if the user had
-				# disk_cache enabled
+				if [ $module = "disk_cache" ] ; then
+					echo "Enable cache_disk as disk_cache was enabled in Apache 2.2"
+					a2enmod -q cache_disk
+				fi
                         fi
                         # the module is already enabled, however
                         # dependencies could have changed hence re-call
@@ -268,9 +270,28 @@ move_httpd_conf()
 	fi
 }
 
-#XXX: Move /var/cache/apache2/mod_disk_cache to /var/cache/apache2/mod_cache_disk?
+migrate_data()
+{
+	#XXX enable mod_cache_disk?
+	if we_are_upgrading_from_squeeze $@ ; then
+		# /var/cache/apache2/mod_disk_cache -> /var/cache/apache2/mod_cache_disk
+		if [ -d /var/cache/apache2/mod_disk_cache ] && [ "$(ls -A /var/cache/apache2/mod_disk_cache)" ] ; then
+			echo "Migrate mod_disk_cache cache data to /var/cache/apache2/mod_cache_disk/"
+			mv /var/cache/apache2/mod_disk_cache/* /var/cache/apache2/mod_cache_disk/
+			rmdir /var/cache/apache2/mod_disk_cache
+		fi
+	fi
+}
+
 #XXX: Deal with the sites-available/sites-enabled *.conf transition, e.g. rename
-#     all files which look like site configuration? 
+#     all files which look like site configuration?
+#XXX: Re-enable modules which were enabled in 2.2 but aren't in 2.4 so far:
+#      autoindex env mime negotiation setenvif status auth_basic deflate
+#      authz_default authz_user authz_groupfile authn_file
+#     n.b. most of these modules are loaded as dependency if a module.conf file
+#     demands it.
+
+
 
 case "$1" in
         configure)
@@ -284,6 +305,7 @@ case "$1" in
 		enable_default_conf $@
                 install_default_site $@
 		move_httpd_conf $@
+		migrate_data $@
 
                 # post installation cleanup
                 if [ -e /etc/apache2/.apache2_mpm_selected ] ; then
diff --git a/debian/apache2.postrm b/debian/apache2.postrm
index d8076c6..c7a85ac 100644
--- a/debian/apache2.postrm
+++ b/debian/apache2.postrm
@@ -41,9 +41,39 @@ MOVED_CONFFILES="/etc/bash_completion.d/apache2.2-common:/etc/bash_completion.d/
 case "$1" in
     purge)
 
+	# back to the future - yay!
+	if [ -x /etc/apache2/our_future_ourselves_thinks_we_are_crazy ] ; then
+		if  /etc/apache2/our_future_ourselves_thinks_we_are_crazy $@ ; then
+			return
+		fi
+	fi
+
         for CONFFILE in $OBSOLETE_CONFFILES ; do
                 rm -f "$CONFFILE.dpkg-bak" "$CONFFILE.dpkg-remove" "$CONFFILE.dpkg-backup"
         done
+
+	for d in var/cache/apache2 \
+		 var/cache/apache2/mod_cache_disk \
+		 var/log/apache2 ; do
+		[ -d $d ] && rm -rf $d
+	done
+
+
+	for f in /etc/apache2/sites-enabled/* \
+		/etc/apache2/conf-enabled/* \
+		/etc/apache2/mods-enabled/* ; do
+		[ -L "$f" ] && rm -f "$f"
+	done
+
+	for d in /etc/apache2/sites-enabled/ \
+		/etc/apache2/mods-enabled/ \
+		/etc/apache2/conf-enabled/ \
+		/etc/apache2 \
+		/var/cache/apache2 ; do
+		rmdir $d 2> /dev/null || true
+	done
+
+	#XXX: index.html is intentionally(?) left back
     ;;
 
     abort-install|abort-upgrade)
diff --git a/debian/old-apache2.2-common.postinst b/debian/old-apache2.2-common.postinst
deleted file mode 100644
index 8714e8b..0000000
--- a/debian/old-apache2.2-common.postinst
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/sh -e
-
-if [ "$1" != "configure" ]; then
-        exit 0
-fi
-
-mod_is_enabled() {
-    test -L /etc/apache2/mods-enabled/$1.load
-}
-
-#set up default site and dummy error and access logs
-if [ -z "$2" ]; then
-        if [ ! -L /etc/apache2/sites-enabled/000-default -a \
-             ! -f /etc/apache2/sites-enabled/000-default ]; then
-                a2ensite -q default
-        fi
-        touch /var/log/apache2/error.log /var/log/apache2/access.log
-        chown root:adm /var/log/apache2/error.log /var/log/apache2/access.log
-        chmod 0640 /var/log/apache2/error.log /var/log/apache2/access.log
-fi
-
-# Note, this line catches new installs as well as upgrades
-if dpkg --compare-versions "$2" lt 2.2.3-3.1; then
-	a2enmod -q alias
-	a2enmod -q autoindex
-	a2enmod -q dir
-	a2enmod -q env
-	a2enmod -q mime
-	a2enmod -q negotiation
-	a2enmod -q setenvif
-	a2enmod -q status
-	a2enmod -q auth_basic
-	a2enmod -q deflate
-
-        # Those come from mod_auth:
-	a2enmod -q authz_default
-	a2enmod -q authz_user
-	a2enmod -q authz_groupfile
-	a2enmod -q authn_file
-        
-	# This comes from mod_access:
-	a2enmod -q authz_host
-
-fi
-
-if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.2.15-4~ ; then
-	echo activating new config files ...
-	for a in ldap proxy_balancer proxy_ftp ; do 
-		if mod_is_enabled $a && [ ! -e /etc/apache2/mods-enabled/$a.conf ] ; then
-			a2enmod -q $a
-		fi
-	done
-	echo " done."
-fi
-
-# Note, this line catches new installs as well as upgrades
-if dpkg --compare-versions "$2" lt 2.2.7-1~0; then
-	if [ ! -e /var/www/index.html  -a \
-	     ! -h /var/www/index.html  -a \
-	     ! -e /var/www/index.cgi   -a \
-	     ! -e /var/www/index.pl    -a \
-	     ! -e /var/www/index.php   -a \
-	     ! -e /var/www/index.xhtml -a \
-	     ! -e /var/www/index.htm ] ; then
-		cp /usr/share/apache2/default-site/index.html /var/www/index.html
-	fi
-fi
-
-# DavLockDB format change
-if dpkg --compare-versions "$2" lt 2.2.14-3~; then
-	rm -f /var/lock/apache2/DAVLock.dir /var/lock/apache2/DAVLock.pag
-fi
-
-# Note, this line catches new installs as well as upgrades
-if dpkg --compare-versions "$2" lt 2.2.15-1~0; then
-	a2enmod -q reqtimeout
-fi
-
-# The definition of other_vhost_access.log has been moved.
-# Disable the new definition if the admin has changed the old
-# one (as determined by preinst).
-if [ -e /etc/apache2/disable-other-vhost-access-log.dpkg-apache2.2-common ] ; then
-	echo "Disabling /etc/apache2/conf.d/other-vhosts-access-log"
-	perl -p -i -e 's/^(CustomLog.*)$/#$1/' /etc/apache2/conf.d/other-vhosts-access-log
-	rm  /etc/apache2/disable-other-vhost-access-log.dpkg-apache2.2-common
-fi
-
-rm -f /etc/apache2/ports.conf.dpkg-apache2.2-common.old
-rm -f /etc/default/apache2.dpkg-apache2.2-common.old
-rm -f /etc/apache2/conf.d/charset.dpkg-apache2.2-common.old
-
-[ -f /etc/apache2/httpd.conf ] || touch /etc/apache2/httpd.conf
-
-#DEBHELPER#
-
-exit 0
-
diff --git a/debian/old-apache2.2-common.postrm b/debian/old-apache2.2-common.postrm
deleted file mode 100644
index fb4a853..0000000
--- a/debian/old-apache2.2-common.postrm
+++ /dev/null
@@ -1,79 +0,0 @@
-#! /bin/sh
-
-set -e
-
-# Allow apache 2.4 to override what we do.
-if [ -x /etc/apache2/upgrade-to-2.4-in-progress ] ; then
-	set +e
-	/etc/apache2/upgrade-to-2.4-in-progress $0 "$@"
-	ret=$?
-	set -e
-	case $ret in
-	42)
-		exit 0
-		;;
-	43)
-		DONT_PURGE=1
-		;;
-	0)
-		: # do nothing
-		;;
-	*)
-		exit $ret
-		;;
-	esac
-fi
-
-
-if [ "$1" = purge -a "$DONT_PURGE" != 1 ] ; then
-	rm -f 	/etc/apache2/httpd.conf \
-		/var/cache/apache2/reload \
-		/var/log/apache2/access.log* \
-		/var/log/apache2/other_vhosts_access.log* \
-		/var/log/apache2/error.log*
-	
-	rm -rf 	/var/cache/apache2/proxy \
-		/var/cache/apache2/mod_cache_disk \
-		/var/run/apache2 \
-		/var/lock/apache2
-
-	for f in /etc/apache2/sites-enabled/* \
-		 /etc/apache2/mods-enabled/* ; do
-		[ -L "$f" ] && rm -f "$f" 
-	done
-	
-	for d in /etc/apache2/sites-enabled/ \
-		/etc/apache2/mods-enabled/ \
-		/etc/apache2/conf.d \
-		/etc/apache2 \
-		/var/log/apache2 \
-		/var/cache/apache2 ; do
-		rmdir $d 2> /dev/null || true
-	done
-
-fi
-
-restore_conffile() {
-	if [ -e $1.dpkg-apache2.2-common.old ] ; then
-		echo Restoring previous version of $1 ...
-		mv $1.dpkg-apache2.2-common.old $1
-	fi
-}
-
-if [ "$1" = abort-upgrade ] ; then
-	restore_conffile /etc/default/apache2
-	restore_conffile /etc/apache2/ports.conf
-	restore_conffile /etc/apache2/conf.d/charset
-fi
-
-if [ "$1" = remove ] ; then
-	MD5SUM="`md5sum /var/www/index.html 2>/dev/null | cut -d ' ' -f 1`"
-	case "$MD5SUM" in
-		5388f60d7695cb57b87c799ee62d20b2|\
-		21dde95d9d269cbb2fa6560309dca40c)
-			rm -f /var/www/index.html
-			;;
-	esac
-fi
-
-#DEBHELPER#
diff --git a/debian/old-apache2.2-common.preinst b/debian/old-apache2.2-common.preinst
deleted file mode 100644
index 03daca9..0000000
--- a/debian/old-apache2.2-common.preinst
+++ /dev/null
@@ -1,28 +0,0 @@
-#! /bin/sh -e
-
-mv_conffile() {
-	if [ "`md5sum $1 2>/dev/null | cut -d ' ' -f 1`" = "$2" ] ; then
-		echo Replacing $1 with new version ...
-		mv $1 $1.dpkg-apache2.2-common.old
-	fi
-}
-
-if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.2.4-2; then
-	mv_conffile /etc/default/apache2 	9ac83f9132b78c3aa6dd4d7a583bf476
-	mv_conffile /etc/default/apache2 	801eb5156368b54d92ecb578ce710836
-	mv_conffile /etc/apache2/ports.conf	d5fcefc335117f400d451de47efeca87
-	mv_conffile /etc/apache2/conf.d/charset 641239a7d2d172856cb1413a47d2e142
-fi
-
-if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.2.15-4~ ; then
-	# The definition of other_vhosts_access.log has been moved from
-	# apache2.conf to conf.d/other-vhosts-access-log. If the admin has
-	# removed it from apache2.conf, mark it to be disabled in
-	# conf.d/other-vhosts-access-log in the postinst.
-	if ! egrep -q '^ *CustomLog.*other_vhosts_access.log vhost_combined$' /etc/apache2/apache2.conf
-	then
-		touch /etc/apache2/disable-other-vhost-access-log.dpkg-apache2.2-common
-	fi
-fi
-
-#DEBHELPER#

-- 
Debian packaging for apache2 (Apache HTTPD 2.x)



More information about the Pkg-apache-commits mailing list