summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Fritsch <sf@debian.org>2009-05-22 17:17:35 +0000
committerStefan Fritsch <sf@sfritsch.de>2012-01-02 10:37:00 +0100
commita4a021fcdaf8f662f2d4cc4ca91da55b7c0b89b3 (patch)
tree961e1d449492268252fc02ed4bfd4c923819916b
parent1caef5f79da22efbbb5491dc69166a7472171070 (diff)
downloadapache2-a4a021fcdaf8f662f2d4cc4ca91da55b7c0b89b3.tar.gz
- using symlinks in /usr/share/doc is nice but requires special care on upgrade :-(
- while there, switch to dh 7 and refactor debian/rules a bit git-svn-id: svn+ssh://svn.debian.org/svn/pkg-apache/trunk/apache2@933 01b336ce-410b-0410-9a02-a0e7f243c266
-rw-r--r--debian/apache2-dbg.postinst18
-rw-r--r--debian/apache2-mpm-prefork.postinst32
-rw-r--r--debian/apache2.postinst20
-rw-r--r--debian/changelog2
-rw-r--r--debian/clean14
-rw-r--r--debian/compat2
-rw-r--r--debian/mpm-postinst-threaded32
-rw-r--r--debian/mpm-preinst-threaded30
-rw-r--r--debian/mpms.postinst48
-rw-r--r--debian/mpms.preinst (renamed from debian/apache2-mpm-prefork.preinst)0
-rwxr-xr-xdebian/rules48
11 files changed, 122 insertions, 124 deletions
diff --git a/debian/apache2-dbg.postinst b/debian/apache2-dbg.postinst
new file mode 100644
index 00000000..48e4d4fc
--- /dev/null
+++ b/debian/apache2-dbg.postinst
@@ -0,0 +1,18 @@
+#!/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 [ -d $DOCDIR ] ; then
+ rmdir $DOCDIR 2> /dev/null && ln -s apache2.2-bin $DOCDIR
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/apache2-mpm-prefork.postinst b/debian/apache2-mpm-prefork.postinst
deleted file mode 100644
index 808ebce9..00000000
--- a/debian/apache2-mpm-prefork.postinst
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ "$1" != "configure" ]; then
- exit 0
-fi
-
-#enable cgi, but only on new installs.
-if [ -z "$2" ]; then
- a2dismod cgid >/dev/null || true
- a2enmod cgi >/dev/null || echo "It looks like you've deleted /etc/apache2/mods-available/cgi.load, so cgi can not 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
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/apache2.postinst b/debian/apache2.postinst
new file mode 100644
index 00000000..cc7f9130
--- /dev/null
+++ b/debian/apache2.postinst
@@ -0,0 +1,20 @@
+#!/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 [ -d $DOCDIR ] ; then
+ rmdir $DOCDIR 2> /dev/null && ln -s apache2.2-common $DOCDIR
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/changelog b/debian/changelog
index 06c7aa8d..e31cde48 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ apache2 (2.2.11-5) UNRELEASED; urgency=low
Closes: #468690
- run multiple instances of apache with different MPMs. This configuration
is not supported in any way, though. Closes: #517572
+ * Switch to debhelper compatibility level 7 and remove some code duplication
+ in debian/rules.
* Override some Lintian warnings about old autotools helper files and being
not binNMUable (apache2 is not binNMUable anyway, because of the
apache2 <-> apache2-mpm-itk dependency).
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 00000000..14a111e8
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,14 @@
+debian/apache2-mpm-worker.postinst
+debian/apache2-mpm-worker.preinst
+debian/apache2-mpm-worker.prerm
+debian/apache2-mpm-worker.lintian-overrides
+debian/apache2-mpm-event.postinst
+debian/apache2-mpm-event.preinst
+debian/apache2-mpm-event.prerm
+debian/apache2-mpm-event.lintian-overrides
+debian/apache2-mpm-prefork.postinst
+debian/apache2-mpm-prefork.preinst
+debian/apache2-mpm-prefork.prerm
+debian/apache2-mpm-prefork.lintian-overrides
+debian/apache2-prefork-dev.postinst
+debian/apache2-threaded-dev.postinst
diff --git a/debian/compat b/debian/compat
index 7ed6ff82..7f8f011e 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+7
diff --git a/debian/mpm-postinst-threaded b/debian/mpm-postinst-threaded
deleted file mode 100644
index 8c708938..00000000
--- a/debian/mpm-postinst-threaded
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ "$1" != "configure" ]; then
- exit 0
-fi
-
-#enable cgid, but only on new installs.
-if [ -z "$2" ]; then
- a2dismod cgi >/dev/null || true
- a2enmod cgid >/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
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/mpm-preinst-threaded b/debian/mpm-preinst-threaded
deleted file mode 100644
index a097fd5d..00000000
--- a/debian/mpm-preinst-threaded
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh -e
-
-#Debian preinstall handling for apache2
-# Thom May <thom@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/mpms.postinst b/debian/mpms.postinst
new file mode 100644
index 00000000..d893dc7a
--- /dev/null
+++ b/debian/mpms.postinst
@@ -0,0 +1,48 @@
+#!/bin/sh
+set -e
+
+if [ "$1" != "configure" ]; then
+ exit 0
+fi
+
+P=xxx
+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 [ -d $DOCDIR ] ; then
+ rmdir $DOCDIR 2> /dev/null && ln -s apache2.2-common $DOCDIR
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/apache2-mpm-prefork.preinst b/debian/mpms.preinst
index a097fd5d..a097fd5d 100644
--- a/debian/apache2-mpm-prefork.preinst
+++ b/debian/mpms.preinst
diff --git a/debian/rules b/debian/rules
index 8b7b7ab4..69b0644b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -95,17 +95,11 @@ INSTALL=/usr/bin/install
clean: unpatch
dh_testdir
+ rm -rf $(BUILD) mpm-worker mpm-prefork mpm-event install
dh_clean
- rm -rf $(BUILD) mpm-worker mpm-prefork mpm-event install build-mpms
- rm -f debian/apache2-mpm-worker.postinst debian/apache2-mpm-worker.preinst debian/apache2-mpm-worker.prerm
- rm -f debian/apache2-mpm-event.postinst debian/apache2-mpm-event.preinst debian/apache2-mpm-event.prerm
- rm -f debian/apache2-mpm-prefork.prerm
- for i in `ls debian/icons/ | cut -d. -f1,2`; do \
- rm -f debian/tmp/usr/share/apache2/icons/$$i; \
- done
-build: patch-stamp build-mpms
-build-mpms: mpm-worker mpm-prefork mpm-event
+build: patch-stamp build-stamp
+build-stamp: patch-stamp mpm-worker mpm-prefork mpm-event
for mpm in prefork event ; do \
if ! diff -u $(BUILD)/$$mpm/mods.list $(BUILD)/worker/mods.list ; then \
echo Different modules built into httpd binaries, will not proceed ;\
@@ -115,24 +109,27 @@ build-mpms: mpm-worker mpm-prefork mpm-event
touch $@
-mpm-worker: patch-stamp
- dh_testdir
- mkdir -p $(BUILD)/worker
- cd $(BUILD)/worker ;\
- CFLAGS="$(AP2_CFLAGS)" LDFLAGS="$(AP2_LDFLAGS)" $(CONFFLAGS) $(REALCURDIR)/configure --srcdir=$(REALCURDIR) $(AP2_COMMON_CONFARGS) $(AP2_MODS_CONFARGS) --with-mpm=worker ;\
- $(MAKE) ;\
- ./apache2 -l |grep -v worker > mods.list
- touch $@
-
-mpm-%: patch-stamp
+mpm-worker mpm-prefork mpm-event: mpm-%: patch-stamp mpm-%.scripts-stamp
dh_testdir
mkdir -p $(BUILD)/$*
+ if [ $* = worker ] ; then \
+ ENABLE_MODULES="$(AP2_MODS_CONFARGS)" ;\
+ else \
+ ENABLE_MODULES=--enable-modules=none ;\
+ fi ;\
cd $(BUILD)/$* ;\
- CFLAGS="$(AP2_CFLAGS)" LDFLAGS="$(AP2_LDFLAGS)" $(CONFFLAGS) $(REALCURDIR)/configure --srcdir=$(REALCURDIR) $(AP2_COMMON_CONFARGS) --enable-modules=none --with-mpm=$* ;\
+ CFLAGS="$(AP2_CFLAGS)" LDFLAGS="$(AP2_LDFLAGS)" $(CONFFLAGS) $(REALCURDIR)/configure --srcdir=$(REALCURDIR) $(AP2_COMMON_CONFARGS) $$ENABLE_MODULES --with-mpm=$* ;\
$(MAKE) ;\
./apache2 -l |grep -v $* > mods.list
touch $@
+mpm-%.scripts-stamp: debian/mpms.postinst debian/mpms.preinst debian/mpms.prerm debian/mpms.lintian-overrides
+ for f in postinst preinst prerm; do \
+ perl -p -e s/P=xxx/P=apache2-mpm-$*/ < debian/mpms.$$f > debian/apache2-mpm-$*.$$f ;\
+ done
+ perl -p -e "s/^/apache2-mpm-$*: /" < debian/mpms.lintian-overrides > debian/apache2-mpm-$*.lintian-overrides
+ touch $@
+
install-%: mpm-%
dh_testdir
dh_testroot
@@ -160,6 +157,7 @@ install-dev: install-worker install-prefork
cp debian/apache2-mpm-$$i/usr/include/apache2/* debian/apache2-$$TARGET-dev/usr/include/apache2/ ;\
cp debian/apache2-mpm-$$i/usr/share/apache2/build/* debian/apache2-$$TARGET-dev/usr/share/apache2/build/ ;\
cp $(BUILD)/$$i/support/apxs debian/apache2-$$TARGET-dev/usr/bin/apxs2 ;\
+ perl -p -e s/^P=apache2/P=apache2-$${TARGET}-dev/ < debian/apache2.postinst > debian/apache2-$${TARGET}-dev.postinst ;\
done
# Clean up config_vars.mk
set -x ; for i in threaded prefork; do \
@@ -173,7 +171,7 @@ install-dev: install-worker install-prefork
mv tmp_config_vars.mk config_vars.mk ) ; \
done
-install-src: build-mpms
+install-src: build-stamp
dh_testdir
dh_testroot
dh_installdirs
@@ -209,7 +207,6 @@ install: build install-worker install-prefork install-common install-dev install
done
dh_install --list-missing --sourcedir=debian/tmp
-# --sourcedir=$(REALCURDIR)/debian/apache2.2-common
cp debian/bash_completion debian/apache2.2-common/etc/bash_completion.d/apache2.2-common
install -m755 debian/apache2.2-common.bug.script debian/apache2.2-common/usr/share/bug/apache2.2-common/script
@@ -258,12 +255,6 @@ install: build install-worker install-prefork install-common install-dev install
ln -s a2enmod debian/apache2.2-common/usr/sbin/a2ensite
ln -s a2enmod debian/apache2.2-common/usr/sbin/a2dissite
cp debian/default-index.html debian/apache2.2-common/usr/share/apache2/default-site/index.html
- for i in worker event; do \
- install -m755 debian/mpm-postinst-threaded debian/apache2-mpm-$$i.postinst ;\
- install -m755 debian/mpm-preinst-threaded debian/apache2-mpm-$$i.preinst;\
- install -m755 debian/mpms.prerm debian/apache2-mpm-$$i.prerm ;\
- done
- install -m755 debian/mpms.prerm debian/apache2-mpm-prefork.prerm
for i in worker prefork event; do \
rm -rf debian/apache2-mpm-$$i/ ;\
@@ -273,7 +264,6 @@ install: build install-worker install-prefork install-common install-dev install
ln -s /usr/lib/apache2/mpm-$$i/apache2 debian/apache2-mpm-$$i/usr/sbin/apache2 ;\
mkdir -p debian/apache2-mpm-$$i/usr/share/lintian/overrides ;\
mkdir -p debian/apache2-mpm-$$i/usr/share/bug/apache2-mpm-$$i ;\
- perl -p -e "s/^/apache2-mpm-$$i: /" < debian/mpms.lintian-overrides > debian/apache2-mpm-$$i/usr/share/lintian/overrides/apache2-mpm-$$i ;\
ln -s ../apache2.2-common/script debian/apache2-mpm-$$i/usr/share/bug/apache2-mpm-$$i ;\
done