# Contributor: Michael Zhou <zhoumichaely@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=jbig2dec
pkgver=0.20
pkgrel=0
pkgdesc="JBIG2 image compression format decoder"
options="!check" # Tests require python2
url="https://jbig2dec.com/"
arch="all"
license="AGPL-3.0-or-later"
makedepends="autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/ArtifexSoftware/jbig2dec/releases/download/$pkgver/jbig2dec-$pkgver.tar.gz"

# secfixes:
#   0.18-r0:
#     - CVE-2020-12268

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--without-libpng
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
74d40b4d5b21dcb2b6ed15de84e9ef292774783547d0a36c7185740f3fe34341665b4aa756369d27d158404f15f36f3edd2fd1a8187a196d08c9b06ab3d04101  jbig2dec-0.20.tar.gz
"
