summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2021-03-10 16:25:44 +0100
committerKarel Kočí <cynerd@email.cz>2021-03-10 16:25:44 +0100
commite8f1f5b34526763c05ec669b826481869e32f64c (patch)
tree81841711f6517a708b2a0b90a90b10f60112b5d4
parent2e6615d5893af80c900cd331422870807dd82f8c (diff)
downloadalpine-personal-pkgs-e8f1f5b34526763c05ec669b826481869e32f64c.tar.gz
alpine-personal-pkgs-e8f1f5b34526763c05ec669b826481869e32f64c.tar.bz2
alpine-personal-pkgs-e8f1f5b34526763c05ec669b826481869e32f64c.zip
spotifyd: add as new package
-rw-r--r--spotifyd/APKBUILD35
-rw-r--r--spotifyd/spotifyd.conf43
-rwxr-xr-xspotifyd/spotifyd.init14
-rwxr-xr-xspotifyd/spotifyd.pre-install8
4 files changed, 100 insertions, 0 deletions
diff --git a/spotifyd/APKBUILD b/spotifyd/APKBUILD
new file mode 100644
index 0000000..42aaedd
--- /dev/null
+++ b/spotifyd/APKBUILD
@@ -0,0 +1,35 @@
+# Contributor: Karel Kočí <cynerd@email.cz>
+# Maintainer: Karel Kočí <cynerd@email.cz>
+pkgname=spotifyd
+pkgver=0.3.2
+pkgrel=1
+pkgdesc="A spotify daemon"
+url="https://github.com/Spotifyd/spotifyd"
+arch="all"
+license="GPLv3"
+options="!check net"
+
+makedepends="cargo alsa-lib-dev openssl-dev"
+
+source="
+ 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"
+
+build() {
+ cargo build --release
+}
+
+package() {
+ cargo install --path . --root="$pkgdir"/usr
+ install -D -m 755 "$srcdir"/spotifyd.init "$pkgdir"/etc/init.d/spotifyd
+ install -D -m 644 "$srcdir"/spotifyd.conf "$pkgdir"/etc/spotifyd.conf
+}
+
+sha512sums="151a01af3dd6833d0e058178e8839dd9e53ab9f43a3acd1d86200affc14b457fc00f7500f3dd69635b79a057d70325260264a5d043ac433b1ef4af355b94ad88 spotifyd.init
+37bf97478d5c9ed9bb9495efeb244c049a4c5eb7a75c19e431a29acdbca6e0e79ddd1089ffbd62c42e402063ab84cd6604bac4db1d8c98e613ca78fb35209ca3 spotifyd.conf
+1a50169a23df67061cb59e8f90a6969517f38fd7d72445ecbaa8213f6300529eaa3b4d78836c339e9adbf7c9b95396e7d3120d522e2bb861ea111c25dc342d41 spotifyd-0.3.2.tar.gz"
diff --git a/spotifyd/spotifyd.conf b/spotifyd/spotifyd.conf
new file mode 100644
index 0000000..82c0220
--- /dev/null
+++ b/spotifyd/spotifyd.conf
@@ -0,0 +1,43 @@
+# Spotifyd configuration file
+# You have to set username and password!
+# For complete documentation see: https://github.com/Spotifyd/spotifyd
+##################################################################################
+[global]
+# Your Spotify account name.
+#username = username
+
+# Your Spotify account password.
+#password = password
+
+# The name that gets displayed under the connect tab on
+# official clients. Spaces are not allowed!
+#device_name = alpinelinux-spotifyd
+
+# The alsa audio device to stream audio to. To get a
+# list of valid devices, run `aplay -L`,
+device = sysdefault
+
+# The alsa mixer used by `spotifyd`.
+mixer = Master
+
+##################################################################################
+
+# The audio bitrate. 96, 160 or 320 kbit/s
+bitrate = 320
+
+# The director used to cache audio data. This setting can save
+# a lot of bandwidth when activated, as it will avoid re-downloading
+# audio files when replaying them.
+#
+# Note: The file path does not get expanded. Environment variables and
+# shell placeholders like $HOME or ~ don't work!
+cache_path = /var/lib/spotify/cache
+
+# If set to true, audio data does NOT get cached.
+no_audio_cache = true
+
+# If set to true, enables volume normalisation between songs.
+volume_normalisation = true
+
+# The normalisation pregain that is applied for each song.
+normalisation_pregain = -10
diff --git a/spotifyd/spotifyd.init b/spotifyd/spotifyd.init
new file mode 100755
index 0000000..7b9d214
--- /dev/null
+++ b/spotifyd/spotifyd.init
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+
+name="Spotifyd"
+description="Spotify player daemon"
+
+command=/usr/bin/spotifyd
+command_args_foreground="--no-daemon"
+command_user="spotify:spotify"
+supervisor=supervise-daemon
+
+depend() {
+ need net
+ use logger
+}
diff --git a/spotifyd/spotifyd.pre-install b/spotifyd/spotifyd.pre-install
new file mode 100755
index 0000000..282e21c
--- /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 spotify audio 2>/dev/null
+
+exit 0