Skip to content

Instantly share code, notes, and snippets.

@EliaCereda
Last active August 29, 2015 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EliaCereda/0746809ab18e37dec7a8 to your computer and use it in GitHub Desktop.
Save EliaCereda/0746809ab18e37dec7a8 to your computer and use it in GitHub Desktop.
shairport-sync-git Arch Linux package
# Maintainer: Elia Cereda <eliacereda+arch at gmail dot com>
pkgname=shairport-sync-git
pkgver=2.1.15.r1.gcf6594d
pkgrel=1
pkgdesc='Emulates an AirPort Express for the purpose of streaming music from iTunes and compatible iPods and iPhones'
url='https://github.com/mikebrady/shairport-sync'
arch=(i686 x86_64 armv6h armv7h)
license=('custom')
backup=(etc/conf.d/shairport-sync)
install='shairport-sync.install'
depends=(alsa-lib libdaemon openssl avahi popt libsoxr)
makedepends=(git)
source=("git+https://github.com/mikebrady/shairport-sync.git#branch=2.1"
shairport-sync.install
shairport-sync.service
shairport-sync.conf
remove-init.d.patch)
sha1sums=('SKIP'
'd51485f3857529b70a29b38814ea60e7dde54ca8'
'fe62feeef1c947ed6ed3500b7b922dcaf9e8987c'
'6c4979abddb4b1c0242a941279d41617ab8d183c'
'83ddd76fdb548bf6321e38ff7cabe14bf2bb35d4')
pkgver() {
cd shairport-sync
git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
}
prepare() {
cd shairport-sync
git apply "$srcdir/remove-init.d.patch"
}
build() {
cd shairport-sync
autoreconf -i -f
./configure --with-alsa --with-avahi --with-ssl=openssl --with-soxr --prefix="$pkgdir/usr"
make
}
package() {
install -D -m644 shairport-sync.service "$pkgdir/usr/lib/systemd/system/shairport-sync.service"
install -D -m644 shairport-sync.conf "$pkgdir/etc/conf.d/shairport-sync"
cd shairport-sync
install -D -m664 LICENSES "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
make install
}
diff -aur shairport-sync/Makefile.am shairport-sync.patched/Makefile.am
--- shairport-sync/Makefile.am 2014-11-16 23:06:34.129763472 +0100
+++ shairport-sync.patched/Makefile.am 2014-11-16 23:07:53.849732815 +0100
@@ -35,7 +35,3 @@
if USE_DNS_SD
shairport_sync_SOURCES += mdns_dns_sd.c
endif
-
-install-exec-hook:
- [ -f /etc/init.d/shairport-sync ] || cp scripts/shairport-sync /etc/init.d/
- update-rc.d shairport-sync defaults 90 10
# shairport-sync daemon options
SHAIRPORT_ARGS=""
post_install() {
getent group shairport-sync &>/dev/null || groupadd -r shairport-sync >/dev/null
getent passwd shairport-sync &> /dev/null || useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync >/dev/null
true
}
post_remove() {
# Ensure that shairport-sync is not running
systemctl stop shairport-sync &>/dev/null
getent passwd shairport-sync &>/dev/null && userdel shairport-sync >/dev/null
getent group shairport-sync &>/dev/null && groupdel shairport-sync >/dev/null
true
}
[Unit]
Description=Shairport-sync AirTunes receiver
After=sound.target
Requires=avahi-daemon.service
After=avahi-daemon.service
[Service]
ExecStart=/usr/bin/shairport-sync "$SHAIRPORT_ARGS"
User=shairport-sync
Group=shairport-sync
EnvironmentFile=/etc/conf.d/shairport-sync
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment