# Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>

pkgname=shairport-sync
pkgver=2.4
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)
license=(GPL)
backup=(etc/shairport-sync.conf)
install=shairport-sync.install
depends=(openssl avahi libsoxr popt alsa-lib libconfig libpulse)
source=(shairport-sync-$pkgver.zip::https://github.com/mikebrady/shairport-sync/archive/$pkgver.zip)
sha1sums=('38306dbad5916e60507cc112346151359fa93f17')

build() {
  cd shairport-sync-$pkgver

  autoreconf -i -f
  ./configure --prefix=/usr --with-alsa --with-pulseaudio --with-avahi --with-ssl=openssl --with-soxr --with-dns_sd --with-pkg-config --with-systemd --with-configfiles
  make
}

package() {
  cd shairport-sync-$pkgver
  make DESTDIR="$pkgdir" install
  install -D -m664 LICENSES "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  rm "$pkgdir"/etc/shairport-sync.conf.sample
}
