# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
setvar pkgname = 'qpdf'
setvar pkgver = '7.0.0'
setvar pkgrel = '0'
setvar pkgdesc = ""Command-line tools and library for transforming PDF files""
setvar url = ""http://qpdf.sourceforge.net/""
setvar arch = ""all""
setvar license = ""Artistic 2.0""
setvar depends = """"
# coreutils needed for tests
setvar makedepends = ""zlib-dev libjpeg-turbo-dev bash coreutils perl""
setvar install = """"
setvar subpackages = ""$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-fix-qdf:fix_qdf:noarch""
setvar source = ""http://downloads.sourceforge.net/sourceforge/qpdf/qpdf-$pkgver.tar.gz""

setvar builddir = ""$srcdir"/qpdf-$pkgver"

proc prepare {
	update_config_sub
	default_prepare
}

proc build {
	cd $builddir
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-static
	make
}

proc check {
	cd $builddir
	make check
}

proc package {
	cd $builddir
	make DESTDIR="$pkgdir" install
}

proc fix_qdf {
	setvar depends = ""qpdf perl""
	setvar pkgdesc = ""Repair PDF files in QDF form after editing""
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/fix-qdf "$subpkgdir"/usr/bin/
}

setvar sha512sums = ""7b52d67b4d2c428a7b0c1cd03b03a23f05d38d7e3c81041079a137919019ea5158f12bf95fdcfcff6b43ffdefe93a85127ced2a363a6b4b380cbaa02a3840256  qpdf-7.0.0.tar.gz""