summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2020-01-27 17:53:13 +0100
committerKarel Kočí <karel.koci@nic.cz>2020-01-27 17:53:13 +0100
commit6d1abf168e64bd7e9e320fe63f4129427bd76e8b (patch)
treeab52a00f87d5071c42003e8736b35e73d2a260cd
parent8f4f870d2754ecaefb2d6a04fac47c627dccb14a (diff)
downloadalpine-personal-pkgs-6d1abf168e64bd7e9e320fe63f4129427bd76e8b.tar.gz
alpine-personal-pkgs-6d1abf168e64bd7e9e320fe63f4129427bd76e8b.tar.bz2
alpine-personal-pkgs-6d1abf168e64bd7e9e320fe63f4129427bd76e8b.zip
spotifyd: run as spotify user
-rw-r--r--spotifyd/APKBUILD14
-rwxr-xr-xspotifyd/spotifyd.init5
-rwxr-xr-xspotifyd/spotifyd.pre-install8
3 files changed, 21 insertions, 6 deletions
diff --git a/spotifyd/APKBUILD b/spotifyd/APKBUILD
index 1f68737..85b6f28 100644
--- a/spotifyd/APKBUILD
+++ b/spotifyd/APKBUILD
@@ -2,17 +2,21 @@
# Maintainer: Karel Kočí <cynerd@email.cz>
pkgname=spotifyd
pkgver=0.2.23
-pkgrel=2
+pkgrel=3
pkgdesc="A spotify daemon"
url="https://github.com/Spotifyd/spotifyd"
arch="x86_64 armhf aarch64"
license="GPLv3"
+options="!check net"
+
makedepends="cargo alsa-lib-dev openssl-dev"
-options="net"
+
source="
-spotifyd.init
-$pkgname-$pkgver.tar.gz::https://github.com/Spotifyd/spotifyd/archive/v$pkgver.tar.gz"
-options="!check"
+ spotifyd.init
+ spotifyd.conf
+ $pkgname-$pkgver.tar.gz::https://github.com/Spotifyd/spotifyd/archive/v$pkgver.tar.gz
+"
+install="$pkgname.pre-install"
export CARGO_HOME="$srcdir/cargo"
diff --git a/spotifyd/spotifyd.init b/spotifyd/spotifyd.init
index 0069c26..7f9d316 100755
--- a/spotifyd/spotifyd.init
+++ b/spotifyd/spotifyd.init
@@ -1,9 +1,12 @@
#!/sbin/openrc-run
+name="Spotifyd"
+description="Spotify player daemon"
+
command=/usr/bin/spotifyd
pidfile=/var/run/spotifyd.pid
command_args="--pid '$pidfile'"
-name="Spotify daemon"
+command_user="spotify:spotify"
depend() {
need net
diff --git a/spotifyd/spotifyd.pre-install b/spotifyd/spotifyd.pre-install
new file mode 100755
index 0000000..7addb5d
--- /dev/null
+++ b/spotifyd/spotifyd.pre-install
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+addgroup -S spotify 2>/dev/null
+adduser -S -D -h /var/lib/spotify -s /sbin/nologin -G spotify spotify 2>/dev/null
+
+adduser kodi audio 2>/dev/null
+
+exit 0