Subject: [alpine-aports] [PATCH 2/3] main/mksh: add /usr/bin/mksh to /etc/shells

From: Sören Tempel <[email-masked]>
Date: Mon, 27 Jul 2015 20:25:39 +0200

---
 main/mksh/APKBUILD           | 4 ++--
 main/mksh/mksh.post-install  | 3 +++
 main/mksh/mksh.post-upgrade  | 1 +
 main/mksh/mksh.pre-deinstall | 3 +++
 4 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 main/mksh/mksh.post-install
 create mode 120000 main/mksh/mksh.post-upgrade
 create mode 100644 main/mksh/mksh.pre-deinstall

diff --git a/main/mksh/APKBUILD b/main/mksh/APKBUILD
index 024d77d..cf28eb7 100644
--- a/main/mksh/APKBUILD
+++ b/main/mksh/APKBUILD
@@ -2,7 +2,7 @@
 pkgname=mksh
 pkgver=50f
 _pkgver=R50f
-pkgrel=0
+pkgrel=1
 pkgdesc="MirBSD KSH Shell"
 url="http://mirbsd.de/mksh"
 arch="all"
@@ -10,7 +10,7 @@ license="BSD"
 depends=""
 depends_dev=""
 makedepends="$depends_dev"
-install=""
+install="mksh.post-install mksh.post-upgrade mksh.pre-deinstall"
 subpackages="$pkgname-doc"
 source="https://www.mirbsd.org/MirOS/dist/mir/mksh/$pkgname-$_pkgver.tgz"
 
diff --git a/main/mksh/mksh.post-install b/main/mksh/mksh.post-install
new file mode 100644
index 0000000..1780754
--- /dev/null
+++ b/main/mksh/mksh.post-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+grep -q '/usr/bin/mksh' /etc/shells || echo '/usr/bin/mksh' >> /etc/shells
+exit 0
diff --git a/main/mksh/mksh.post-upgrade b/main/mksh/mksh.post-upgrade
new file mode 120000
index 0000000..29bbd42
--- /dev/null
+++ b/main/mksh/mksh.post-upgrade
@@ -0,0 +1 @@
+mksh.post-install
\ No newline at end of file
diff --git a/main/mksh/mksh.pre-deinstall b/main/mksh/mksh.pre-deinstall
new file mode 100644
index 0000000..d6e4f93
--- /dev/null
+++ b/main/mksh/mksh.pre-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+sed -i '/^\/usr\/bin\/mksh/d' /etc/shells
+exit 0
-- 
2.4.6

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---