#!/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=libnftnl
pkgver=1.2.6
pkgrel=01
pkgdesc='Netfilter library providing interface to the nf_tables subsystem'
url='https://netfilter.org/projects/libnftnl/'
depends=('libmnl')
source=("https://netfilter.org/projects/libnftnl/files/libnftnl-$pkgver.tar.xz"{,.sig})

prepare() {
  cd $pkgname-$pkgver
  # apply patch from the source array (should be a pacman feature)
  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    [[ $src = *.patch ]] || continue
    msg2 "Applying patch $src..."
    patch -Np1 < "../$src"
  done
}

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

check() {
  cd $pkgname-$pkgver
  make check
}

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

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=('GPL2')

validpgpkeys=('37D964ACC04981C75500FB9BD55D978A8A1420E4') # Netfilter Core Team

sha256sums=(ceeaea2cd92147da19f13a35a7f1a4bc2767ff897e838e4b479cf54b59c777f4  # libnftnl-1.2.6.tar.xz
	7ec8907c51bd9d127a19270b8b36406feddad82d39c2ffba5a5c76487b1a485f) # libnftnl-1.2.6.tar.xz.sig

##  e9a4d8a2b13a6190958cb86556c79bbf11b213ca96dc6ecfcfce6524742845eb  libnftnl-1.2.6-01-x86_64.pkg.tar.lz

