From: Ben Hutchings Date: Wed, 11 Jan 2006 00:50:57 +0000 (+0000) Subject: Remove installation of Apache config fragment from rules. X-Git-Tag: 1.2-1~1 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=9fe157c794d245177a9eafb18595a67311ff64b8;p=memories.git Remove installation of Apache config fragment from rules. Add postinst script to add it to any Apache installation with mod_perl enabled. Add postrm script to remove it later. --- diff --git a/debian/memories.postinst b/debian/memories.postinst new file mode 100755 index 0000000..5393e1b --- /dev/null +++ b/debian/memories.postinst @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ "x$1" = xconfigure ]; then + + # Install our configuration fragment and make Apache load it + # (and unload any code from a previous version of Memories). + # Check whether mod_perl is enabled first. + for server in apache apache-perl apache-ssl; do + if [ "$(apache-modconf $server query mod_perl 2>/dev/null)" \ + = "mod_perl" -a \ + \! -e /etc/$server/conf.d/memories ]; then + ln -s ../../memories/apache.conf /etc/$server/conf.d/memories + invoke-rc.d $server force-reload + fi + done + # Module configuration is different in the apache2 package. + if [ -e /etc/apache2/mods-enabled/perl.load -a \ + \! -e /etc/apache2/conf.d/memories ]; then + ln -s ../../memories/apache.conf /etc/apache2/conf.d/memories + invoke-rc.d apache2 force-reload + fi + +fi diff --git a/debian/memories.postrm b/debian/memories.postrm new file mode 100755 index 0000000..0d3c14f --- /dev/null +++ b/debian/memories.postrm @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ "x$1" = xremove -o "x$1" = xpurge ]; then + # Flush out our configuration fragment and loaded code from Apache. + for server in apache apache-perl apache-ssl apache2; do + if [ -L /etc/$server/conf.d/memories ]; then + rm /etc/$server/conf.d/memories + invoke-rc.d $server force-reload + fi + done +fi diff --git a/debian/rules b/debian/rules index 2573375..348d96a 100755 --- a/debian/rules +++ b/debian/rules @@ -16,8 +16,6 @@ binary-indep : cp -dR templates debian/memories/etc/memories/ ln -s /etc/memories/Config.pm debian/memories/usr/share/perl5/Memories/ install debian/apache.conf debian/memories/etc/memories/ - install -d debian/memories/etc/apache/conf.d - ln -s ../../memories/apache.conf debian/memories/etc/apache/conf.d/memories install -d debian/memories/usr/share/memories install memories.sql tag_dates debian/memories/usr/share/memories/ install -d debian/memories/var/lib/memories