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

pkgname=libmbim
pkgver=1.26.0
pkgrel=2
pkgdesc="MBIM modem protocol helper library"
arch=(x86_64)
url="https://www.freedesktop.org/wiki/Software/libmbim/"
license=(GPL2)
depends=(glib2 bash systemd)
makedepends=(gtk-doc python git help2man gobject-introspection)
provides=(libmbim-glib.so)
_commit=717067603d82c14452e70fa24cacb60ac7688685  # tags/1.26.0
source=("git+https://gitlab.freedesktop.org/mobile-broadband/libmbim.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
}
