summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild6
-rw-r--r--bzip2.pkg/postinst8
-rw-r--r--bzip2.pkg/prerm7
3 files changed, 18 insertions, 3 deletions
diff --git a/build b/build
index 2af8662..8654583 100755
--- a/build
+++ b/build
@@ -16,10 +16,10 @@ install: build
oh-autoinstall -- PREFIX="$${PWD}/dest"
install -d dest/usr/bin/ dest/usr/lib/ dest/usr/share/
# /usr/bin/bzip2 and links (bunzip2 and bzcat):
- mv dest/bin/bzip2 dest/usr/bin/
+ mv dest/bin/bzip2 dest/usr/bin/bzip2.bzip2
rm dest/bin/bunzip2 dest/bin/bzcat
- ln -sf bzip2 dest/usr/bin/bunzip2
- ln -sf bzip2 dest/usr/bin/bzcat
+ ln -sf bzip2.bzip2 dest/usr/bin/bunzip2.bzip2
+ ln -sf bzip2.bzip2 dest/usr/bin/bzcat.bzip2
# /usr/bin/bzip2recover:
mv dest/bin/bzip2recover dest/usr/bin/
# /usr/bin/bzgrep and links (bzegrep and bzfgrep):
diff --git a/bzip2.pkg/postinst b/bzip2.pkg/postinst
new file mode 100644
index 0000000..0239ea7
--- /dev/null
+++ b/bzip2.pkg/postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ "x${1}" = 'xconfigure' ]; then
+ for link in bzip2 bunzip2 bzcat; do
+ update-alternatives --install /usr/bin/${link} ${link} \
+ /usr/bin/${link}.bzip2 20
+ done
+fi
diff --git a/bzip2.pkg/prerm b/bzip2.pkg/prerm
new file mode 100644
index 0000000..d82eecc
--- /dev/null
+++ b/bzip2.pkg/prerm
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ "x${1}" = 'xremove' ]; then
+ for link in bzip2 bunzip2 bzcat; do
+ update-alternatives --remove ${link} /usr/bin/${link}.bzip2
+ done
+fi