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

Arno Töll debian at toell.net
Sat Feb 25 13:59:19 UTC 2012


The following commit has been merged in the next branch:
commit 9ba8bafe52afc5653c0aa63abe4796cdf73a3481
Author: Arno Töll <debian at toell.net>
Date:   Sat Feb 25 14:58:03 2012 +0100

    Properly handle bash_completion/apache2-common move
    
    * Rename debian/bash_completion/apache2-common -> debian/bash_completion/apache2
    * Do a proper transition of that file if we're upgrading
    * move owner of that package to apache2 (from apache2-data)
    * push standards to 3.9.3 (no special changes required)

diff --git a/debian/apache2-data.install b/debian/apache2-data.install
index 63b8e2d..332da2e 100644
--- a/debian/apache2-data.install
+++ b/debian/apache2-data.install
@@ -1,6 +1,5 @@
 /usr/share/apache2/icons/
 /usr/share/apache2/error/
-debian/bash_completion/apache2-common	/etc/bash_completion.d/
-debian/icons/*.png			/usr/share/apache2/icons
-/usr/sbin/envvars-std           	/usr/share/apache2/build
-debian/index.html			/usr/share/apache2/default-site/
+debian/icons/*.png		/usr/share/apache2/icons
+/usr/sbin/envvars-std           /usr/share/apache2/build
+debian/index.html		/usr/share/apache2/default-site/
diff --git a/debian/apache2.install b/debian/apache2.install
index 6c849c0..f66961e 100644
--- a/debian/apache2.install
+++ b/debian/apache2.install
@@ -1,4 +1,5 @@
-/etc/apache2		/usr/share/doc/apache2-doc/examples
-debian/config-dir/*	/etc/apache2
-debian/a2enmod		/usr/sbin
-debian/apache2ctl	/usr/sbin
+debian/bash_completion/apache2	/etc/bash_completion.d/
+/etc/apache2			/usr/share/doc/apache2-doc/examples
+debian/config-dir/*		/etc/apache2
+debian/a2enmod			/usr/sbin
+debian/apache2ctl		/usr/sbin
diff --git a/debian/apache2.postinst b/debian/apache2.postinst
index 6aecd2e..472d7ce 100755
--- a/debian/apache2.postinst
+++ b/debian/apache2.postinst
@@ -35,6 +35,7 @@ localized-error-pages
 other-vhosts-access-log
 security"
 
+MORE_MOVED_CONFFILES="/etc/bash_completion.d/apache2.2-common:/etc/bash_completion.d/apache2 "
 
 
 # the functions below need to be idempotent, however we guess the upgrade based
@@ -123,9 +124,21 @@ mv_conffiles()
 
 		if [ -d /etc/apache2/conf.d ] && [ "$(ls -A /etc/apache2/conf.d)" ]	; then
 			echo "Directory /etc/apache2/conf.d is not empty - leaving as is"
-			echo "Please note, that directory is considered obsolete and not read anymore by a standard apache2.conf file anymore"
+			echo "Please note, that directory is considered obsolete and not read anymore by default"
 		fi
 
+		for CONFFILE in $MORE_MOVED_CONFFILES ; do
+			OLDCONFFILE=$( echo "$CONFFILE" | cut -d: -f1 )
+			NEWCONFFILE=$( echo "$CONFFILE" | cut -d: -f2 )
+
+			rm -f $OLDCONFFILE.dpkg-remove
+			[ -e "$OLDCONFFILE" ] || return 0
+
+			echo "Preserving user changes to $NEWCONFFILE (renamed from $OLDCONFFILE)..."
+			mv -f "$NEWCONFFILE" "$NEWCONFFILE.dpkg-new"
+			mv -f "$OLDCONFFILE" "$NEWCONFFILE"
+
+		done
 	fi
 }
 
diff --git a/debian/apache2.postrm b/debian/apache2.postrm
index d176c5e..3446923 100644
--- a/debian/apache2.postrm
+++ b/debian/apache2.postrm
@@ -35,6 +35,8 @@ localized-error-pages
 other-vhosts-access-log
 security"
 
+MORE_MOVED_CONFFILES="/etc/bash_completion.d/apache2.2-common:/etc/bash_completion.d/apache2"
+
 
 case "$1" in
     purge)
@@ -73,6 +75,21 @@ case "$1" in
 		fi
 	done
 
+	for CONFFILE in $MORE_MOVED_CONFFILES ; do
+
+		CONFFILE=$( echo "$CONFFILE" | cut -d: -f1 )
+
+		if [ -e "$CONFFILE.dpkg-remove" ]; then
+			echo "Reinstalling $CONFFILE that was moved away"
+			mv "$CONFFILE.dpkg-remove" "$CONFFILE"
+		fi
+		if [ -e "$CONFFILE.dpkg-backup" ]; then
+			echo "Reinstalling $CONFFILE that was backupped"
+			mv "$CONFFILE.dpkg-backup" "$CONFFILE"
+		fi
+	done
+
+
         # post installation cleanup
         if [ -e /etc/apache2/.apache2_mpm_selected ] ; then
                 rm -f /etc/apache2/.apache2_mpm_selected
diff --git a/debian/apache2.preinst b/debian/apache2.preinst
index 9d75644..a1129b8 100644
--- a/debian/apache2.preinst
+++ b/debian/apache2.preinst
@@ -14,6 +14,9 @@ set -e
 # the debian-policy package
 
 
+# XXX: Whichever file you add in one of the sections below, make sure you copy
+# the same file arrays to apache2.postinst and apache2.postrm, too!
+
 OBSOLETE_CONFFILES="/etc/apache2/mods-available/authz_default.load
 /etc/apache2/mods-available/authn_default.load
 /etc/apache2/mods-available/mem_cache.load
@@ -33,6 +36,10 @@ localized-error-pages
 other-vhosts-access-log
 security"
 
+# conffiles which moved from one random location to another, separate source and
+# destionation by a colon
+MORE_MOVED_CONFFILES="/etc/bash_completion.d/apache2.2-common:/etc/bash_completion.d/apache2"
+
 
 obsolete_conffile_exists()
 {
@@ -74,8 +81,16 @@ prepare_rm_conffile()
 
 prepare_mv_conffile()
 {
-	for CONFFILE in $OBSOLETE_CONFFILES ; do
-		CONFFILE="/etc/apache2/conf.d/$CONFFILE"
+	for CONFFILE in $OBSOLETE_CONFFILES $MORE_MOVED_CONFFILES ; do
+
+		if [[ ! $CONFFILE == "/*" ]] ; then
+			CONFFILE="/etc/apache2/conf.d/$CONFFILE"
+
+		else
+			CONFFILE=$( echo "$CONFFILE" | cut -d: -f1 )
+		fi
+
+
 		[ -e "$CONFFILE" ] || return 0
 
 		local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
diff --git a/debian/bash_completion/apache2-common b/debian/bash_completion/apache2
similarity index 100%
rename from debian/bash_completion/apache2-common
rename to debian/bash_completion/apache2
diff --git a/debian/changelog b/debian/changelog
index fd72530..8c7a683 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,7 @@ apache2 (2.4.1-1) experimental; urgency=low
     + move cronjob and init script to debhelper configuration files
       (apache2.cron.daily and apache2.init respectively)
     + move man pages to debian/manpages
+  * Push standards version to 3.9.3 - no special changes required
   * Refactor binary packages, now as things simplified. MPMs are simple
     modules now, they can be bundled into the same binary package which do not
     need to conflict with each other. Thus, Apache now primarily consists of the
@@ -111,7 +112,7 @@ apache2 (2.4.1-1) experimental; urgency=low
 
   * Update bash completion functions to reflect the new site setup.
 
- -- Arno Töll <debian at toell.net>  Sat, 25 Feb 2012 03:07:24 +0100
+ -- Arno Töll <debian at toell.net>  Sat, 25 Feb 2012 13:36:18 +0100
 
 apache2 (2.2.22-1) unstable; urgency=low
 
diff --git a/debian/control b/debian/control
index f027935..791bb11 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 8.1.0~), lsb-release, dpkg-dev (>= 1.16.1~),
  libssl-dev (>= 0.9.8m), libcap-dev [linux-any],
  liblua5.1-0-dev, libxml2-dev, autotools-dev, gawk | awk
 Build-Conflicts: autoconf2.13
-Standards-Version: 3.9.2
+Standards-Version: 3.9.3
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-apache/apache2.git
 Vcs-Git: git://git.debian.org/git/pkg-apache/apache2.git
 Homepage: http://httpd.apache.org/

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



More information about the Pkg-apache-commits mailing list