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

Arno Töll debian at toell.net
Wed Feb 29 23:07:36 UTC 2012


The following commit has been merged in the next branch:
commit 98784569efacc36d0d2b6fd73e00fecf07589110
Author: Arno Töll <debian at toell.net>
Date:   Thu Mar 1 00:01:41 2012 +0100

    * Rewrap overlong comments in debian/changelog
    * Reintroduce old Lintian overrides as far as they are still needed
    * Write lots of documentation for debhelper/dh_apache2
    * Fix a permission bug in debian/rules

diff --git a/debian/apache2.dirs b/debian/apache2.dirs
index 0332cb5..b5219b3 100644
--- a/debian/apache2.dirs
+++ b/debian/apache2.dirs
@@ -3,7 +3,6 @@ etc/apache2/conf-enabled
 etc/apache2/sites-enabled
 etc/logrotate.d
 usr/lib/cgi-bin
-usr/share/apache2
 usr/share/lintian/overrides
 var/cache/apache2
 var/cache/apache2/mod_cache_disk
diff --git a/debian/apache2.lintian-overrides b/debian/apache2.lintian-overrides
index b6d86b3..40060be 100644
--- a/debian/apache2.lintian-overrides
+++ b/debian/apache2.lintian-overrides
@@ -1 +1,2 @@
 non-standard-dir-perm var/log/apache2/ 0750 != 0755
+package-contains-empty-directory usr/lib/cgi-bin/
diff --git a/debian/changelog b/debian/changelog
index 410ff87..7bae121 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,13 +17,13 @@ apache2 (2.4.1-1) experimental; urgency=low
 
   * Refresh patches but leave all hunks unchanged where possible. Notable
     changes are:
-    + [AT] 202_suexec-custom: Keep functionality as is, but rewrite smaller parts of
-      the patch to build two binaries: suexec-pristine and suexec-custom (see
-      below)
-    + [AT] 201_build_suexec-custom: Patch the makefile to build "suexec-pristine"
-      instead. Aside of that, refresh hunks.
-    + [AT] 010_fhs_compliance: Drop config.layout patches. These have been applied
-      upstream
+    + [AT] 202_suexec-custom: Keep functionality as is, but rewrite smaller
+      parts of the patch to build two binaries: suexec-pristine and suexec-custom
+      (see below)
+    + [AT] 201_build_suexec-custom: Patch the makefile to build
+      "suexec-pristine" instead. Aside of that, refresh hunks.
+    + [AT] 010_fhs_compliance: Drop config.layout patches. These have been
+      applied upstream
     + [JMV] Drop patches:
       + 004_usr_bin_perl_0wnz_j00: printenv exemple doesn't refer to
         /usr/local/bin/perl anymore
@@ -139,7 +139,7 @@ apache2 (2.4.1-1) experimental; urgency=low
   * Migrate patches to DEP-3 format. For particular changes see the summary
     above.
 
- -- Arno Töll <debian at toell.net>  Wed, 29 Feb 2012 18:18:24 +0100
+ -- Arno Töll <debian at toell.net>  Wed, 29 Feb 2012 19:20:15 +0100
 
 apache2 (2.2.22-1) unstable; urgency=low
 
diff --git a/debian/debhelper/dh_apache2 b/debian/debhelper/dh_apache2
index 6ea6ab1..9285032 100755
--- a/debian/debhelper/dh_apache2
+++ b/debian/debhelper/dh_apache2
@@ -1,9 +1,52 @@
 #! /usr/bin/perl
 
+# dh_apache2 - Apache2 configuration elper for debhelper
+# Copyright (C) 2012 Arno Töll <debian at toell.net>
+#
+# This program is licensed at your choice under the terms of the GNU General
+# Public License vserion 2+ or under the terms of the Apache Software License
+# 2.0.
+#
+# For GPL-2+:
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#
+# For ASF 2.0:
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 use strict;
 use File::Find;
 use Debian::Debhelper::Dh_Lib;
 
+
+=head1 NAME
+
+dh_apache2 - register configuration snippets to the Apache web server
+
+=cut
+
+
 sub apache_api_version
 {
 	# TODO: replace me
@@ -30,6 +73,209 @@ sub apache_conf_installdir
 	return "etc/apache2/${type}-available/"
 }
 
+=head1 SYNOPSIS
+
+B<dh_apache2> [S<I<debhelper options>>] [S<B<--conditional>>=I<expression>] [B<--error-handler=>I<function>] [B<-n>|B<--noscripts>]
+
+=head1 DESCRIPTION
+
+B<dh_apache2> is a debhelper program that is responsible for correctly installing
+Apache2 configuration snippets and setting postinst, postrm and dependencies in
+Apache2 web server modules and web applications.
+
+It supports the following configuration types
+
+=over 4
+
+=item *
+Apache2 modules
+
+=item *
+Apache2 configuration snippets for web applications
+
+=item *
+Apache2 sites
+
+=back
+
+B<dh_apache2> supports two modes: A limited auto-configuration heuristic or
+alternatively a configuration file driven approach. If a file named
+debian/package.apache2 exists, actual actions are determined by that file.
+
+=head1 OPERATION MODES
+
+B<dh_apache2> can be used in two modes: A configuration file driven approach and
+a heuristic approach. The configuration driven mode is fully documented in the
+B<FILES> section below. This mode is activated by supplying a L<debhelper(7)>
+configuration file (e.g. debian/I<package>.apache2).
+
+The alternative is a heuristic mode, in which no files are installed through
+B<dh_apache2>. Instead the helper will scan the package installation directory
+for recognized files and guess their purpose depending on their installation
+path in the file system. Use with caution.
+
+=head1 INVOKATION
+
+B<dh_apache2> supports both, called directly from a debian/rules file or as
+L<dh(1)> addon. In the former case the helper should run after L<dh_install(1)>
+or their respective counter parts in local implementations at earliest.
+Alternatively it can be used as L<dh> addon by invoking it with
+
+  %:
+     dh $@ --with apache2
+
+=head1 FILES
+
+=over 4
+
+=item debian/I<package>.apache2
+
+=item debian/apache2
+
+=back
+
+Lists files to be registered with the Apache 2 HTTP server. The file is
+interpreted as line separated list of installation stanzas, where each entry
+consists of whitespace separated values conforming to the file semantics below.
+
+=head2 FILE SEMANTICS
+
+Each line consists of a triple
+
+I<type> I<file> [I<arguments>]
+
+where the values are interpreted as follows:
+
+
+=head3 I<type>
+
+Denotes the type of file to be installed. Recognized values are B<conf>
+for Apache2 global configuration snippets, B<site> for virtual host
+configurations and B<mod> for Apache2 modules.
+
+=head3 I<file>
+
+Is interpreted as existing file name within the source package. No path
+expansion is effectuated. Just like L<dh_install(1)>, B<dh_apache2> can not
+rename files.
+
+=head3 I<arguments>
+
+Is inrerpreted as optional arguments if any, currently used by B<conf>
+stanzas only
+
+=head2 GLOBAL CONFIGURATION FILES
+
+Global configuration files (determined by hte B<conf> type) must have a I<.conf>
+suffix and are installed to I</etc/apache2/conf-available>. Moreover, the
+configuration is activated in the maintainer script at installation time.
+
+Such global configuration snippets are supposed to be used by web applications.
+Such stanzas accept an optional third I<arguments> which is interpreted as
+dependency line of alternative web servers the package supports. See I<EXAMPLES>
+below.
+
+B<dh_apache2> will set dependencies in B<${misc:Recommends]> accordingly when
+this type of configuration is found. Alternatives from the optional [I<argument>
+is incorporated into this dependency line.
+
+=head2 SITE CONFIGURATION FILES
+
+Site configuration files (determined by hte B<site> type) must have a I<.conf>
+suffix and are installed to I</etc/apache2/sites-available>. Moreover, the
+configuration is activated in the maintainer script at installation time.
+
+Such global configuration snippets are supposed to be used by web applications
+and third party packages which install virtual host configurations. This type of
+configuration sets the same dependencies as configuration files.
+
+=head2 MODULES
+
+Modules are handled specially and are determined by the B<mod> type. Modules can
+either have a I<.conf> or I<.load> suffix. In that case the file is interpreted
+as module load file or module configuration file and installed to
+I</etc/apache2/mods-available>. If the file is ending with a I<.so>
+suffix it is interpreted as module shared object and installed to the Apache
+modules directory. Moreover, if a I<.load> file is installed the configuration
+is activated in the maintainer script at installation time.
+
+A typical module configuration has two lines, one for the I<.load> file, and one
+for the I<.so> file, albeit the latter could be installed by upstream's
+makefile, too.
+
+B<dh_apache2> will set dependencies in B<${misc:Depends]> accordingly when
+this type of configuration is found.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--error-handler=>I<function>
+
+Call the named shell I<function> if running the init script fails. The
+function should be provided in the F<prerm> and F<postinst> scripts, before the
+B<#DEBHELPER#> token.
+
+=item S<B<--conditional>>=I<expression>
+
+Only execute maintainer scripts if the supplied I<expression> evaluates to a
+true value at installation time. This is useful to web applications which want
+to install Apache configuration files depending on a user input, for example if
+they interface to the user through L<debconf(1)>.
+
+Defaults to B<true> and is subject to shell expansion (see Debian bug #660794).
+The expression should be provided in the postrm and postinst scripts before the
+B<#DEBHELPER#> token.
+
+=item B<-n>, B<--noscripts>
+
+Do not modify F<postinst>/F<postrm>/F<prerm> maintainer scripts.
+
+
+=back
+
+=head1 NOTES
+
+Note that this command is not idempotent. L<dh_prep(1)> should be called
+between invocations of this command. Otherwise, it may cause multiple
+instances of the same text to be added to maintainer scripts.
+
+=head1 EXAMPLES
+
+The examples below lists valid entries for a debian/I<package>.apache2 file. For
+example, the two lines below install a fictional I<mod_foo> Apache module along
+a Debian specific I<.load> file:
+
+ conf src/foo/mod_foo.so
+ conf debian/foo.load
+
+The example below installs a fictional web application called phpmyfoo supplied
+in a package which also supports Lighttpd and nginx:
+
+ conf debian/phpmyfoo.conf lighttpd (>= 1.4.30) | nginx-full
+
+Or, the same example again this time without support for other web servers:
+
+ conf debian/phpmyfoo.conf
+
+As a final example, install a module called I<mod_foo> along with a site
+configuration for a fictional site configuration for the site I<example.com>:
+
+ conf src/foo/mod_foo.so
+ conf debian/foo.load
+ conf debian/foo.conf
+ site debian/example_com.conf
+
+=head1 AUTHOR
+
+This manual and L<dh_apache2> was written by Arno Toell <debian at toell.net>.
+
+=cut
+
+
+##
+## main code starts here
+##
 
 init(options => {
 	"conditional=s" => \$dh{CONDITIONAL},
diff --git a/debian/old-apache2-dbg.postinst b/debian/old-apache2-dbg.postinst
deleted file mode 100644
index 33c94e4..0000000
--- a/debian/old-apache2-dbg.postinst
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ "$1" != "configure" ]; then
-        exit 0
-fi
-
-P=apache2-dbg
-if dpkg --compare-versions "$2" lt 2.2.11-5~ ; then
-	DOCDIR=/usr/share/doc/$P
-	if [ ! -h $DOCDIR -a -d $DOCDIR ] ; then
-		rmdir $DOCDIR 2> /dev/null && ln -s apache2.2-bin $DOCDIR
-	fi
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/old-apache2-doc.postinst b/debian/old-apache2-doc.postinst
deleted file mode 100644
index 8b95b3b..0000000
--- a/debian/old-apache2-doc.postinst
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh -e
-
-if [ -x "/etc/init.d/apache2" ]; then
-        if [ -x /usr/sbin/invoke-rc.d ]; then
-                invoke-rc.d apache2 reload ||true
-        else
-                /etc/init.d/apache2 reload ||true
-        fi
-fi
-
-#DEBHELPER#
diff --git a/debian/old-apache2.2-common.lintian-overrides b/debian/old-apache2.2-common.lintian-overrides
deleted file mode 100644
index 3b69060..0000000
--- a/debian/old-apache2.2-common.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-apache2.2-common: setuid-binary usr/lib/apache2/suexec 4754 root/www-data
-apache2.2-common: non-standard-dir-perm var/log/apache2/ 0750 != 0755
-apache2.2-common: package-contains-empty-directory usr/lib/cgi-bin/
diff --git a/debian/old-apache2.postinst b/debian/old-apache2.postinst
deleted file mode 100644
index 1dc45ea..0000000
--- a/debian/old-apache2.postinst
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ "$1" != "configure" ]; then
-        exit 0
-fi
-
-# postinst for apache2, apache2-prefork-dev, apache2-threaded-dev
-
-P=apache2
-if dpkg --compare-versions "$2" lt 2.2.11-5~ ; then
-	DOCDIR=/usr/share/doc/$P
-	if [ ! -h $DOCDIR -a -d $DOCDIR ] ; then
-		rmdir $DOCDIR 2> /dev/null && ln -s apache2.2-common $DOCDIR
-	fi
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/old-mpms.postinst b/debian/old-mpms.postinst
deleted file mode 100644
index 657c7a7..0000000
--- a/debian/old-mpms.postinst
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ "$1" != "configure" ]; then
-        exit 0
-fi
-
-P=apache2-mpm-MPMXXX
-if [ $P = apache2-mpm-prefork ] || [ $P = apache2-mpm-itk ]; then
-	CGI_DIS=cgid
-	CGI_EN=cgi
-else
-	CGI_DIS=cgi
-	CGI_EN=cgid
-fi
-
-#enable cgi/cgid, but only on new installs.
-if [ -z "$2" ]; then
-	a2dismod $CGI_DIS >/dev/null || true
-	a2enmod  $CGI_EN  >/dev/null || echo "It looks like you've deleted /etc/apache2/mods-available/cgid.load, so mod_cgid cannot be enabled.  To fix this, please purge and reinstall apache2.2-common."
-fi
-
-# Migrate our kill symlinks, including ones the user may have done an s/S/K/ to:
-for i in `seq 0 6`; do
-	if [ -L /etc/rc"$i".d/K91apache2 ]; then
-		mv /etc/rc"$i".d/K91apache2 \
-		   /etc/rc"$i".d/K09apache2
-	fi
-done
-
-if [ -x "/etc/init.d/apache2" ]; then
-        if [ -x /usr/sbin/invoke-rc.d ]; then
-                invoke-rc.d apache2 start ||true
-        else
-                /etc/init.d/apache2 start ||true
-        fi
-fi
-
-if dpkg --compare-versions "$2" lt 2.2.11-5~ ; then
-	DOCDIR=/usr/share/doc/$P
-	if [ ! -h $DOCDIR -a -d $DOCDIR ] ; then
-		rmdir $DOCDIR 2> /dev/null && ln -s apache2.2-common $DOCDIR
-	fi
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/old-mpms.preinst b/debian/old-mpms.preinst
deleted file mode 100644
index a097fd5..0000000
--- a/debian/old-mpms.preinst
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh -e
-
-#Debian preinstall handling for apache2
-# Thom May <thom at debian.org>
-
-if [ "$2" ] && dpkg --compare-versions "$2" lt 2.2; then
-    if [ -x "/etc/init.d/apache2" ]; then
-        if [ -x /usr/sbin/invoke-rc.d ]; then
-                invoke-rc.d apache2 stop || true
-        else
-                /etc/init.d/apache2 stop || true
-        fi
-    fi
-    chmod -x /usr/sbin/apache2
-fi
-
-case "$1" in
-	install)
-		rm -f /var/cache/apache2/reload
-		;;
-	upgrade)
-		if [ -d /var/cache/apache2 ]; then
-			touch /var/cache/apache2/reload
-		fi
-		;;
-	*)
-		;;
-esac
-
-#DEBHELPER#
diff --git a/debian/old-mpms.prerm b/debian/old-mpms.prerm
deleted file mode 100644
index 2324ecb..0000000
--- a/debian/old-mpms.prerm
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh -e
-
-# Apache2 prerm
-# Thom May <thom at debian.org>
-
-case "$1" in
-        upgrade|remove)
-		if [ -x "/etc/init.d/apache2" ]; then
-			if [ -x /usr/sbin/invoke-rc.d ]; then
-				invoke-rc.d apache2 stop || true
-			else
-				/etc/init.d/apache2 stop || true
-			fi
-		fi
-		sleep 2
-        ;;
-        deconfigure|failed-upgrade)
-        ;;
-        *)
-                echo "prerm called with unknown argument \`$1'" >&2
-                exit 1
-        ;;
-esac
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/rules b/debian/rules
index 6b493fd..228fe8c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -77,7 +77,7 @@ override_dh_fixperms:
 	# configurable suexec
 	chmod 4754 debian/apache2-suexec-custom/usr/lib/apache2/suexec-custom
 	chgrp www-data debian/apache2-suexec-custom/usr/lib/apache2/suexec-custom
-	dh_fixperms -Xusr/lib/apache2/suexec
+	dh_fixperms -Xusr/lib/apache2/suexec-custom -Xusr/lib/apache2/suexec-pristine
 	chown -R www-data:www-data debian/apache2/var/cache/apache2
 	chown root:adm debian/apache2/var/log/apache2
 	chmod o-rx debian/apache2/var/log/apache2

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



More information about the Pkg-apache-commits mailing list