[Python-modules-commits] r24580 - in packages/libapache2-mod-python/trunk/debian (9 files)

adejong at users.alioth.debian.org adejong at users.alioth.debian.org
Sun May 26 21:47:50 UTC 2013


    Date: Sunday, May 26, 2013 @ 21:47:48
  Author: adejong
Revision: 24580

  * Build with Apache 2.4 (closes: #666796):
    - use dh_apache2 (remove postinst and prerm)
    - 20_apache24.patch: fixes for Apache 2.4.

Added:
  packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.apache2
  packages/libapache2-mod-python/trunk/debian/patches/20_apache24.patch
Modified:
  packages/libapache2-mod-python/trunk/debian/changelog
  packages/libapache2-mod-python/trunk/debian/control
  packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.install
  packages/libapache2-mod-python/trunk/debian/patches/series
  packages/libapache2-mod-python/trunk/debian/rules
Deleted:
  packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postinst
  packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.prerm

Modified: packages/libapache2-mod-python/trunk/debian/changelog
===================================================================
--- packages/libapache2-mod-python/trunk/debian/changelog	2013-05-26 21:07:17 UTC (rev 24579)
+++ packages/libapache2-mod-python/trunk/debian/changelog	2013-05-26 21:47:48 UTC (rev 24580)
@@ -22,11 +22,14 @@
     not supporting upgrades from etch.
   * Update watch file provided by Bart Martens.
   * Update to Standards-Version 3.9.4.
+  * Build with Apache 2.4 (closes: #666796):
+    - use dh_apache2 (remove postinst and prerm)
+    - 20_apache24.patch: fixes for Apache 2.4.
 
   [ Jakub Wilk ]
   * Use canonical URIs for Vcs-* fields.
 
- -- Arthur de Jong <adejong at debian.org>  Sun, 26 May 2013 22:09:43 +0200
+ -- Arthur de Jong <adejong at debian.org>  Sun, 26 May 2013 23:47:16 +0200
 
 libapache2-mod-python (3.3.1-9) unstable; urgency=low
 

Modified: packages/libapache2-mod-python/trunk/debian/control
===================================================================
--- packages/libapache2-mod-python/trunk/debian/control	2013-05-26 21:07:17 UTC (rev 24579)
+++ packages/libapache2-mod-python/trunk/debian/control	2013-05-26 21:47:48 UTC (rev 24580)
@@ -4,7 +4,7 @@
 Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
 Uploaders: Robert S. Edmonds <edmonds at debian.org>
 Build-Depends: debhelper (>= 9), dh-autoreconf, python-dev (>= 2.6.6-3~),
- apache2-threaded-dev
+ dh-apache2, apache2-dev (>> 2.4~)
 X-Python-Version: 2.7
 Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/libapache2-mod-python/trunk/
 Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/libapache2-mod-python/trunk/
@@ -13,7 +13,7 @@
 
 Package: libapache2-mod-python
 Architecture: any
-Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}, apache2.2-common, apache2
+Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
 Suggests: libapache2-mod-python-doc
 Description: Python-embedding module for Apache 2
  The mod_python module supports web applications written in Python.

Added: packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.apache2
===================================================================
--- packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.apache2	                        (rev 0)
+++ packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.apache2	2013-05-26 21:47:48 UTC (rev 24580)
@@ -0,0 +1,2 @@
+mod debian/tmp/usr/lib/apache2/modules/mod_python.so
+mod debian/python.load

Modified: packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.install
===================================================================
--- packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.install	2013-05-26 21:07:17 UTC (rev 24579)
+++ packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.install	2013-05-26 21:47:48 UTC (rev 24580)
@@ -1,3 +1 @@
-debian/python.load etc/apache2/mods-available/
-usr/lib/apache2/modules/mod_python.so
 usr/lib/python2*

Deleted: packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postinst
===================================================================
--- packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postinst	2013-05-26 21:07:17 UTC (rev 24579)
+++ packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postinst	2013-05-26 21:47:48 UTC (rev 24580)
@@ -1,41 +0,0 @@
-#!/bin/sh
-set -e
-
-#DEBHELPER#
-
-reload_apache()
-{
-	if apache2ctl configtest 2>/dev/null; then
-		if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-			invoke-rc.d apache2 force-reload || exit $?
-		else
-			/etc/init.d/apache2 force-reload || exit $?
-		fi
-	else
-		echo "Your apache2 configuration is broken, so we're not restarting it for you."
-	fi
-}
-
-PYTHON_LOAD=/etc/apache2/mods-enabled/python.load
-
-# Inspired in libapache2-mod-php5.postinst
-
-if [ "$1" = "configure" -a -n "$2" ]; then
-	# Upgrading from a previous version. Only restart apache
-	# if the python mod is enabled
-	if [ -e $PYTHON_LOAD ]; then
-		reload_apache
-	fi
-	exit 0
-fi
-
-
-if [ "$1" = "configure" ]; then
-	# Not upgrading from a previous version, enable the module
-	if [ -e /etc/apache2/apache2.conf ]; then
-		a2enmod python >/dev/null || true
-		reload_apache
-	fi
-fi
-
-exit 0

Deleted: packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.prerm
===================================================================
--- packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.prerm	2013-05-26 21:07:17 UTC (rev 24579)
+++ packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.prerm	2013-05-26 21:47:48 UTC (rev 24580)
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = remove ] || [ "$1" = purge ]; then
-	if [ -e /etc/apache2/apache2.conf ] && [ -x /usr/sbin/a2dismod ]; then
-		a2dismod python || true
-	fi
-fi
-
-#DEBHELPER#
-
-exit 0

Added: packages/libapache2-mod-python/trunk/debian/patches/20_apache24.patch
===================================================================
--- packages/libapache2-mod-python/trunk/debian/patches/20_apache24.patch	                        (rev 0)
+++ packages/libapache2-mod-python/trunk/debian/patches/20_apache24.patch	2013-05-26 21:47:48 UTC (rev 24580)
@@ -0,0 +1,93 @@
+Description: Changes to build with Apache 2.4
+ This is a patch of minimal changes to compile mod_python with Apace 2.4.
+ Changes mostly based around:
+ http://httpd.apache.org/docs/2.4/developer/new_api_2_4.html
+ .
+ This does not change any internal properties that mod_python exposes
+ (e.g. it still exposes remote_ip while Apache internally now uses
+ client_ip).
+ .
+ This currently breaks the Request.requires() Python method which will now
+ always return an empty tuple because the function was not rewritten to
+ not use ap_requires() which is no longer available. The above API changes
+ document contains some pointers on what should be done.
+Author: Arthur de Jong <adejong at debian.org>
+Bug-Debian: http://bugs.debian.org/666796
+
+--- a/src/mod_python.c
++++ b/src/mod_python.c
+@@ -561,8 +561,8 @@ static apr_status_t init_mutexes(server_
+ 
+ #if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
+             if  (!geteuid()) {
+-                chown(fname, unixd_config.user_id, -1);
+-                unixd_set_global_mutex_perms(mutex[n]);
++                chown(fname, ap_unixd_config.user_id, -1);
++                ap_unixd_set_global_mutex_perms(mutex[n]);
+             }
+ #endif
+         }
+--- a/src/serverobject.c
++++ b/src/serverobject.c
+@@ -191,7 +191,7 @@ static struct PyMemberDef server_rec_mbr
+     {"server_hostname",    T_STRING,  OFF(server_hostname)},
+     {"port",               T_SHORT,   OFF(port)},
+     {"error_fname",        T_STRING,  OFF(error_fname)},
+-    {"loglevel",           T_INT,     OFF(loglevel)},
++    {"loglevel",           T_INT,     OFF(log.level)},
+     {"is_virtual",         T_INT,     OFF(is_virtual)},
+     /* XXX implement module_config ? */
+     /* XXX implement lookup_defaults ? */
+@@ -288,7 +288,9 @@ static PyObject *getmakeobj(serverobject
+ 
+ static PyObject *my_generation(serverobject *self, void *objname)
+ {
+-    return PyInt_FromLong((long)ap_my_generation);
++    int mpm_generation = 0;
++    ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation);
++    return PyInt_FromLong((long)mpm_generation);
+ }
+ 
+ static PyObject *restart_time(serverobject *self, void *objname)
+--- a/src/connobject.c
++++ b/src/connobject.c
+@@ -287,7 +287,7 @@ static struct memberlist conn_memberlist
+     /* XXX client_socket? */
+     {"local_addr",         T_OBJECT,    0,                       RO},
+     {"remote_addr",        T_OBJECT,    0,                       RO},
+-    {"remote_ip",          T_STRING,    OFF(remote_ip),          RO},
++    {"remote_ip",          T_STRING,    OFF(client_ip),          RO},
+     {"remote_host",        T_STRING,    OFF(remote_host),        RO},
+     {"remote_logname",     T_STRING,    OFF(remote_logname),     RO},
+     {"aborted",            T_INT,       0,                       RO},
+@@ -415,7 +415,7 @@ static PyObject * conn_getattr(connobjec
+         return makesockaddr(self->conn->local_addr);
+     }
+     else if (strcmp(name, "remote_addr") == 0) {
+-        return makesockaddr(self->conn->remote_addr);
++        return makesockaddr(self->conn->client_addr);
+     }
+     else if (strcmp(name, "notes") == 0) {
+         Py_INCREF(self->notes);
+--- a/src/requestobject.c
++++ b/src/requestobject.c
+@@ -1222,7 +1222,11 @@ static PyObject *req_register_cleanup(re
+ 
+ static PyObject * req_requires(requestobject *self)
+ {
++    /* Because we don't have an idea how to do this with Apache 2.4
++       just return an empty result for now. */
++    return Py_BuildValue("()");
+ 
++#ifdef COMMENTED_OUT_BECAUSE_NOT_WORKING_WITH_APACHE_24
+     /* This function returns everything specified after the "requires"
+        as is, without any attempts to parse/organize because
+        "requires" args only need to be grokable by mod_auth if it is
+@@ -1257,6 +1261,7 @@ static PyObject * req_requires(requestob
+     _PyTuple_Resize(&result, ti);
+ 
+     return result;
++#endif /* COMMENTED_OUT_BECAUSE_NOT_WORKING_WITH_APACHE_24 */
+ }
+ 
+ /**

Modified: packages/libapache2-mod-python/trunk/debian/patches/series
===================================================================
--- packages/libapache2-mod-python/trunk/debian/patches/series	2013-05-26 21:07:17 UTC (rev 24579)
+++ packages/libapache2-mod-python/trunk/debian/patches/series	2013-05-26 21:47:48 UTC (rev 24580)
@@ -3,3 +3,4 @@
 04_autoconf_python_multiarch.patch
 05_fix_spelling.patch
 10_bts521965.patch
+20_apache24.patch

Modified: packages/libapache2-mod-python/trunk/debian/rules
===================================================================
--- packages/libapache2-mod-python/trunk/debian/rules	2013-05-26 21:07:17 UTC (rev 24579)
+++ packages/libapache2-mod-python/trunk/debian/rules	2013-05-26 21:47:48 UTC (rev 24580)
@@ -5,7 +5,7 @@
 PYTHON=$(shell pyversions -d)
 
 %:
-	dh $@ --with autoreconf,python2
+	dh $@ --with autoreconf,python2,apache2
 
 override_dh_auto_configure:
 	dh_auto_configure -- --with-apxs=/usr/bin/apxs2 --with-python=$(PYTHON)




More information about the Python-modules-commits mailing list