aboutsummaryrefslogtreecommitdiffstats
path: root/testing/librespot
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2017-04-16 13:48:41 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2017-04-16 13:48:45 +0200
commit2f03bd64f5aac2f44fcaf95f047d57482eb9d177 (patch)
tree25092f123c9de2b5d5b3390dbcc0a4b4c474c0e7 /testing/librespot
parent080bc4539da884ff321834b7d8b80465e53869b9 (diff)
downloadaports-2f03bd64f5aac2f44fcaf95f047d57482eb9d177.tar.bz2
aports-2f03bd64f5aac2f44fcaf95f047d57482eb9d177.tar.xz
testing/librespot: new aport
Diffstat (limited to 'testing/librespot')
-rw-r--r--testing/librespot/APKBUILD42
-rw-r--r--testing/librespot/librespot.confd1
-rw-r--r--testing/librespot/librespot.initd13
-rw-r--r--testing/librespot/librespot.pre-install5
4 files changed, 61 insertions, 0 deletions
diff --git a/testing/librespot/APKBUILD b/testing/librespot/APKBUILD
new file mode 100644
index 0000000000..f57c92f1b8
--- /dev/null
+++ b/testing/librespot/APKBUILD
@@ -0,0 +1,42 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=librespot
+_sha=d95c0b3fcd2ddfa9d09a189d73b82090420d7f56
+pkgver=20170413
+pkgrel=0
+pkgdesc="Open Source Spotify client library"
+url="https://github.com/plietar/librespot"
+arch="x86_64"
+license="MIT"
+depends=""
+makedepends="cargo portaudio-dev protobuf-dev alsa-lib-dev"
+install="$pkgname.pre-install"
+subpackages=""
+source="librespot-$pkgver.tar.gz::https://github.com/plietar/librespot/archive/$_sha.tar.gz
+ $pkgname.pre-install
+ $pkgname.initd
+ $pkgname.confd
+ "
+builddir="$srcdir/librespot-$_sha"
+
+build() {
+ cd "$builddir"
+ export CARGO_HOME="$srcdir"/cargo
+ export RUSTFLAGS="-C target-feature=-crt-static"
+ cargo build \
+ --release \
+ --verbose \
+ --features alsa-backend
+}
+
+package() {
+ cd "$builddir"
+ install -Dm755 target/release/librespot "$pkgdir"/usr/bin/librespot
+ install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+}
+
+sha512sums="d50dd3b997061cfc7dac424e4a3413a1dff1289af7c537c76555e97c8a80b1e49a7d35a462c2228efd2b1d749285b789856b52c37b1566424802d831d995dd84 librespot-20170413.tar.gz
+05cc45f92fc609caded9d2fd552903d1aee8e62375aab57036c36c4914561b519df948924d2ab28a841a4bdabdac4a01219024249be39de26a9f520d2f69cdba librespot.pre-install
+30ad41a32cb82cae3e9df319d69aebf8149e2fae8746747c167b8e93119f07081111bc6f0245f23b3059db41caa0f6dffd9b22c7791df518d092888e79862dde librespot.initd
+4286a3d1cc9678af2f43074c30a0ab7a9f686301468a0fd435d37a62773f0d1501b7201851bef4237324a83361ad93531ceb512a42ee0a63d4d14677760f5ec5 librespot.confd"
diff --git a/testing/librespot/librespot.confd b/testing/librespot/librespot.confd
new file mode 100644
index 0000000000..ea74e31792
--- /dev/null
+++ b/testing/librespot/librespot.confd
@@ -0,0 +1 @@
+librespot_args=""
diff --git a/testing/librespot/librespot.initd b/testing/librespot/librespot.initd
new file mode 100644
index 0000000000..f4ed8777ca
--- /dev/null
+++ b/testing/librespot/librespot.initd
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+
+command=/usr/bin/librespot
+command_args="${librespot_args}"
+pidfile=/run/librespot.pid
+command_background=true
+logfile="/var/log/librespot.log"
+start_stop_daemon_args="--user ${librespot_user:-librespot} --group ${librespot_group:-librespot} --stdout $logfile --stderr $logfile"
+
+depends() {
+ need localmount net
+ before firewall
+}
diff --git a/testing/librespot/librespot.pre-install b/testing/librespot/librespot.pre-install
new file mode 100644
index 0000000000..c8c0e047b4
--- /dev/null
+++ b/testing/librespot/librespot.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+adduser -S -D -H -s /sbin/nologin -G audio -g audio clamav 2>/dev/null
+
+exit 0