# Template file for 'apache-fop'
pkgname=apache-fop
version=2.5
revision=2
wrksrc="fop-${version}"
build_wrksrc="fop"
hostmakedepends="openjdk8 apache-ant"
depends="virtual?java-runtime"
short_desc="Java print formatter driven by XSL formatting objects (XSL-FO)"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="http://xmlgraphics.apache.org/fop/"
distfiles="http://mirror.dkd.de/apache/xmlgraphics/fop/source/fop-${version}-src.tar.gz
 http://mirror.dkd.de/apache/xmlgraphics/fop/binaries/fop-${version}-bin.tar.gz"
checksum="783077318139d581d5f485566d1b08bfc576003c53cfbf5beaeba503a24b4005
 6a3c5f8915be5ef90fff202c818152d8252bb45b96d9c5d6550594903739e5ed"
conf_files="/etc/fop.conf"

do_build() {
	. /etc/profile.d/apache-ant.sh
	. /etc/profile.d/10_openjdk8.sh
	ant package
}
do_install() {
	local _prefix=usr/share/fop
	local _docs=usr/share/doc/fop-${version}

	vmkdir ${_prefix}
	vmkdir ${_docs}
	vmkdir ${_prefix}/build
	vcopy "build/fop*.jar" ${_prefix}/build
	vmkdir ${_prefix}/lib
	vcopy "lib/*" ${_prefix}/lib
	vmkdir ${_docs}/conf
	vcopy "conf/*" ${_docs}/conf
	vmkdir ${_docs}/examples
	vcopy "examples/*" ${_docs}/examples
	vmkdir ${_docs}/javadocs
	vcopy "../javadocs/*" ${_docs}/javadocs
	vcopy fop ${_prefix}
	vcopy fop.js ${_prefix}
	vcopy ../KEYS ${_docs}
	vcopy ../LICENSE ${_docs}
	vcopy ../NOTICE ${_docs}
	vcopy ../README ${_docs}
	vcopy ${FILESDIR}/README.void ${_docs}
	vconf ${FILESDIR}/fop.conf
	vmkdir usr/bin
	ln -sf /usr/share/fop/fop $DESTDIR/usr/bin/fop
}
