summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 83aa93b63a5f765ab16c3ff22ba95de8af351a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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}/"

}