From be97cd7d535faed0d683d75c09ecefc1988b2aeb Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 28 Jun 2013 12:08:02 +0200 Subject: [PATCH] Debian : Managed /etc/ldapsaisie/local transition --- debian/ldapsaisie.postinst | 11 +++++++++++ debian/ldapsaisie.preinst | 8 ++++++++ debian/rules | 1 - 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 debian/ldapsaisie.preinst diff --git a/debian/ldapsaisie.postinst b/debian/ldapsaisie.postinst index b71747b4..49c0efcb 100644 --- a/debian/ldapsaisie.postinst +++ b/debian/ldapsaisie.postinst @@ -2,3 +2,14 @@ chown www-data:adm /var/tmp/ldapsaisie /var/log/ldapsaisie chmod 750 /var/tmp/ldapsaisie /var/log/ldapsaisie +if test ! -L /etc/ldapsaisie/local +then + echo "Install /etc/ldapsaisie/local symbolic link" + [ -e /etc/ldapsaisie/local ] && mv -f /etc/ldapsaisie/local /etc/ldapsaisie/local.dpkg-old + ln -s /usr/local/share/ldapsaisie /etc/ldapsaisie/local +fi + +if [ -f /usr/local/share/ldapsaisie/conf/config.inc.php.dpkg-move ] +then + mv /usr/local/share/ldapsaisie/conf/config.inc.php.dpkg-move /usr/local/share/ldapsaisie/conf/config.inc.php +fi diff --git a/debian/ldapsaisie.preinst b/debian/ldapsaisie.preinst new file mode 100644 index 00000000..dffee564 --- /dev/null +++ b/debian/ldapsaisie.preinst @@ -0,0 +1,8 @@ +#!/bin/sh + +if test ! -L /etc/ldapsaisie/local +then + echo "Move /etc/ldapsaisie/local in /usr/local/share/ldapsaisie" + mv /etc/ldapsaisie/local /usr/local/share/ldapsaisie + mv /usr/local/share/ldapsaisie/conf/config.inc.php /usr/local/share/ldapsaisie/conf/config.inc.php.dpkg-move +fi diff --git a/debian/rules b/debian/rules index f6932768..1d18daf3 100755 --- a/debian/rules +++ b/debian/rules @@ -29,7 +29,6 @@ install: build find $(CURDIR)/debian/ldapsaisie/usr/share/ldapsaisie -name .placefolder -exec rm -f {} \; mv $(CURDIR)/debian/ldapsaisie/usr/share/ldapsaisie/local $(CURDIR)/debian/ldapsaisie/usr/local/share/ldapsaisie - dh_link /usr/local/share/ldapsaisie /etc/ldapsaisie/local find $(CURDIR)/debian/ldapsaisie/usr/local/share/ldapsaisie -type f -exec rm -f \{\} \; dh_link /usr/local/share/ldapsaisie /usr/share/ldapsaisie/local mv $(CURDIR)/debian/ldapsaisie/usr/share/ldapsaisie/conf/config.inc.php $(CURDIR)/debian/ldapsaisie/usr/local/share/ldapsaisie/conf/