#!/bin/bash # saxon-java # # Douglas Thrift # # $Id$ name=saxon-java version=8.9 revision=0 categories=(textproc java) description='XSLT 2.0 / XPath 2.0 / XQuery 1.0 processor for Java' url='http://saxon.sourceforge.net/' depends=('java/javavmwrapper') sources=(`name=saxon site_sourceforge saxonb${version//./-}j.zip saxon-resources${version//./-}.zip` saxon.sh.in) with=(jdom xom) without=(docs) [[ -n $with_jdom ]] && depends=(${depends[*]} 'java/jdom') [[ -n $with_xom ]] && depends=(${depends[*]} 'textproc/xom') function build() { cd $source || return $? install -dv $package/usr/{bin,share/java/classes} || return $? install -v -m 0644 !(saxon8-@(jdom|xom)).jar `[[ -n $with_jdom ]] && echo saxon8-jdom.jar` `[[ -n $with_xom ]] && echo saxon8-xom.jar` $package/usr/share/java/classes || return $? sed -e "s|%%SAXON_JARS%%|$(sed -e "s|$package||g" <<<`echo $package/usr/share/java/classes/*.jar`)|" saxon.sh.in > saxon.sh || return $? install -v saxon.sh $package/usr/bin/saxon || return $? ln -v $package/usr/bin/saxon $package/usr/bin/saxon-xquery || return $? if [[ -z $without_docs ]]; then cd $source/doc || return $? find . -type d -exec install -dv $package/usr/share/doc/$name/{} \; || return $? find . -type f -exec install -v -m 0644 {} $package/usr/share/doc/$name/{} \; || return $? cd $source/samples || return $? find . -type d -exec install -dv $package/usr/share/examples/$name/{} \; || return $? find . -type f -exec install -v -m 0644 {} $package/usr/share/examples/$name/{} \; || return $? fi }