Only use dpkg-divert on Ubuntu 15.10 (Closes: #823515)

This commit is contained in:
Ondřej Surý 2016-05-09 11:54:53 +02:00
parent 4234c2baba
commit 93e5c44cc2
5 changed files with 40 additions and 23 deletions

View file

@ -1,14 +1,3 @@
#!/bin/sh
# postrm script for php-common
#
# see: dh_installdeb(1)
set -e
if [ "$1" = "purge" ]; then
rm -rf /var/lib/php
fi
if [ "$1" = remove ] ; then
dpkg-divert --remove --package php-common --rename \
--divert /usr/bin/phar.php5 \
@ -17,7 +6,3 @@ if [ "$1" = remove ] ; then
--divert /usr/share/man/man1/phar.php5.1.gz \
/usr/share/man/man1/phar.1.gz
fi
#DEBHELPER#
exit 0

16
debian/php-common.postrm.in vendored Normal file
View file

@ -0,0 +1,16 @@
#!/bin/sh
# postrm script for php-common
#
# see: dh_installdeb(1)
set -e
if [ "$1" = "purge" ]; then
rm -rf /var/lib/php
fi
#DIVERT#
#DEBHELPER#
exit 0

View file

@ -1,7 +1,3 @@
#!/bin/sh
set -e
if [ "$1" = install ] || [ "$1" = upgrade ] ; then
dpkg-divert --add --package php-common --rename \
--divert /usr/bin/phar.php5 \
@ -10,7 +6,3 @@ if [ "$1" = install ] || [ "$1" = upgrade ] ; then
--divert /usr/share/man/man1/phar.php5.1.gz \
/usr/share/man/man1/phar.1.gz
fi
#DEBHELPER#
exit 0

9
debian/php-common.preinst.in vendored Normal file
View file

@ -0,0 +1,9 @@
#!/bin/sh
set -e
#DIVERT#
#DEBHELPER#
exit 0

15
debian/rules vendored
View file

@ -24,6 +24,13 @@ SED=sed
export DH_OPTIONS
DIVERT=sed -e '/\#DIVERT\#/ d'
ifeq (Ubuntu,$(DEB_VENDOR))
ifeq ($(DEB_DISTRIBUTION),wily)
DIVERT=sed -e "/\#DIVERT\#/ r debian/php-common.$${script}.divert"
endif
endif
%:
dh $@
@ -66,6 +73,14 @@ override_dh_fixperms:
dh_fixperms -i -pphp-common -X/var/lib/php/sessions
dh_fixperms -i --remaining-packages
override_dh_installdeb:
for script in preinst postrm; do \
$(DIVERT) \
< debian/php-common.$${script}.in \
> debian/php-common.$${script}; \
done
dh_installdeb -i
override_dh_gencontrol:
dh_gencontrol -pphp-common -- -v$(PHP_COMMON_DEB_VERSION)
dh_gencontrol -pphp-all-dev -- -v$(PHP_COMMON_DEB_VERSION)