[Python-modules-commits] [flask] 02/06: Use update-alternatives for /usr/bin/flask CLI
Ondřej Nový
onovy at moszumanska.debian.org
Mon Jul 18 20:50:29 UTC 2016
This is an automated email from the git hooks/post-receive script.
onovy pushed a commit to branch master
in repository flask.
commit ccbf247e69d551fed71c7d0d3cab383ae224ed21
Author: Ondřej Nový <onovy at debian.org>
Date: Mon Jul 18 22:20:16 2016 +0200
Use update-alternatives for /usr/bin/flask CLI
---
debian/changelog | 1 +
debian/python-flask.postinst | 11 +++++++++++
debian/python-flask.prerm | 11 +++++++++++
debian/python3-flask.postinst | 11 +++++++++++
debian/python3-flask.prerm | 11 +++++++++++
debian/rules | 6 ++++++
6 files changed, 51 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 1559465..0061684 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,7 @@ flask (0.11.1-1) UNRELEASED; urgency=medium
* Bumped required version of dh-python to 2.20160609~
* Added /usr/share/doc/python-flask-doc/rst symlink
* Removed override_dh_auto_clean and override_dh_python3 (not needed)
+ * Use update-alternatives for /usr/bin/flask CLI
-- Ondřej Nový <novy at ondrej.org> Tue, 29 Mar 2016 21:36:03 +0200
diff --git a/debian/python-flask.postinst b/debian/python-flask.postinst
new file mode 100644
index 0000000..15cfd4b
--- /dev/null
+++ b/debian/python-flask.postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ] ; then
+ update-alternatives --install /usr/bin/flask flask /usr/bin/python2-flask 100
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python-flask.prerm b/debian/python-flask.prerm
new file mode 100644
index 0000000..a5fb3d2
--- /dev/null
+++ b/debian/python-flask.prerm
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
+ update-alternatives --remove flask /usr/bin/python2-flask
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python3-flask.postinst b/debian/python3-flask.postinst
new file mode 100644
index 0000000..ca1fb89
--- /dev/null
+++ b/debian/python3-flask.postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ] ; then
+ update-alternatives --install /usr/bin/flask flask /usr/bin/python3-flask 200
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/python3-flask.prerm b/debian/python3-flask.prerm
new file mode 100644
index 0000000..fdd094a
--- /dev/null
+++ b/debian/python3-flask.prerm
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
+ update-alternatives --remove flask /usr/bin/python3-flask
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
index a082bb7..94a4a19 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,12 @@ export PYBUILD_DESTDIR_python3=debian/python3-flask/
override_dh_auto_test:
LC_ALL=C.UTF-8 http_proxy='' dh_auto_test
+override_dh_install:
+ dh_install
+
+ mv $(CURDIR)/debian/python-flask/usr/bin/flask $(CURDIR)/debian/python-flask/usr/bin/python2-flask
+ mv $(CURDIR)/debian/python3-flask/usr/bin/flask $(CURDIR)/debian/python3-flask/usr/bin/python3-flask
+
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
PYTHONPATH=. sphinx-build -N -q -E -b html docs/ debian/python-flask-doc/usr/share/doc/python-flask-doc/html/
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/flask.git
More information about the Python-modules-commits
mailing list