[DRE-commits] [librarian-puppet] 03/04: Use update-alternatives

Stig Sandbeck Mathisen ssm at debian.org
Mon Feb 8 22:32:08 UTC 2016


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

ssm pushed a commit to branch master
in repository librarian-puppet.

commit c0594612ecf1c8dd999ed6fdc234447c5c507adb
Author: Stig Sandbeck Mathisen <ssm at debian.org>
Date:   Mon Feb 8 23:16:22 2016 +0100

    Use update-alternatives
    
    Closes: #814084
---
 debian/dirs     |  1 +
 debian/postinst | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 debian/prerm    | 41 +++++++++++++++++++++++++++++++++++++++++
 debian/rules    |  9 +++++++++
 4 files changed, 100 insertions(+)

diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..ffa2565
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+/usr/share/librarian-puppet
\ No newline at end of file
diff --git a/debian/postinst b/debian/postinst
new file mode 100755
index 0000000..cabdeac
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,49 @@
+#!/bin/sh
+# postinst script for librarian-puppet
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+        update-alternatives --install \
+                            /usr/bin/librarian-puppet \
+                            librarian-puppet \
+                            /usr/share/librarian-puppet/bin/librarian-puppet \
+                            10 \
+                            \
+                            --slave \
+                            /usr/share/man/man1/librarian-puppet.1.gz \
+                            librarian-puppet.1.gz \
+                            /usr/share/librarian-puppet/man/man1/librarian-puppet.1.gz
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/prerm b/debian/prerm
new file mode 100755
index 0000000..091f893
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,41 @@
+#!/bin/sh
+# prerm script for librarian-puppet
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|upgrade|deconfigure)
+        update-alternatives --remove \
+                            librarian-puppet \
+                            /usr/share/librarian-puppet/bin/librarian-puppet
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
index a5e7dc8..0f89800 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,3 +13,12 @@
 
 %:
 	dh $@ --buildsystem=ruby --with ruby
+
+override_dh_auto_install:
+	dh_auto_install $@
+	mv -v debian/librarian-puppet/usr/bin debian/librarian-puppet/usr/share/librarian-puppet/
+
+override_dh_compress:
+	dh_compress -O--buildsystem=ruby
+	mv -v debian/librarian-puppet/usr/share/man debian/librarian-puppet/usr/share/librarian-puppet/
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/librarian-puppet.git



More information about the Pkg-ruby-extras-commits mailing list