From 75d07d5700e9e3da172dd749109a6bbe2f627b99 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 9 Dec 2015 08:45:53 +0000 Subject: [PATCH] Added update-alternative handling for /usr/bin/senlin --- debian/python-senlinclient.postinst | 11 +++++++++++ debian/python-senlinclient.postrm | 11 +++++++++++ debian/python-senlinclient.prerm | 11 +++++++++++ debian/python3-senlinclient.postinst | 11 +++++++++++ debian/python3-senlinclient.postrm | 11 +++++++++++ debian/python3-senlinclient.prerm | 11 +++++++++++ debian/rules | 4 +++- 7 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 debian/python-senlinclient.postinst create mode 100644 debian/python-senlinclient.postrm create mode 100644 debian/python-senlinclient.prerm create mode 100644 debian/python3-senlinclient.postinst create mode 100644 debian/python3-senlinclient.postrm create mode 100644 debian/python3-senlinclient.prerm diff --git a/debian/python-senlinclient.postinst b/debian/python-senlinclient.postinst new file mode 100644 index 0000000..ae9cda2 --- /dev/null +++ b/debian/python-senlinclient.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] ; then + update-alternatives --install /usr/bin/senlin senlin /usr/bin/python2-senlin 300 +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python-senlinclient.postrm b/debian/python-senlinclient.postrm new file mode 100644 index 0000000..81b59ac --- /dev/null +++ b/debian/python-senlinclient.postrm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] || [ "$1" = "disappear" ] ; then + update-alternatives --remove senlin /usr/bin/python2-senlin +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python-senlinclient.prerm b/debian/python-senlinclient.prerm new file mode 100644 index 0000000..a1f2934 --- /dev/null +++ b/debian/python-senlinclient.prerm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] ; then + update-alternatives --remove senlin /usr/bin/python2-senlin +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python3-senlinclient.postinst b/debian/python3-senlinclient.postinst new file mode 100644 index 0000000..bd251b6 --- /dev/null +++ b/debian/python3-senlinclient.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] ; then + update-alternatives --install /usr/bin/senlin senlin /usr/bin/python3-senlin 200 +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python3-senlinclient.postrm b/debian/python3-senlinclient.postrm new file mode 100644 index 0000000..d4852db --- /dev/null +++ b/debian/python3-senlinclient.postrm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] || [ "$1" = "disappear" ] ; then + update-alternatives --remove senlin /usr/bin/python3-senlin +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python3-senlinclient.prerm b/debian/python3-senlinclient.prerm new file mode 100644 index 0000000..f99d3a3 --- /dev/null +++ b/debian/python3-senlinclient.prerm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] ; then + update-alternatives --remove senlin /usr/bin/python3-senlin +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 2e62ae0..0656010 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,9 @@ override_dh_auto_install: python$$pyvers setup.py install --install-layout=deb \ --root $(CURDIR)/debian/python3-senlinclient; \ done - rm -rf $(CURDIR)/debian/python*-python-senlinclient/usr/lib/python*/dist-packages/*.pth + rm -rf $(CURDIR)/debian/python*-senlinclient/usr/lib/python*/dist-packages/*.pth + mv $(CURDIR)/debian/python-senlinclient/usr/bin/senlin $(CURDIR)/debian/python-senlinclient/usr/bin/python2-senlin + mv $(CURDIR)/debian/python3-senlinclient/usr/bin/senlin $(CURDIR)/debian/python3-senlinclient/usr/bin/python3-senlin override_dh_python3: dh_python3 --shebang=/usr/bin/python3