From d98bc001a247c735893b682071f990d6c8eebaa1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 21 Feb 2025 11:11:38 +0100 Subject: [PATCH] Adding alternative handling for /usr/bin/lzip. Signed-off-by: Daniel Baumann --- debian/control | 2 +- debian/lziprecover.postinst | 25 +++++++++++++++++++++++++ debian/lziprecover.prerm | 22 ++++++++++++++++++++++ debian/rules | 9 +++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 debian/lziprecover.postinst create mode 100644 debian/lziprecover.prerm diff --git a/debian/control b/debian/control index e66b7f4..edff4ad 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Homepage: http://www.nongnu.org/lzip/lziprecover.html Package: lziprecover Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} -Conflicts: lzip (<< 1.13~rc1-1~) +Breaks: lzip (<< 1.15~) Description: lossless data compressor based on the LZMA algorithm (recovery) Lzip is a lossless data compressor based on the LZMA algorithm, with very safe integrity checking and a user interface similar to the one of gzip or bzip2. diff --git a/debian/lziprecover.postinst b/debian/lziprecover.postinst new file mode 100644 index 0000000..cb73f75 --- /dev/null +++ b/debian/lziprecover.postinst @@ -0,0 +1,25 @@ +#!/bin/sh + +set -e + +case "${1}" in + configure) + update-alternatives --quiet \ + --install /usr/bin/lzip lzip /usr/bin/lzip.recover 50 \ + --slave /usr/share/info/lzip.info.gz lzip.info.gz /usr/share/info/lzip.recover.info.gz \ + --slave /usr/share/man/man1/lzip.1.gz lzip.1.gz /usr/share/man/man1/lzip.recover.1.gz + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/lziprecover.prerm b/debian/lziprecover.prerm new file mode 100644 index 0000000..f8e7f39 --- /dev/null +++ b/debian/lziprecover.prerm @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +case "${1}" in + remove|upgrade|deconfigure) + update-alternatives --quiet --remove lzip /usr/bin/lzip.recover + ;; + + failed-upgrade) + + ;; + + *) + echo "prerm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 2d978b2..6820b21 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,15 @@ override_dh_auto_install: # removing unused files rm -f debian/lziprecover/usr/share/info/dir* + # alernative handling + mv debian/lziprecover/usr/bin/lziprecover debian/lziprecover/usr/bin/lzip.recover + mv debian/lziprecover/usr/share/info/lziprecover.info debian/lziprecover/usr/share/info/lzip.recover.info + mv debian/lziprecover/usr/share/man/man1/lziprecover.1 debian/lziprecover/usr/share/man/man1/lzip.recover.1 + + ln -s /usr/bin/lzip.recover debian/lziprecover/usr/bin/lziprecover + ln -s /usr/share/info/lzip.recover.info.gz debian/lziprecover/usr/share/info/lziprecover.info.gz + ln -s /usr/share/man/man1/lzip.recover.1.gz debian/lziprecover/usr/share/man/man1/lziprecover.1.gz + override_dh_strip: dh_strip --dbg-package=lziprecover-dbg