# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=libqrtr-glib
pkgver=1.0.0
pkgrel=1
pkgdesc="Qualcomm IPC Router protocol helper library"
arch=(x86_64)
url="https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib"
license=(GPL2)
depends=(glib2)
makedepends=(gtk-doc python git autoconf-archive gobject-introspection)
provides=(libqrtr-glib.so)
_commit=cfb383e8536d7a62cf833925ab396da456e673e2  # tags/1.0.0
source=("git+https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-rc/rc/;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib --disable-static --enable-gtk-doc \
    --enable-compile-warnings=yes
  make
}

check() {
  cd $pkgname
  make check
}

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