#!/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=libpsl
pkgver=0.21.2
pkgrel=01
pkgdesc='Public Suffix List library'
url='https://github.com/rockdaboot/libpsl'
arch=('x86_64')
depends=('libidn2' 'libunistring')
makedepends=('libxslt' 'python' 'publicsuffix-list' 'gtk-doc')
provides=('libpsl.so')
source=(https://github.com/rockdaboot/libpsl/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz)

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

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --disable-static \
    --disable-dependency-tracking \
    --enable-man \
    --enable-gtk-doc \
    --enable-{builtin,runtime}=libidn2 \
    --with-psl-file=/usr/share/publicsuffix/effective_tld_names.dat \
    --with-psl-testfile=/usr/share/publicsuffix/test_psl.txt
  LC_CTYPE=en_US.UTF-8 make
}

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

package() {
  depends+=('libidn2.so' 'libunistring.so')

  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

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

license=('MIT')

sha256sums=(e35991b6e17001afa2c0ca3b10c357650602b92596209b7492802f3768a6285f) # libpsl-0.21.2.tar.gz


