Legoktm has submitted this change and it was merged.

Change subject: Handle the apache config using dh_apache2
......................................................................


Handle the apache config using dh_apache2

The /etc/apache2/conf-available/mediawiki.conf was added, but not enabled
(i.e. symlinked to /etc/apache2/conf-enabled/mediawiki.conf). As a consequence
the mw-setup is not immediately available w/o manual setup steps.

This patch uses the debhelper addon dh_apache2 to manage this automatically,
so a lot of custom postinst code can be dropped.

Change-Id: I803288865978ee5b8e59560598bedab980e9b40d
---
M control
R etc/mediawiki.conf
M mediawiki.postinst
M mediawiki.postrm
M rules
5 files changed, 3 insertions(+), 24 deletions(-)

Approvals:
  Legoktm: Verified; Looks good to me, approved



diff --git a/control b/control
index 02430df..15af506 100644
--- a/control
+++ b/control
@@ -4,7 +4,7 @@
 Maintainer: Kunal Mehta <[email protected]>
 Build-Depends: debhelper (>= 9),
  dh-buildinfo,
- xsltproc, docbook-xml, docbook-xsl
+ xsltproc, docbook-xml, docbook-xsl, apache2-dev
 Homepage: https://www.mediawiki.org/
 Standards-Version: 3.9.6
 Vcs-Git: https://gerrit.wikimedia.org/r/mediawiki/debian.git
diff --git a/etc/apache.conf b/etc/mediawiki.conf
similarity index 100%
rename from etc/apache.conf
rename to etc/mediawiki.conf
diff --git a/mediawiki.postinst b/mediawiki.postinst
index 6098f57..87cab30 100644
--- a/mediawiki.postinst
+++ b/mediawiki.postinst
@@ -10,25 +10,6 @@
 
        php5enmod mediawiki
 
-       dst=/etc/apache2/conf-available
-       if [ ! -d $dst/ ]; then
-               install -d -m755 $dst/
-       fi
-       if [ -e /etc/$i/conf.d/mediawiki.conf ]; then
-               mv /etc/$i/conf.d/mediawiki.conf $dst/
-       fi
-       if [ ! -e $dst/mediawiki.conf ]; then
-               ln -s /etc/mediawiki/apache.conf \
-               $dst/mediawiki.conf
-               if [ -f /etc/init.d/$i ]; then
-                       if which invoke-rc.d >/dev/null 2>&1; then
-                               invoke-rc.d $i reload
-                       else
-                               /etc/init.d/$i reload
-                       fi
-               fi
-       fi
-
         chown -R www-data:www-data /var/lib/mediawiki/cache 
/var/lib/mediawiki/images
         chmod 700 /var/lib/mediawiki/cache /var/lib/mediawiki/images
 
diff --git a/mediawiki.postrm b/mediawiki.postrm
index 8e547dc..41b9e7f 100644
--- a/mediawiki.postrm
+++ b/mediawiki.postrm
@@ -7,9 +7,7 @@
 
 case "$1" in
     purge)
-       rm -rf /etc/mediawiki /var/lib/mediawiki \
-           /etc/apache*/conf.d/mediawiki.conf \
-           /etc/apache2/conf-available/mediawiki.conf
+       rm -rf /etc/mediawiki /var/lib/mediawiki
     ;;
     *)
     ;;
diff --git a/rules b/rules
index 6b4e79a..667ce50 100755
--- a/rules
+++ b/rules
@@ -50,4 +50,4 @@
        dh_installdeb
 
 %:
-       dh $@
+       dh $@ --with apache2

-- 
To view, visit https://gerrit.wikimedia.org/r/263018
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I803288865978ee5b8e59560598bedab980e9b40d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/debian
Gerrit-Branch: master
Gerrit-Owner: Muehlenhoff <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to