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

pkgname=libqmi
pkgver=1.30.2
pkgrel=1
pkgdesc="QMI modem protocol helper library"
arch=(x86_64)
url="https://www.freedesktop.org/wiki/Software/libqmi/"
license=(GPL2)
depends=(libmbim libqrtr-glib libgudev)
makedepends=(gtk-doc python git help2man gobject-introspection)
provides=(libqmi-glib.so)
_commit=4831d54483ee7e517068dee189f489d3eed1cd81  # tags/1.30.2
source=("git+https://gitlab.freedesktop.org/mobile-broadband/libqmi.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
}
