summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1146ed8394cc8de82b5cdb58e7e7a36c1a391d7a (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
# Maintainer: robertfoster

pkgname=jacklistener-git
pkgver=r51.2e73f72
pkgrel=1
pkgdesc="Jack Listener Daemon (jack-sensing)"
arch=('i686' 'x86_64')
url="https://github.com/gentoo-root/jacklistener"
license=('GPL3')
depends=('dbus' 'udev')
optdepends=("jackeventcmd-git: Run custom commands when headphones are (un)plugged"
  "jacknotifier-git: Headphones Jack Notification Daemon"
  "musicpaused-git: Pause music when headphones are unplugged"
)
makedepends=('git' 'uthash')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
source=("${pkgname%-git}::git+${url}")

prepare() {
  cd "${srcdir}/${pkgname%-git}"
  sed 's#AM_CONFIG_HEADER#AC_CONFIG_HEADERS#g' -i configure.ac
}

build() {
  cd "${srcdir}/${pkgname%-git}"

  libtoolize
  aclocal -I m4
  autoheader
  automake --add-missing
  autoconf
  ./configure --prefix=/usr --sbindir=/usr/bin \
    --sysconfdir=/etc --enable-systemd \
    --enable-arch --enable-udev
  make
}

package() {
  cd "${srcdir}/${pkgname%-git}"
  make DESTDIR="${pkgdir}" install
  sed -i 's/sbin/bin/g' "${pkgdir}/usr/lib/systemd/system/jacklistener.service"
  install -D init.d/jacklistener-runscript "${pkgdir}/usr/bin/jacklistenerd-runscript"
  install -D jacklistenerd "${pkgdir}/usr/lib/jacklistener/jacklistenerd"
}

pkgver() {
  cd "${srcdir}/${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

sha256sums=('SKIP')