Subject: [alpine-aports] [PATCH] testing/loksh: new aport

From: Sören Tempel <[email-masked]>
Date: Sat, 8 Aug 2015 19:48:18 +0200

---
 testing/loksh/APKBUILD            | 31 +++++++++++++++++++++++++++++++
 testing/loksh/loksh.post-install  |  3 +++
 testing/loksh/loksh.post-upgrade  |  1 +
 testing/loksh/loksh.pre-deinstall |  3 +++
 4 files changed, 38 insertions(+)
 create mode 100644 testing/loksh/APKBUILD
 create mode 100644 testing/loksh/loksh.post-install
 create mode 120000 testing/loksh/loksh.post-upgrade
 create mode 100644 testing/loksh/loksh.pre-deinstall

diff --git a/testing/loksh/APKBUILD b/testing/loksh/APKBUILD
new file mode 100644
index 0000000..7924f4e
--- /dev/null
+++ b/testing/loksh/APKBUILD
@@ -0,0 +1,31 @@
+# Maintainer: Sören Tempel <[email-masked]>
+pkgname=loksh
+pkgver=5.7
+pkgrel=0
+pkgdesc="A Linux port of OpenBSD's ksh"
+url="https://github.com/dimkr/$pkgname"
+arch="all"
+license="ISC"
+depends=""
+makedepends="musl"
+install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
+subpackages="$pkgname-doc"
+source="${pkgname}-${pkgver}.tar.gz::https://github.com/dimkr/$pkgname/archive/5.7.tar.gz"
+
+_builddir="$srcdir/$pkgname-$pkgver"
+build() {
+	make -C "$_builddir" || return 1
+}
+
+package() {
+	make DESTDIR="$pkgdir" PREFIX="/usr" \
+		-C "$_builddir" install || return 1
+
+	# Rename those files to prevent a conflict with oksh.
+	mv "$pkgdir"/usr/bin/ksh "$pkgdir"/usr/bin/$pkgname
+	mv "$pkgdir"/usr/share/man/man1/ksh.1 "$pkgdir"/usr/share/man/man1/$pkgname.1
+}
+
+md5sums="aa26163fda0a9ca77556473e79981300  loksh-5.7.tar.gz"
+sha256sums="4bca639cd0f9be61996619d10e523a9dc07cebc7ae60bd4889763eb08ee8ac6e  loksh-5.7.tar.gz"
+sha512sums="87be684504c38fc3543d3f50861b8fc3d854c20b56d3066e620af9a8892893a4ecf9105c0c54446bdc3ede5bc76da42ca0d50b83f042257ee31276898b0d42ae  loksh-5.7.tar.gz"
diff --git a/testing/loksh/loksh.post-install b/testing/loksh/loksh.post-install
new file mode 100644
index 0000000..7e46794
--- /dev/null
+++ b/testing/loksh/loksh.post-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+add-shell '/usr/bin/loksh'
+exit 0
diff --git a/testing/loksh/loksh.post-upgrade b/testing/loksh/loksh.post-upgrade
new file mode 120000
index 0000000..9c69b08
--- /dev/null
+++ b/testing/loksh/loksh.post-upgrade
@@ -0,0 +1 @@
+loksh.post-install
\ No newline at end of file
diff --git a/testing/loksh/loksh.pre-deinstall b/testing/loksh/loksh.pre-deinstall
new file mode 100644
index 0000000..12dd978
--- /dev/null
+++ b/testing/loksh/loksh.pre-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+remove-shell '/usr/bin/loksh'
+exit 0
-- 
2.5.0

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

---

From: Sören Tempel <[email-masked]>
Date: Sun, 9 Aug 2015 00:11:31 +0200

---

index 0000000..e4fec4b
+replaces="oksh"
+	mkdir -p "$pkgdir"/bin
+	mv "$pkgdir"/usr/bin/ksh "$pkgdir"/bin || return 1
index 0000000..0844ccf
+add-shell '/bin/ksh'
index 0000000..2a4b7d8
+remove-shell '/bin/ksh'
+exit 0
-- 
2.5.0

---