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

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

license=('GPL2')

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

sha256sums=(e916ea9b79f9518560b9a187251a7c042442a9ecbce7f36be7908888605d0255 # libnftnl-1.2.3.tar.bz2
	4df271636116b55efd4945fd6fbc5a43f7bba309174180df7ab211264cd58606) # libnftnl-1.2.3.tar.bz2.sig
