# Contributor: Michael Zhou <zhoumichaely@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
setvar pkgname = 'jbig2dec'
setvar pkgver = '0.13'
setvar pkgrel = '0'
setvar pkgdesc = ""JBIG2 image compression format decoder""
setvar url = ""http://www.ghostscript.com/jbig2dec.html""
setvar arch = ""all""
setvar license = ""GPL2+""
setvar depends = """"
setvar depends_dev = """"
setvar makedepends = ""$depends_dev autoconf automake libtool""
setvar install = """"
setvar subpackages = ""$pkgname-dev $pkgname-doc""
setvar source = ""http://downloads.ghostscript.com/public/jbig2dec/jbig2dec-$pkgver.tar.gz""

setvar _builddir = ""$srcdir/$pkgname-$pkgver""
proc prepare {
	local i
	cd $_builddir
	for i in $source {
		case (i) {
		*.patch { msg $i; patch -p1 -i "$srcdir"/$i || return 1}
		}
	}
	autoreconf -vif
}

proc build {
	cd $_builddir
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		|| return 1
	make || return 1
}

proc package {
	cd $_builddir
	make DESTDIR="$pkgdir" install || return 1
}

setvar md5sums = ""6efc70db0017516e11913280990623fb  jbig2dec-0.13.tar.gz""
setvar sha256sums = ""5aaca0070992cc2e971e3bb2338ee749495613dcecab4c868fc547b4148f5311  jbig2dec-0.13.tar.gz""
setvar sha512sums = ""ef64a65c54bec65f61602de7130dc9594aae58aaea7958f7cc987f25d0794511e15a423e86501ace4f40c0364796fb97ceab72edb0b69232926767ba16c1b05d  jbig2dec-0.13.tar.gz""