-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

That's right, I forgot migration from older version of Apache.
Didn't find any "built-in" solution provided by apache2 package, so I
assumed I had to deal with that from phamm postinst & postrm scripts.

I've updated the patch to ensure old config file is removed if still
present.

Regards,
Jean Baptiste

On 14/11/2014 15:31, Julien Cristau wrote:
> On Fri, Nov 14, 2014 at 15:05:26 +0100, Jean Baptiste Favre wrote:
> 
>> Hi, I modified both postinst and postrm scripts so that package
>> can be installed without errors with Apache2 2.4.
>> 
>> Please find patch attached, Regards, Jean Baptiste
> 
>> diff -Nru phamm-0.6.2/debian/changelog
>> phamm-0.6.2/debian/changelog --- phamm-0.6.2/debian/changelog
>> 2014-07-15 08:04:53.000000000 +0200 +++
>> phamm-0.6.2/debian/changelog 2014-11-14 14:59:35.000000000 +0100 
>> @@ -1,3 +1,10 @@ +phamm (0.6.2-1.1) UNRELEASED; urgency=medium + 
>> +  * Non-maintainer upload. +  * Fix postinst and postrm scripts
>> to follow apache2 2.4 migration (Closes: #669841) + + --
>> <deb...@jbfavre.org>  Fri, 14 Nov 2014 14:54:18 +0100 + phamm
>> (0.6.2-1) unstable; urgency=low
>> 
>> * New upstream release (Closes: #750518) diff -Nru
>> phamm-0.6.2/debian/phamm.postinst
>> phamm-0.6.2/debian/phamm.postinst ---
>> phamm-0.6.2/debian/phamm.postinst    2010-03-29 15:50:59.000000000
>> +0200 +++ phamm-0.6.2/debian/phamm.postinst  2014-11-14
>> 14:43:44.000000000 +0100 @@ -128,8 +128,10 @@ ;; esac
>> 
>> -        if [ ! -f /etc/$webserver/conf.d/phamm ] && [ ! -h
>> /etc/$webserver/conf.d/phamm ]; then -            ln -s
>> /etc/phamm/apache.conf /etc/$webserver/conf.d/phamm +        if [
>> -e /usr/share/apache2/apache2-maintscript-helper ]; then +
>> . /usr/share/apache2/apache2-maintscript-helper +            ln
>> -sf /etc/phamm/apache.conf
>> /etc/apache2/conf-available/phamm.conf +
>> apache2_invoke enconf phamm.conf || exit $? restart="$restart
>> $webserver" fi done
> 
> Shouldn't something be done on upgrade about the
> /etc/$webserver/conf.d/phamm symlink added by previous versions?
> 
> Cheers, Julien

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQJ8BAEBCgBmBQJUZhrwXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0RTg0NUJBMjMwQ0I0RDQ0ODkwNjk4NDdC
NERENTM2QUNGN0Q4NzM3AAoJELTdU2rPfYc359UQAJCXDGy4X/ijqD8wRP3vZvan
GjnuIv7SrgdP3AOjRJm/PZ7pOWr6XCuYwXV6+t9oAITZmvoqcy3csbW6AnJJl/3/
9st+yAQls0HzYIupl94akZVhcFIGTLf6LhNiIKuRsONlrm3apApba9gLH75cYgX5
QKNcj1L8hPCfah9aW7e3VCNtZlAEk6884HguL4ORYxl5haugsiGrIhSb0ciItt1l
gb57XGxmvTzaIXx9H1REGFLmxACAi28h7hGH8WTqgKn9/JRDi1jsddd9fC6L0Zgx
ADnuMhORjSeg6A8GF3tEatHMVly4R5aRaCT5cpUyUW7QrWXqIa5nn9jxPXdF6gwY
ksdR2eR5WNBA5F5+vgfFSxr7iOqQ1vsqiVT+Fjv9cvZWZFnjcDmN2YanyCWWH5lG
sbrriL/LKe7l9sa0ioo7xtiJ4ABF51G2FkInLRGqLT2B3k7bYEUuz+WDaF2kqJ05
04qgs5Z2xo6JTkGgl/qXI6h+WKvwU/3vqXiVuUMr2/itR5U/RlDCLsMI4hkOI/9p
o9sx0qvYbCwcjtIBpVtpj9gTPmvpEXIRgDI50+oosrP15OS1K2aZZWSuQk2ZzjlX
IKF5JkkwVpzkAzSisFKE9Y0JhUSHOxwq94ReRyqRsNVGxYYghV4YrlVb+8c/8iNY
FFziL2X/mJBej2A27h9j
=yR7q
-----END PGP SIGNATURE-----
diff -Nru phamm-0.6.2/debian/changelog phamm-0.6.2/debian/changelog
--- phamm-0.6.2/debian/changelog	2014-07-15 08:04:53.000000000 +0200
+++ phamm-0.6.2/debian/changelog	2014-11-14 14:59:35.000000000 +0100
@@ -1,3 +1,10 @@
+phamm (0.6.2-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix postinst and postrm scripts to follow apache2 2.4 migration (Closes: #669841)
+
+ --  <deb...@jbfavre.org>  Fri, 14 Nov 2014 14:54:18 +0100
+
 phamm (0.6.2-1) unstable; urgency=low
 
   * New upstream release (Closes: #750518)
diff -Nru phamm-0.6.2/debian/phamm.postinst phamm-0.6.2/debian/phamm.postinst
--- phamm-0.6.2/debian/phamm.postinst	2010-03-29 15:50:59.000000000 +0200
+++ phamm-0.6.2/debian/phamm.postinst	2014-11-14 15:52:20.000000000 +0100
@@ -128,10 +128,16 @@
                 ;;
         esac
 
-        if [ ! -f /etc/$webserver/conf.d/phamm ] && [ ! -h /etc/$webserver/conf.d/phamm ]; then
-            ln -s /etc/phamm/apache.conf /etc/$webserver/conf.d/phamm
+        if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
+            . /usr/share/apache2/apache2-maintscript-helper
+            ln -sf /etc/phamm/apache.conf /etc/apache2/conf-available/phamm.conf
+            apache2_invoke enconf phamm.conf || exit $?
 	    restart="$restart $webserver"
         fi
+        # delete old apache configuration file
+        if [ -f /etc/$webserver/conf.d/phamm ]; then
+            rm -f /etc/$webserver/conf.d/phamm
+        fi
     done
 
     db_get phamm/restart-webserver || true
diff -Nru phamm-0.6.2/debian/phamm.postrm phamm-0.6.2/debian/phamm.postrm
--- phamm-0.6.2/debian/phamm.postrm	2008-07-26 12:32:26.000000000 +0200
+++ phamm-0.6.2/debian/phamm.postrm	2014-11-14 15:56:43.000000000 +0100
@@ -19,7 +19,13 @@
 
         case "$webserver" in
             apache|apache-perl|apache-ssl|apache2)
-                rm -f /etc/$webserver/conf.d/phamm
+                if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
+                    . /usr/share/apache2/apache2-maintscript-helper
+                    apache2_invoke disconf phamm.conf || exit $?
+                    rm -f /etc/apache2/conf-available/phamm.conf
+                else
+                    rm -f /etc/$webserver/conf.d/phamm.conf
+                fi
                 test -x /usr/sbin/$webserver || continue
                 restart="$restart $webserver"
                 ;;

Attachment: phamm_0.6.2-1.1.diff.sig
Description: PGP signature

Reply via email to