Package: mod-wsgi
Followup-For: Bug #666818

I am attaching slightly updated patch which reflects the fact that the
{en,dis}mod directives are now handled and inserted into maintscripts
by dh_apache2.  (Alternative is to keep the handling in the package
and call the dh_apache2 with --no-script.)

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff --git a/debian/changelog b/debian/changelog
index 0c001f8..9c1adb7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mod-wsgi (3.4-2) experimental; urgency=low
+
+  * Add support for Apache 2.4 (Closes: #666818)
+
+ -- Ondřej Surý <ond...@debian.org>  Mon, 06 May 2013 20:08:43 +0200
+
 mod-wsgi (3.4-1) experimental; urgency=low
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index 11ac210..78672bd 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: httpd
 Priority: optional
 Maintainer: Debian Python Modules Team <python-modules-t...@lists.alioth.debian.org>
 Uploaders: Bernd Zeimetz <b...@debian.org>, Piotr Ożarowski <pi...@debian.org>
-Build-Depends: debhelper (>= 5), python-all-dev, python3-all-dev, apache2-threaded-dev
+Build-Depends: debhelper (>= 5), python-all-dev, python3-all-dev, apache2-dev
 Homepage: http://www.modwsgi.org/
 Standards-Version: 3.9.2
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/mod-wsgi/trunk/
@@ -11,8 +11,7 @@ Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/mod-wsgi/trun
 
 Package: libapache2-mod-wsgi
 Architecture: any
-Depends: apache2, apache2.2-common, ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
-Suggests: apache2-mpm-worker | apache2-mpm-event
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
 Provides: httpd-wsgi
 Description: Python WSGI adapter module for Apache
  The mod_wsgi adapter is an Apache module that provides a WSGI (Web Server
@@ -25,8 +24,7 @@ Description: Python WSGI adapter module for Apache
 
 Package: libapache2-mod-wsgi-py3
 Architecture: any
-Depends: apache2, apache2.2-common, ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}
-Suggests: apache2-mpm-worker | apache2-mpm-event
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}
 Conflicts: libapache2-mod-wsgi
 Provides: httpd-wsgi
 Description: Python 3 WSGI adapter module for Apache
diff --git a/debian/libapache2-mod-wsgi-py3.apache2 b/debian/libapache2-mod-wsgi-py3.apache2
new file mode 100644
index 0000000..2e60e9c
--- /dev/null
+++ b/debian/libapache2-mod-wsgi-py3.apache2
@@ -0,0 +1,2 @@
+mod debian/wsgi.load
+mod debian/wsgi.conf
diff --git a/debian/libapache2-mod-wsgi-py3.install b/debian/libapache2-mod-wsgi-py3.install
deleted file mode 100644
index bc46e11..0000000
--- a/debian/libapache2-mod-wsgi-py3.install
+++ /dev/null
@@ -1,2 +0,0 @@
-debian/wsgi.load etc/apache2/mods-available
-debian/wsgi.conf etc/apache2/mods-available
diff --git a/debian/libapache2-mod-wsgi-py3.postinst b/debian/libapache2-mod-wsgi-py3.postinst
index 8dbc0dd..c88539a 100644
--- a/debian/libapache2-mod-wsgi-py3.postinst
+++ b/debian/libapache2-mod-wsgi-py3.postinst
@@ -2,16 +2,6 @@
 
 set -e
 
-apache_force_reload() {
-    if apache2ctl configtest 2>/dev/null; then
-        #invoke-rc.d apache2 force-reload || true
-        # use "restart" as a workaround for bug #558608
-        invoke-rc.d apache2 restart || true
-    else
-        echo "Your apache2 configuration is broken, please fix it and restart apache2 manually."
-    fi
-}
-
 update_symlink() {
     wsgi_py=`readlink /usr/lib/apache2/modules/mod_wsgi.so | sed 's,.*-,,'`
     py3_default=`dpkg -s python3 | grep '^Version' | sed 's,Version: \([^.]*.[^.]*\).*,\1,'`
@@ -20,19 +10,7 @@ update_symlink() {
     fi
 }
 
-if [ -z "$2" ]; then
-    update_symlink
-    if [ -e /etc/apache2/apache2.conf ]; then
-        a2enmod wsgi >/dev/null || true
-        apache_force_reload
-    fi
-else
-    #we're upgrading
-    update_symlink
-    if [ -e /etc/apache2/mods-enabled/wsgi.load ]; then
-        apache_force_reload
-    fi
-fi
+update_symlink
 
 #DEBHELPER#
 
diff --git a/debian/libapache2-mod-wsgi-py3.prerm b/debian/libapache2-mod-wsgi-py3.prerm
deleted file mode 100644
index 7849723..0000000
--- a/debian/libapache2-mod-wsgi-py3.prerm
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
-    a2dismod wsgi || true
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/libapache2-mod-wsgi.apache2 b/debian/libapache2-mod-wsgi.apache2
new file mode 100644
index 0000000..2e60e9c
--- /dev/null
+++ b/debian/libapache2-mod-wsgi.apache2
@@ -0,0 +1,2 @@
+mod debian/wsgi.load
+mod debian/wsgi.conf
diff --git a/debian/libapache2-mod-wsgi.install b/debian/libapache2-mod-wsgi.install
deleted file mode 100644
index bc46e11..0000000
--- a/debian/libapache2-mod-wsgi.install
+++ /dev/null
@@ -1,2 +0,0 @@
-debian/wsgi.load etc/apache2/mods-available
-debian/wsgi.conf etc/apache2/mods-available
diff --git a/debian/libapache2-mod-wsgi.postinst b/debian/libapache2-mod-wsgi.postinst
index 23b0ec4..df3207f 100644
--- a/debian/libapache2-mod-wsgi.postinst
+++ b/debian/libapache2-mod-wsgi.postinst
@@ -2,16 +2,6 @@
 
 set -e
 
-apache_force_reload() {
-    if apache2ctl configtest 2>/dev/null; then
-        #invoke-rc.d apache2 force-reload || true
-        # use "restart" as a workaround for bug #558608
-        invoke-rc.d apache2 restart || true
-    else
-        echo "Your apache2 configuration is broken, please fix it and restart apache2 manually."
-    fi
-}
-
 update_symlink() {
     wsgi_py=`readlink /usr/lib/apache2/modules/mod_wsgi.so | sed 's,.*-,,'`
     py_default=`dpkg -s python | grep '^Version' | sed 's,Version: \([^.]*.[^.]*\).*,\1,'`
@@ -20,19 +10,7 @@ update_symlink() {
     fi
 }
 
-if [ -z "$2" ]; then
-    update_symlink
-    if [ -e /etc/apache2/apache2.conf ]; then
-        a2enmod wsgi >/dev/null || true
-        apache_force_reload
-    fi
-else
-    #we're upgrading
-    update_symlink
-    if [ -e /etc/apache2/mods-enabled/wsgi.load ]; then
-        apache_force_reload
-    fi
-fi
+update_symlink
 
 #DEBHELPER#
 
diff --git a/debian/libapache2-mod-wsgi.prerm b/debian/libapache2-mod-wsgi.prerm
deleted file mode 100644
index 7849723..0000000
--- a/debian/libapache2-mod-wsgi.prerm
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
-    a2dismod wsgi || true
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/rules b/debian/rules
index 748c0b7..a053398 100755
--- a/debian/rules
+++ b/debian/rules
@@ -61,6 +61,7 @@ binary-arch: build install
 	dh_installchangelogs 
 	dh_installdocs
 	dh_install
+	dh_apache2
 	install -d -m 755 debian/$(PACKAGE)/usr/share/python/runtime.d
 	install -d -m 755 debian/$(PACKAGE)-py3/usr/share/python3/runtime.d
 	install -m 755 debian/$(PACKAGE).rtupdate debian/$(PACKAGE)/usr/share/python/runtime.d/

Reply via email to