X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=debian%2Fmemories.postinst;h=1d32509e0884da70265d866630020cfa466884af;hb=873b88d64b580485bd29c734b444a1e555892a3a;hp=5393e1b56046c303276e435a2713bac315d1a245;hpb=9fe157c794d245177a9eafb18595a67311ff64b8;p=memories.git diff --git a/debian/memories.postinst b/debian/memories.postinst index 5393e1b..1d32509 100755 --- a/debian/memories.postinst +++ b/debian/memories.postinst @@ -1,23 +1,29 @@ #!/bin/sh +#DEBHELPER# + 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 mod_perl and mod_apreq are installed, ensure our configuration + # fragment is installed and make Apache (re)load the configuration + # and application. 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 + -e /etc/apache2/mods-enabled/apreq.load -a \ + -f /usr/share/perl5/Apache2/Upload.pm ]; then + if [ \! -e /etc/apache2/conf.d/memories ]; then + ln -s ../../memories/apache.conf /etc/apache2/conf.d/memories + fi invoke-rc.d apache2 force-reload fi + # Disable integration with now-unsupported Apache 1.x. + for server in apache apache-perl apache-ssl; do + if [ -L /etc/$server/conf.d/memories ]; then + rm /etc/$server/conf.d/memories + if [ -f /etc/init.d/$server ]; then + invoke-rc.d $server force-reload + fi + fi + done + fi