summaryrefslogtreecommitdiffstats
path: root/abs/extra/shairplay/PKGBUILD
blob: 32840e91872fe6936188b7b2c92b5eff3a4b5472 (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
# $Id$
# Maintainer: BlackIkeEagle <ike DOT devolder AT gmail DOT com>
# Contributor: winlu

pkgname=shairplay
_commit=ce80e00
pkgver=20160101.ce80e00
pkgrel=1
pkgdesc='Apple airplay and raop protocol server'
arch=('x86_64')
url='https://github.com/juhovh/shairplay'
license=('custom')
depends=('libao')
optdepends=('avahi: to run the server')
makedepends=('git')
source=(
    "$pkgname::git://github.com/juhovh/shairplay.git#commit=$_commit"
	'shairplay.service'
)
sha256sums=('SKIP'
	'f0a176539a6c5be46dc832d054be2f18c3256e5fd34c5f1416c9463bd75c82b3')

pkgver() {
	cd "$pkgname"
	git log -1 --date=short --format="%cd.%h" | tr -d '-'
}

build() {
	cd "$pkgname"

	# installing airport.key to /etc/shairplay/
	sed 's/airport.key/\/etc\/shairplay\/airport.key/' -i "$srcdir/$pkgname"/src/shairplay.c

	./autogen.sh
	./configure --prefix=/usr/
	make
}


package() {
	cd "$pkgname"
	make DESTDIR="$pkgdir" install

	# install systemd service file
	install -Dm644 "$srcdir/shairplay.service" "$pkgdir/usr/lib/systemd/system/shairplay.service"

	# install key file
	install -Dm644 airport.key "$pkgdir/etc/shairplay/airport.key"

	# install license file
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

	# install documentation
	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}