[libembperl-perl] 04/06: Update the way we configure Apache in version 2.4
Florian Schlichting
fsfs at moszumanska.debian.org
Tue Jan 28 23:03:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
fsfs pushed a commit to branch master
in repository libembperl-perl.
commit 23cf1b217aa82901b911321dd14aa3241b2f1a1e
Author: Florian Schlichting <fsfs at debian.org>
Date: Thu Aug 15 23:52:39 2013 +0200
Update the way we configure Apache in version 2.4
---
debian/README.Debian | 4 ++--
debian/libembperl-perl.postinst | 22 ++++++++++++++--------
debian/libembperl-perl.prerm | 12 ++++--------
debian/zembperl.load | 2 ++
4 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/debian/README.Debian b/debian/README.Debian
index 68494c9..364595e 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -6,8 +6,8 @@ Thread safety (and possible options)
NB: Embperl is not threadsafe and will not work with any of apache2's
threaded models in mod_perl mode. In Debian terms, if you want to
- use libembperl-perl with apache2 and mod_perl2, you must use the
- "apache2-mpm-prefork" apache2 package.
+ use libembperl-perl with apache2 and mod_perl2, you must enable the
+ prefork mpm.
If you are running a threaded flavor of Apache, or if you are using
any other webserver, you should run Embperl through the FastCGI-based
diff --git a/debian/libembperl-perl.postinst b/debian/libembperl-perl.postinst
index 4db7a79..3223cfd 100644
--- a/debian/libembperl-perl.postinst
+++ b/debian/libembperl-perl.postinst
@@ -4,14 +4,20 @@ set -e
#DEBHELPER#
-if [ "$1" = configure ]; then
- if [ -x /usr/sbin/a2enmod ]; then
- a2enmod zembperl || true
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d apache2 reload || true
- elif [ -x /usr/sbin/apache2ctl ]; then
- apache2ctl graceful || true
- fi
+if [ "$1" = "configure" ]; then
+ if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
+ . /usr/share/apache2/apache2-maintscript-helper
+
+ # mod_embperl is not thread-safe, requires the prefork MPM
+ if [ $(a2query -M) != 'prefork' ] ; then
+ if apache2_switch_mpm prefork ; then
+ apache2_invoke enmod zembperl
+ else
+ apache2_msg err "Could not switch to prefork, not enabling mod_embperl (you must use cgi or offline mode to use Embperl)"
+ fi
+ else
+ apache2_invoke enmod zembperl
+ fi
fi
fi
diff --git a/debian/libembperl-perl.prerm b/debian/libembperl-perl.prerm
index 06ea1ad..3799efd 100644
--- a/debian/libembperl-perl.prerm
+++ b/debian/libembperl-perl.prerm
@@ -4,14 +4,10 @@ set -e
#DEBHELPER#
-if [ "$1" = remove ]; then
- if [ -x /usr/sbin/a2dismod ]; then
- a2dismod zembperl || true
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d apache2 reload || true
- elif [ -x /usr/sbin/apache2ctl ]; then
- apache2ctl graceful || true
- fi
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+ if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
+ . /usr/share/apache2/apache2-maintscript-helper
+ apache2_invoke dismod zembperl
fi
fi
diff --git a/debian/zembperl.load b/debian/zembperl.load
index c085feb..22d9be6 100644
--- a/debian/zembperl.load
+++ b/debian/zembperl.load
@@ -1,5 +1,7 @@
# The sucky "zembperl" name is so we load after perl
+# Depends: perl
+
<IfModule mod_perl.c>
LoadModule embperl_module /usr/lib/perl5/auto/Embperl/Embperl.so
</IfModule>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libembperl-perl.git
More information about the Pkg-perl-cvs-commits
mailing list