# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=libasyncns
pkgver=%version%
pkgrel=%release%
epoch=1
pkgdesc="A C library for executing name service queries asynchronously"
url="https://0pointer.net/lennart/projects/libasyncns/"
arch=(x86_64)
license=(LGPL)
depends=(glibc)
makedepends=(git lynx)
_commit=68cd5aff1467638c086f1bedcc750e34917168e4  # master
source=("git+https://git.0pointer.net/clone/libasyncns.git#commit=$_commit")
sha256sums=('SKIP')

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

prepare() {
  cd libasyncns
  NOCONFIGURE=1 ./bootstrap.sh
}

build() {
  cd libasyncns
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
      --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

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

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