# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=cups-filters
pkgver=2.0.0
pkgrel=2
pkgdesc="OpenPrinting CUPS Filters"
arch=('x86_64' 'aarch64')
url="https://wiki.linuxfoundation.org/openprinting/cups-filters"
license=('Apache-2.0 WITH LLVM-exception')
depends=('libcups' 'libppd' 'libcupsfilters' 'glibc' 'sh')
makedepends=('ghostscript' 'mupdf-tools')
source=(https://github.com/OpenPrinting/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.xz)
sha256sums=('b5152e3dd148ed73835827ac2f219df7cf5808dbf9dbaec2aa0127b44de800d8')

build() {
  cd "$pkgname"-$pkgver
  ./configure --prefix=/usr  \
    --sysconfdir=/etc \
    --sbindir=/usr/bin \
    --localstatedir=/var \
    --enable-avahi
  make
}

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

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

  # license
  mkdir -p "${pkgdir}"/usr/share/licenses/${pkgname}
  install -m644 "${srcdir}"/${pkgname}-${pkgver}/{COPYING,NOTICE} "${pkgdir}"/usr/share/licenses/${pkgname}/
}
