summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO25
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD46
-rw-r--r--librespot.conf10
-rw-r--r--librespot.service14
5 files changed, 99 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d66de825a41f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+# Generated by mksrcinfo v8
+# Mon Sep 5 20:28:06 UTC 2016
+pkgbase = librespot-git
+ pkgdesc = An open source client library for Spotify.
+ pkgver = 218.f79df63
+ pkgrel = 1
+ epoch = 1
+ url = https://github.com/plietar/librespot
+ arch = i686
+ arch = x86_64
+ license = MIT
+ makedepends = cargo
+ depends = rust
+ depends = protobuf
+ provides = librespot
+ conflicts = librespot
+ source = git+https://github.com/plietar/librespot
+ source = librespot.conf
+ source = librespot.service
+ sha1sums = SKIP
+ sha1sums = b9c3c0bb96ab42d9bbe9f61ab9d84486a511e776
+ sha1sums = 19348db822d42008fe0a3c55cb00c57fc54ebe5f
+
+pkgname = librespot-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..9ac4d09e9de7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/librespot/
+/pkg/
+/src/
+/*.pkg.tar.*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a30469c2c91f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Christoph Gysin <christoph.gysin@gmail.com>
+
+pkgname=librespot-git
+_pkgname=librespot
+pkgver=218.f79df63
+pkgrel=1
+epoch=1
+pkgdesc="An open source client library for Spotify."
+arch=('i686' 'x86_64')
+url="https://github.com/plietar/librespot"
+license=('MIT')
+depends=('rust' 'protobuf')
+makedepends=('cargo')
+provides=('librespot')
+conflicts=('librespot')
+source=('git+https://github.com/plietar/librespot'
+ 'librespot.conf'
+ 'librespot.service')
+sha1sums=('SKIP'
+ 'b9c3c0bb96ab42d9bbe9f61ab9d84486a511e776'
+ '19348db822d42008fe0a3c55cb00c57fc54ebe5f')
+
+pkgver()
+{
+ cd $_pkgname
+ echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
+}
+
+build()
+{
+ cd $_pkgname
+ cargo build \
+ --features pulseaudio-backend \
+ --release
+}
+
+package()
+{
+ install -D -m 755 $_pkgname/target/release/librespot \
+ "${pkgdir}"/usr/bin/librespot
+ install -d -m 755 "$pkgdir"/var/cache/librespot
+ install -D -m 640 librespot.conf \
+ "${pkgdir}"/etc/librespot.conf
+ install -D -m 644 librespot.service \
+ "${pkgdir}"/usr/lib/systemd/system/librespot.service
+}
diff --git a/librespot.conf b/librespot.conf
new file mode 100644
index 000000000000..38e922847872
--- /dev/null
+++ b/librespot.conf
@@ -0,0 +1,10 @@
+# Path to a directory where files will be cached
+LIBRESPOT_CACHE=/var/cache/librespot
+# Device name
+LIBRESPOT_NAME=librespot
+# Bitrate (96, 160 or 320)
+LIBRESPOT_BITRATE=320
+# Username to sign in with
+LIBRESPOT_USERNAME=
+# Password
+LIBRESPOT_PASSWORD=
diff --git a/librespot.service b/librespot.service
new file mode 100644
index 000000000000..4be50d2c1ef3
--- /dev/null
+++ b/librespot.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=An open source client library for Spotify
+
+[Service]
+EnvironmentFile=/etc/librespot.conf
+ExecStart=/usr/bin/librespot \
+ --cache ${LIBRESPOT_CACHE} \
+ --name ${LIBRESPOT_NAME} \
+ --bitrate ${LIBRESPOT_BITRATE} \
+ --username ${LIBRESPOT_USERNAME} \
+ --password ${LIBRESPOT_PASSWORD}
+
+[Install]
+WantedBy=default.target