[Python-modules-commits] [python-gear] 04/05: Using update-alternatives to handle /usr/bin/geard

Thomas Goirand zigo at moszumanska.debian.org
Tue Sep 8 09:45:52 UTC 2015


This is an automated email from the git hooks/post-receive script.

zigo pushed a commit to branch debian/unstable
in repository python-gear.

commit 627aa3d30c67b51d676f64edc8542c6f5e6e19f7
Author: Thomas Goirand <thomas at goirand.fr>
Date:   Tue Sep 8 09:43:04 2015 +0000

    Using update-alternatives to handle /usr/bin/geard
---
 debian/python-gear.postinst  | 11 +++++++++++
 debian/python-gear.postrm    | 11 +++++++++++
 debian/python-gear.prerm     | 11 +++++++++++
 debian/python3-gear.postinst | 11 +++++++++++
 debian/python3-gear.postrm   | 11 +++++++++++
 debian/python3-gear.prerm    | 11 +++++++++++
 debian/rules                 |  6 ++++--
 7 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/debian/python-gear.postinst b/debian/python-gear.postinst
new file mode 100644
index 0000000..cc120f6
--- /dev/null
+++ b/debian/python-gear.postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ] ; then
+	update-alternatives --install /usr/bin/geard geard /usr/bin/python2-geard 300
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python-gear.postrm b/debian/python-gear.postrm
new file mode 100644
index 0000000..43e6dfe
--- /dev/null
+++ b/debian/python-gear.postrm
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "remove" ] || [ "$1" = "disappear" ] ; then
+	update-alternatives --remove geard /usr/bin/python2-geard
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python-gear.prerm b/debian/python-gear.prerm
new file mode 100644
index 0000000..cbec5bf
--- /dev/null
+++ b/debian/python-gear.prerm
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "remove" ] ; then
+	update-alternatives --remove geard /usr/bin/python2-geard
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python3-gear.postinst b/debian/python3-gear.postinst
new file mode 100644
index 0000000..f62e269
--- /dev/null
+++ b/debian/python3-gear.postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ] ; then
+	update-alternatives --install /usr/bin/geard geard /usr/bin/python3-geard 200
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python3-gear.postrm b/debian/python3-gear.postrm
new file mode 100644
index 0000000..6d08a1b
--- /dev/null
+++ b/debian/python3-gear.postrm
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "remove" ] || [ "$1" = "disappear" ] ; then
+	update-alternatives --remove geard /usr/bin/python3-geard
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python3-gear.prerm b/debian/python3-gear.prerm
new file mode 100644
index 0000000..7d23012
--- /dev/null
+++ b/debian/python3-gear.prerm
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "remove" ] ; then
+	update-alternatives --remove geard /usr/bin/python3-geard
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
index 0cc4ec5..c1c34ab 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,14 +11,16 @@ export OSLO_PACKAGE_VERSION=$(VERSION)
 	dh $@ --buildsystem=python_distutils --with python2,python3
 
 override_dh_auto_install:
-	set -e && for pyvers in $(PYTHONS); do \
+	set -e ; for pyvers in $(PYTHONS); do \
 		python$$pyvers setup.py install --install-layout=deb \
 			--root $(CURDIR)/debian/python-gear; \
 	done
-	set -e && for pyvers in $(PYTHON3S); do \
+	set -e ; for pyvers in $(PYTHON3S); do \
 		python$$pyvers setup.py install --install-layout=deb \
 			--root $(CURDIR)/debian/python3-gear; \
 	done
+	mv $(CURDIR)/debian/python-gear/usr/bin/geard $(CURDIR)/debian/python-gear/usr/bin/python2-geard
+	mv $(CURDIR)/debian/python3-gear/usr/bin/geard $(CURDIR)/debian/python3-gear/usr/bin/python3-geard
 
 override_dh_auto_test:
 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-gear.git



More information about the Python-modules-commits mailing list