> We need a source package that is also compatible with squeeze and > lucid so it is backportable just by rebuilding - I believe the new > "require local" directive doesn't work there and needs at least > <Version> magic or similar treatment.
> The rest of the changes is probably ok if we also leave the old > apache.conf file in place, or add debian/rules code to build a package > for the right apache version there. Atached is another version, tested on squeeze and unstable. For backports to squeeze, I enabled the 2.2 "version" module, but that shoud not be necessary anymore after apache 2.2.16-6+squeeze11. Note that mv_conffile will silently keep user changes, if there are any, with no prompting at all about merging changes. On sid, hopefully, the old configuration runs ok, thanks to compat module beeing enabled by default.
diff -Nru phppgadmin-5.1/debian/apache.conf phppgadmin-5.1/debian/apache.conf --- phppgadmin-5.1/debian/apache.conf 2013-04-18 09:39:06.000000000 +0000 +++ phppgadmin-5.1/debian/apache.conf 2013-07-23 23:02:40.000000000 +0000 @@ -5,10 +5,15 @@ DirectoryIndex index.php AllowOverride None -order deny,allow -deny from all -allow from 127.0.0.0/255.0.0.0 ::1/128 -# allow from all +<IfVersion >= 2.3> + Require local +</IfVersion> +<IfVersion < 2.3> + Order Deny,Allow + Deny from all + Allow from 127.0.0.0/255.0.0.0 ::1/128 + # Allow from all +</IfVersion> <IfModule mod_php5.c> php_flag magic_quotes_gpc Off diff -Nru phppgadmin-5.1/debian/dirs phppgadmin-5.1/debian/dirs --- phppgadmin-5.1/debian/dirs 2013-04-18 09:39:06.000000000 +0000 +++ phppgadmin-5.1/debian/dirs 2013-07-22 22:36:49.000000000 +0000 @@ -1,4 +1,4 @@ usr/share/phppgadmin usr/share/phppgadmin/conf etc/phppgadmin -etc/apache2/conf.d +etc/apache2/conf-available diff -Nru phppgadmin-5.1/debian/phppgadmin.postinst phppgadmin-5.1/debian/phppgadmin.postinst --- phppgadmin-5.1/debian/phppgadmin.postinst 2013-04-18 09:39:06.000000000 +0000 +++ phppgadmin-5.1/debian/phppgadmin.postinst 2013-07-24 22:00:19.000000000 +0000 @@ -2,13 +2,48 @@ set -e +### Apache 2.4 set up + +# This is called whathever the action, incuding abort-upgrade... +if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke enconf phppgadmin || exit $? +fi + + +### Apache 2.2 set up + if [ "$1" = configure ]; then - test ! -e /etc/init.d/apache2 || invoke-rc.d apache2 reload + CONF="phppgadmin" + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + + if [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + if [ -d /etc/apache2/conf.d/ ] ; then + if [ ! -L /etc/apache2/conf.d/$CONF.conf ] ; then + ln -s ../conf-available/$CONF.conf /etc/apache2/conf.d/$CONF.conf + fi + if [ "$COMMON_STATE" = "installed" ] ; then + if which a2enmod > /dev/null ; then + a2enmod version + fi + invoke-rc.d apache2 reload || true + fi + fi + fi fi -# conffile converted from symlink to plain file in 5.0.3-2 + +### conffile + +# <= 5.0.3-1: +# /etc/apache2/conf.d/phppgadmin is a link to /etc/phppgadmin/apache.conf +# from 5.0.3-2 to 5.1-1 +# /etc/apache2/conf.d/phppgadmin is a plain file +# >> 5.1-1: +# /etc/apache2/conf.d/phppgadmin has been moved to /etc/apache2/conf-available/phppgadmin.conf if test -x /usr/bin/dpkg-maintscript-helper && dpkg-maintscript-helper supports mv_conffile 2>/dev/null ; then - dpkg-maintscript-helper mv_conffile /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin 5.0.3-1 -- "$@" + dpkg-maintscript-helper mv_conffile /etc/phppgadmin/apache.conf /etc/apache2/conf-available/phppgadmin.conf "5.0.3-1" -- "$@" + dpkg-maintscript-helper mv_conffile /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-available/phppgadmin.conf "5.1.1" -- "$@" fi #DEBHELPER# diff -Nru phppgadmin-5.1/debian/phppgadmin.postrm phppgadmin-5.1/debian/phppgadmin.postrm --- phppgadmin-5.1/debian/phppgadmin.postrm 1970-01-01 00:00:00.000000000 +0000 +++ phppgadmin-5.1/debian/phppgadmin.postrm 2013-07-24 23:57:29.000000000 +0000 @@ -0,0 +1,36 @@ +#! /bin/sh + +set -e + +### Apache 2.4 set up + +if [ "$1" = "purge" ] ; then + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + # This purges whether admin disabled conf + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke disconf phppgadmin || exit $? + fi +fi + +### Apache 2.2 set up + +# Nothing to do in postrm (see prerm) + + +### conffile + +# <= 5.0.3-1: +# /etc/apache2/conf.d/phppgadmin is a link to /etc/phppgadmin/apache.conf +# from 5.0.3-2 to 5.1-1 +# /etc/apache2/conf.d/phppgadmin is a plain file +# >> 5.1-1: +# /etc/apache2/conf.d/phppgadmin has been moved to /etc/apache2/conf-available/phppgadmin.conf +if test -x /usr/bin/dpkg-maintscript-helper && dpkg-maintscript-helper supports mv_conffile 2>/dev/null ; then + dpkg-maintscript-helper mv_conffile /etc/phppgadmin/apache.conf /etc/apache2/conf-available/phppgadmin.conf "5.0.3-1" -- "$@" + dpkg-maintscript-helper mv_conffile /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-available/phppgadmin.conf "5.1.1" -- "$@" + if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] && dpkg --compare-versions "$2" le-nl "5.0.3-1"; then + ln -s ../../phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin + fi +fi + +#DEBHELPER# diff -Nru phppgadmin-5.1/debian/phppgadmin.preinst phppgadmin-5.1/debian/phppgadmin.preinst --- phppgadmin-5.1/debian/phppgadmin.preinst 2013-04-18 09:39:06.000000000 +0000 +++ phppgadmin-5.1/debian/phppgadmin.preinst 2013-07-24 21:58:36.000000000 +0000 @@ -12,11 +12,31 @@ # ;; #esac -# conffile converted from symlink to plain file in 5.0.3-2 + +### Apache 2.4 set up + +# Nothing to do in preinst + + +### Apache 2.2 set up + +# Nothing to do in preinst + + +### conffile + +# <= 5.0.3-1: +# /etc/apache2/conf.d/phppgadmin is a link to /etc/phppgadmin/apache.conf +# from 5.0.3-2 to 5.1-1 +# /etc/apache2/conf.d/phppgadmin is a plain file +# >> 5.1-1: +# /etc/apache2/conf.d/phppgadmin has been moved to /etc/apache2/conf-available/phppgadmin.conf if test -x /usr/bin/dpkg-maintscript-helper && dpkg-maintscript-helper supports mv_conffile 2>/dev/null ; then test -L /etc/apache2/conf.d/phppgadmin && rm /etc/apache2/conf.d/phppgadmin && \ - echo "Moving /etc/phppgadmin/apache.conf to /etc/phppgadmin/apache.conf" - dpkg-maintscript-helper mv_conffile /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin 5.0.3-1 -- "$@" + echo "Removing old link /etc/apache2/conf.d/phppgadmin" + + dpkg-maintscript-helper mv_conffile /etc/phppgadmin/apache.conf /etc/apache2/conf-available/phppgadmin.conf "5.0.3-1" -- "$@" + dpkg-maintscript-helper mv_conffile /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-available/phppgadmin.conf "5.1.1" -- "$@" fi #DEBHELPER# diff -Nru phppgadmin-5.1/debian/phppgadmin.prerm phppgadmin-5.1/debian/phppgadmin.prerm --- phppgadmin-5.1/debian/phppgadmin.prerm 2013-04-18 09:39:06.000000000 +0000 +++ phppgadmin-5.1/debian/phppgadmin.prerm 2013-07-24 11:59:34.000000000 +0000 @@ -2,9 +2,30 @@ set -e -# conffile converted from symlink to plain file in 5.0.3-2 -if test -x /usr/bin/dpkg-maintscript-helper && dpkg-maintscript-helper supports mv_conffile 2>/dev/null ; then - dpkg-maintscript-helper mv_conffile /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin 5.0.3-1 -- "$@" +### Apache 2.4 set up + +if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke disconf phppgadmin || exit $? + fi fi +### Apache 2.2 set up + +if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then + CONF="phppgadmin" + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + if [ -L /etc/apache2/conf.d/$CONF.conf ] ; then + rm /etc/apache2/conf.d/$CONF.conf + fi + if [ "$COMMON_STATE" = "installed" ] ; then + invoke-rc.d apache2 reload || true + fi +fi + +### conffile +# +# Nothing to do in prerm + #DEBHELPER# diff -Nru phppgadmin-5.1/debian/rules phppgadmin-5.1/debian/rules --- phppgadmin-5.1/debian/rules 2013-04-18 09:52:59.000000000 +0000 +++ phppgadmin-5.1/debian/rules 2013-07-22 23:03:15.000000000 +0000 @@ -21,7 +21,7 @@ install: build dh $@ - cp debian/apache.conf debian/phppgadmin/etc/apache2/conf.d/phppgadmin + cp debian/apache.conf debian/phppgadmin/etc/apache2/conf-available/phppgadmin.conf rm debian/phppgadmin/usr/share/phppgadmin/libraries/adodb/*.txt rm debian/phppgadmin/usr/share/phppgadmin/lang/langcheck rm debian/phppgadmin/usr/share/phppgadmin/lang/synch
signature.asc
Description: This is a digitally signed message part.