Mail archive
alpine-aports

[alpine-aports] [PATCH] main/taskd: Add init scripts

From: Ivan Tham <pickfire_at_riseup.net>
Date: Sun, 5 Mar 2017 18:36:10 +0800

I use the wrong permission for /var/lib/taskd.
Please ignore the previous email.

---
 main/taskd/APKBUILD          | 42 +++++++++++++++---------------------------
 main/taskd/taskd.initd       | 12 ++++++++++++
 main/taskd/taskd.pre-install |  7 +++++++
 3 files changed, 34 insertions(+), 27 deletions(-)
 create mode 100644 main/taskd/taskd.initd
 create mode 100644 main/taskd/taskd.pre-install
diff --git a/main/taskd/APKBUILD b/main/taskd/APKBUILD
index e0e318f..3eb7100 100644
--- a/main/taskd/APKBUILD
+++ b/main/taskd/APKBUILD
_at_@ -1,8 +1,9 @@
 # Contributor: ScrumpyJack <scrumpyjack_at_st.ilet.to>
+# Contributor: Ivan Tham <pickfire_at_riseup.net
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=taskd
 pkgver=1.1.0
-pkgrel=2
+pkgrel=3
 pkgdesc="Taskserver synchronises taskwarrior across multiple clients"
 url="http://taskwarrior.org"
 arch="all"
_at_@ -10,48 +11,35 @@ license="MIT"
 depends=""
 depends_dev="gnutls-dev util-linux-dev"
 makedepends="$depends_dev cmake"
-install=""
+install="$pkgname.pre-install"
 subpackages="$pkgname-doc $pkgname-pki"
 source="http://taskwarrior.org/download/${pkgname}-${pkgver}.tar.gz
 	Path.cpp.patch
-	Directory.cpp.patch"
-
-
-_builddir=$srcdir/$pkgname-$pkgver
-prepare() {
-	local i
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
-}
+	Directory.cpp.patch
+	taskd.initd"
+builddir=$srcdir/$pkgname-$pkgver
 
 build() {
-	cd "$_builddir"
-	cmake .  -DCMAKE_INSTALL_PREFIX=/usr  || return 1
+	cd "$builddir"
+	cmake . -DCMAKE_INSTALL_PREFIX=/usr || return 1
 	make || return 1
 }
 
-pki () {
+pki() {
 	pkgdesc="Tools for taskd PKI management"
 	depends="taskd gnutls-utils"
 	mkdir -p "$subpkgdir"/usr/share/taskd
-	mv "${_builddir}/pki" "$subpkgdir"/usr/share/taskd || return 1
+	mv "${builddir}/pki" "$subpkgdir"/usr/share/taskd || return 1
 }
 
 package() {
-	cd "$_builddir"
+	cd "$builddir"
 	make DESTDIR="$pkgdir" install || return 1
+	install -dm700 -o taskd -g taskd "$pkgdir"/var/lib/$pkgname
+	install -Dm755 "$srcdir"/taskd.initd "$pkgdir"/etc/init.d/$pkgname
 }
 
-md5sums="ac855828c16f199bdbc45fbc227388d0  taskd-1.1.0.tar.gz
-0e91d6e98a85f9ed42956c3220eca9f0  Path.cpp.patch
-230518443e477b8181f3eb896355d5dc  Directory.cpp.patch"
-sha256sums="7b8488e687971ae56729ff4e2e5209ff8806cf8cd57718bfd7e521be130621b4  taskd-1.1.0.tar.gz
-75449122cf7c3e0a4d1061534ca80442b73b766790a31ec4535094556e6b8212  Path.cpp.patch
-90cffb295f47c2a613680e53432b4c72a58ed19c218a5e7744acb076e96ab003  Directory.cpp.patch"
 sha512sums="df2349c354258fd1b014b1a9c78f68dc10c9e5a48357e282e8a760cf4e4aaf4d36486796ad094ee2b050e7506195b778e3316c90ef543a2f8242de313daa13aa  taskd-1.1.0.tar.gz
 51f9a384c3c76c2719f8dbc378fad0717b02e508dcf3d08fcabf2ebed002501bb7760723d49ee210f15ac65b077c35ea765c22ea8793ead04141bc6f6b2c8b3a  Path.cpp.patch
-fa3c8bec063119e7a8321a1be26e3c16ae1d1cbb34aa06becc29830f1e78180514a68981d9fd4c34b63755ab9afa2c5a295efeeea6dbce263bdf9c010d7c28aa  Directory.cpp.patch"
+fa3c8bec063119e7a8321a1be26e3c16ae1d1cbb34aa06becc29830f1e78180514a68981d9fd4c34b63755ab9afa2c5a295efeeea6dbce263bdf9c010d7c28aa  Directory.cpp.patch
+c120566bd8e33de3980a554d62f6156f0650656985d108e2c577508b5f94f1040e4b70dc52f82210f1a5aeb9492a61c54a8d6c063ed6a999a3de4562426c36c1  taskd.initd"
diff --git a/main/taskd/taskd.initd b/main/taskd/taskd.initd
new file mode 100644
index 0000000..cbf86f9
--- /dev/null
+++ b/main/taskd/taskd.initd
_at_@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+
+description="Secure server providing multi-user, multi-client access to task data"
+command=/usr/bin/taskd
+command_args="server --data /var/lib/taskd"
+
+start_stop_daemon_args="--user taskd:taskd"
+
+depend() {
+	need net
+	after firewall
+}
diff --git a/main/taskd/taskd.pre-install b/main/taskd/taskd.pre-install
new file mode 100644
index 0000000..847ccc3
--- /dev/null
+++ b/main/taskd/taskd.pre-install
_at_@ -0,0 +1,7 @@
+#!/bin/sh
+
+addgroup -S taskd 2>/dev/null
+adduser -S -D -h /var/lib/taskd -s /sbin/nologin -G taskd -g taskd taskd 2>/dev/null
+
+exit 0
+
-- 
2.11.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sun Mar 05 2017 - 18:36:10 GMT