#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=libusb
pkgver=1.0.26
#_pkgver=1.0.26.r18.gff8fe939
pkgrel=03
pkgdesc="A cross-platform library to access USB devices w/o systemd - git version"
arch=(x86_64)
url="https://libusb.info/"
depends=(glibc libeudev)
makedepends=(automake autoconf)
provides=(libusb-1.0.so)
conflicts=(libusb-git)
#options=(debug)  ##  uncomment this line to have the debug pkg produced

source=(https://github.com/$pkgname/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.bz2)
#source=(https://github.com/$pkgname/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.bz2{,.asc})
#    libusb-1.0.26.tar.bz2 ... FAILED (the public key C68187379B23DE9EFC46651E2C80FF56C6830A0E is not trusted)

prepare() {
  cd $pkgname-$pkgver
  autoreconf -fiv
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

check() {
  make -k check -C $pkgname-$pkgver
}

package() {
  depends+=(libeudev)

  make DESTDIR="$pkgdir" install -C $pkgname-$pkgver
  install -vDm 644 $pkgname-$pkgver/{AUTHORS,ChangeLog,README} -t "$pkgdir/usr/share/doc/$pkgname/"

}

#---- license gpg-key sha256sums ----

license=(LGPL2.1)

sha256sums=(12ce7a61fc9854d1d2a1ffe095f7b5fac19ddba095c259e6067a46500381b5a5) # libusb-1.0.26.tar.bz2
#	37f1e6d18049c8771feea5b2c741777800333120d011b08e8c6ac02bb229ca82) # libusb-1.0.26.tar.bz2.asc
