diff options
author | crystaly | 2016-03-03 18:24:38 +0100 |
---|---|---|
committer | crystaly | 2016-03-03 18:24:38 +0100 |
commit | eebb9ee0008f5a935d9cc9b08462b4409f6313d6 (patch) | |
tree | 039eb8823ce51dd923f8dae2d00da99e4a80162c | |
download | aur-eebb9ee0008f5a935d9cc9b08462b4409f6313d6.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | 0001-Fix-0.8.patch | 25 | ||||
-rw-r--r-- | PKGBUILD | 72 | ||||
-rw-r--r-- | spotify-connect-web.install | 26 | ||||
-rw-r--r-- | spotify-connect-web@.service | 12 |
5 files changed, 166 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..4cfb35ec4bc4 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,31 @@ +pkgbase = spotify-connect-web + pkgdesc = Simple Web client for accessing Spotify connect api (Raspberry Pi 2) + pkgver = r57.ef8430d + pkgrel = 1 + url = https://github.com/chukysoria/spotify-connect-web + install = spotify-connect-web.install + arch = armv7h + license = unknown + makedepends = git + depends = python2-flask + depends = python2-flask-bootstrap + depends = python2-pyalsaaudio + depends = python2-gevent + depends = python2-cffi + depends = python2-pycparser + depends = python2 + provides = spotify-connect-web + conflicts = spotify-connect-web + source = git+https://github.com/chukysoria/spotify-connect-web#branch=master + source = https://github.com/sashahilton00/spotify-connect-resources/raw/master/armhf%20version/libspotify_embedded_shared.so + source = spotify-connect-web@.service + source = spotify-connect-web.install + source = 0001-Fix-0.8.patch + sha256sums = SKIP + sha256sums = 05a1d441fee75bae6d6b8c94538389e232bea79133cda673e780ca3b97e6a95d + sha256sums = 44f94e2e9cfc2fad0a1e3318a222d0e461af3d2c70579ca95491593de5a08b9b + sha256sums = 876ca4593670c1ca9b968e93413b90f51b4d10c325a7dbb313052037e6a9888c + sha256sums = 5cf33136d33b756e9ed55f92d579d4056df3338b58977d058e29b6c63865fba6 + +pkgname = spotify-connect-web + diff --git a/0001-Fix-0.8.patch b/0001-Fix-0.8.patch new file mode 100644 index 000000000000..cf3fd4e4237e --- /dev/null +++ b/0001-Fix-0.8.patch @@ -0,0 +1,25 @@ +From 1595b61cee8c5c9df1105f33e3709d6efae41c38 Mon Sep 17 00:00:00 2001 +From: oschwede <oschwede@pi.local> +Date: Thu, 3 Mar 2016 17:12:27 +0100 +Subject: [PATCH 1/1] Fix 0.8 + +--- + console_callbacks.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/console_callbacks.py b/console_callbacks.py +index cfe3448..a013c6d 100644 +--- a/console_callbacks.py ++++ b/console_callbacks.py +@@ -48,7 +48,7 @@ class AlsaSink: + pcm = alsa.PCM( + type = alsa.PCM_PLAYBACK, + mode = alsa.PCM_NORMAL, +- card = self._args.device) ++ card = str(self._args.device)) + + pcm.setchannels(CHANNELS) + pcm.setrate(RATE) +-- +2.7.2 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..83aa93b63a5f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: crystaly <crystaly@posteo.de> +pkgname=spotify-connect-web +pkgver=r57.ef8430d +pkgrel=1 +pkgdesc="Simple Web client for accessing Spotify connect api (Raspberry Pi 2)" +arch=('armv7h') +url="https://github.com/chukysoria/spotify-connect-web" +license=('unknown') +groups=() +depends=('python2-flask' 'python2-flask-bootstrap' 'python2-pyalsaaudio' 'python2-gevent' 'python2-cffi' 'python2-pycparser' 'python2') +makedepends=('git') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +replaces=() +backup=() +options=() +install="${pkgname}.install" +source=('git+https://github.com/chukysoria/spotify-connect-web#branch=master' + 'https://github.com/sashahilton00/spotify-connect-resources/raw/master/armhf%20version/libspotify_embedded_shared.so' + 'spotify-connect-web@.service' + 'spotify-connect-web.install' + '0001-Fix-0.8.patch') +noextract=() +sha256sums=('SKIP' + '05a1d441fee75bae6d6b8c94538389e232bea79133cda673e780ca3b97e6a95d' + '44f94e2e9cfc2fad0a1e3318a222d0e461af3d2c70579ca95491593de5a08b9b' + '876ca4593670c1ca9b968e93413b90f51b4d10c325a7dbb313052037e6a9888c' + '5cf33136d33b756e9ed55f92d579d4056df3338b58977d058e29b6c63865fba6') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + + # Git, no tags available + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "$srcdir/${pkgname%-git}" + + # merge pull-request wich fixes alsaaudio + git merge ef8430d + + # patch pyalsaaudio 0.8 + patch -p1 -i "$srcdir/0001-Fix-0.8.patch" + + # replace python by python2 + sed -i 's|^#!/usr/bin/env python$|#!/usr/bin/env python2|g' *.py + +} + +build() { + cd "$srcdir/${pkgname%-git}" + python2 -m compileall *.py +} + +package() { + cd "$srcdir/${pkgname%-git}" + + # copy libspotify.so to /usr/lib + install -D -m644 "$srcdir/libspotify_embedded_shared.so" "${pkgdir}/usr/lib/libspotify_embedded_shared.so" + + # copy app files + install -d -m755 "${pkgdir}/usr/lib/${pkgname}" + install -D -m 644 *.py *.pyc *.h "${pkgdir}/usr/lib/${pkgname}" + + install -D -m644 "$srcdir/spotify-connect-web@.service" "${pkgdir}/usr/lib/systemd/system/spotify-connect-web@.service" + + # copy static files + cp -r static "${pkgdir}/usr/lib/${pkgname}/" + cp -r templates "${pkgdir}/usr/lib/${pkgname}/" + +} diff --git a/spotify-connect-web.install b/spotify-connect-web.install new file mode 100644 index 000000000000..094d0b4a720c --- /dev/null +++ b/spotify-connect-web.install @@ -0,0 +1,26 @@ + +post_upgrade() { + # compile cffi + cd /usr/lib/spotify-connect-web/ + python2 -c "from connect_ffi import ffi, lib" + + systemctl daemon-reload +} + +# arg 1: the new package version +post_install() { + + # do something here + echo "Choose a user to run spotify-connect-web as." + echo "Obtain a binary appkey from https://developer.spotify.com/my-account/keys and put it into users home under ~/.config/spotify-connect-web/" + echo "Start via: systemctl start spotify-connect-web@username" + echo "Login to spotify on localhost:4000" + echo "Login has to be done only once, a binary credential blob is used afterwards (~/.config/spotify-connect-web/credentials.json)" + + post_upgrade +} + +pre_remove(){ + systemctl stop spotify-connect-web@*.service + rm -rf /usr/lib/spotify-connect-web/__pycache__ +} diff --git a/spotify-connect-web@.service b/spotify-connect-web@.service new file mode 100644 index 000000000000..0b2dc1a3812e --- /dev/null +++ b/spotify-connect-web@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Simple web client for spotify connect +Documentation=https://github.com/chukysoria/spotify-connect-web +After=network.target + +[Service] +User=%i +ExecStart=/usr/bin/python2 /usr/lib/spotify-connect-web/main.py --key ${HOME}/.config/spotify-connect-web/spotify_appkey.key --credentials ${HOME}/.config/spotify-connect-web/credentials.json --bitrate 320 --name "SpotifyConnectWeb" +#Restart=on-failure + +[Install] +WantedBy=multi-user.target |