Subject: [alpine-aports] [PATCH] main/unfs3: add init script

From: Henrik Riomar <[email-masked]>
Date: Mon, 24 Oct 2016 16:07:19 +0200

---
 main/unfs3/APKBUILD    | 23 +++++++++++++++++------
 main/unfs3/unfs3.confd |  5 +++++
 main/unfs3/unfs3.initd | 22 ++++++++++++++++++++++
 3 files changed, 44 insertions(+), 6 deletions(-)
 create mode 100644 main/unfs3/unfs3.confd
 create mode 100644 main/unfs3/unfs3.initd

diff --git a/main/unfs3/APKBUILD b/main/unfs3/APKBUILD
index 307562d..e96ffce 100644
--- a/main/unfs3/APKBUILD
+++ b/main/unfs3/APKBUILD
@@ -1,16 +1,19 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=unfs3
 pkgver=0.9.22
-pkgrel=3
+pkgrel=4
 pkgdesc="a user-space implementation of the NFSv3 server specification"
 url="http://unfs3.sourceforge.net/"
 arch="all"
 license='GPL'
-depends=""
+depends="rpcbind"
 depends_dev="libtirpc-dev flex-dev"
 makedepends="$depends_dev flex"
 source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
-unfs3-0.9.22-musl.patch"
+	unfs3-0.9.22-musl.patch
+	unfs3.confd
+	unfs3.initd
+	"
 subpackages="$pkgname-doc"
 
 build() {
@@ -33,11 +36,19 @@ build() {
 package() {
 	cd "$srcdir/$pkgname-$pkgver"
 	make DESTDIR="$pkgdir/" install
+	install -D -m0644 "$srcdir"/unfs3.confd "$pkgdir"/etc/conf.d/unfs3
+	install -D -m0755 "$srcdir"/unfs3.initd "$pkgdir"/etc/init.d/unfs3
 }
 
 md5sums="ddf679a5d4d80096a59f3affc64f16e5  unfs3-0.9.22.tar.gz
-0cf4e87daee20f8504cc8af2106033b7  unfs3-0.9.22-musl.patch"
+0cf4e87daee20f8504cc8af2106033b7  unfs3-0.9.22-musl.patch
+cbddfb3bee3a2af77b0c0e20f9967a2d  unfs3.confd
+40fa047b09b7a811bf3326cf630e4df5  unfs3.initd"
 sha256sums="482222cae541172c155cd5dc9c2199763a6454b0c5c0619102d8143bb19fdf1c  unfs3-0.9.22.tar.gz
-6d5e371dbacb055e8775e409c24a4fd73153510fcb5ace2c0a4e7a189f9140d7  unfs3-0.9.22-musl.patch"
+6d5e371dbacb055e8775e409c24a4fd73153510fcb5ace2c0a4e7a189f9140d7  unfs3-0.9.22-musl.patch
+e7ba94b1091eb7069b8f87945a6cfebf45a511942cf8719d2060c29f85280074  unfs3.confd
+0c1bb1e53c405ef922121f5d82a17413d2ffcbe5ad21b88ceec2dd9894df8e3c  unfs3.initd"
 sha512sums="b1e4b7f5b7b7de27bb5411c69363a6b40be0fcf1f772e283f0868a2155fa9ea4b9b8e7f05b1706e41cf09dd2ee4baab472a01bc4640ae47e3be2a19d8d3f5f9e  unfs3-0.9.22.tar.gz
-f2221651fad842acb8b5fd637514caa07300f627efd5b168ee2939ab3b6ea55fdefa3c3f3336425e255ee7badd326528c722d4064a04936b5468aabc79cbca02  unfs3-0.9.22-musl.patch"
+f2221651fad842acb8b5fd637514caa07300f627efd5b168ee2939ab3b6ea55fdefa3c3f3336425e255ee7badd326528c722d4064a04936b5468aabc79cbca02  unfs3-0.9.22-musl.patch
+e3a3b7a71117482fd3214eadfd957f5cd3f05da268f748f931945c390f1d8e46e19b33d53b2ce0505c61745f8dd6285f7a9de409196fedef07d23ae029f1c035  unfs3.confd
+105b1ac6d0a65b3ba19bb8ada17d1ae865cf14e71e6a3838df1e6d34d2738457f0019258fd10a4594783074c10be44db75417677290bdd6862ba73b4c370b07e  unfs3.initd"
diff --git a/main/unfs3/unfs3.confd b/main/unfs3/unfs3.confd
new file mode 100644
index 0000000..bca4d3e
--- /dev/null
+++ b/main/unfs3/unfs3.confd
@@ -0,0 +1,5 @@
+# /etc/conf.d/unfs3
+
+# Options for `unfsd`.
+UNFSD_OPTS="-i /run/unfsd.pid -u -n 2049 -m 2049"
+
diff --git a/main/unfs3/unfs3.initd b/main/unfs3/unfs3.initd
new file mode 100644
index 0000000..a2cf864
--- /dev/null
+++ b/main/unfs3/unfs3.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+
+depend() {
+	config /etc/exports
+	use net
+	after firewall
+	need portmap
+}
+
+start() {
+	ebegin "Starting unfs3"
+	start-stop-daemon --start --quiet --exec /usr/sbin/unfsd \
+		-- ${UNFSD_OPTS}
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping unfs3"
+	start-stop-daemon --stop --quiet --exec /usr/sbin/unfsd
+	eend $?
+}
+
-- 
2.8.3

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