# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ignacio Galmarino <igalmarino@gmail.com>

pkgname=openresolv
pkgver=3.13.2
pkgrel=2
pkgdesc="resolv.conf management framework (resolvconf)"
url="https://roy.marples.name/projects/openresolv"
arch=(any)
license=(custom:BSD)
provides=(resolvconf)
conflicts=(resolvconf)
depends=(bash)
makedepends=(
  git
  systemd
)
backup=(etc/resolvconf.conf)
_commit=867a412d63a28d2c4978e02fc44fb8013f46d356  # tags/v3.13.2^0
source=("git+https://github.com/NetworkConfiguration/openresolv#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  local configure_options=(
    --prefix=/usr
    --sysconfdir=/etc
    --libexecdir=/usr/lib/resolvconf
    --sbindir=/usr/bin
  )

  cd $pkgname
  ./configure "${configure_options[@]}"
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE
}

# vim:set sw=2 sts=-1 et:
