f348e1
#!/bin/bash
f348e1
set -e
f348e1
f348e1
name=xalan-j2
f348e1
version="$(sed -n 's/Version:\s*//p' *.spec)"
f348e1
f348e1
# RETRIEVE
f348e1
wget "http://apache.miloslavbrada.cz/xalan/xalan-j/source/xalan-j_${version//./_}-src.tar.gz" -O "${name}-${version}.orig.tar.gz"
f348e1
f348e1
rm -rf tarball-tmp
f348e1
mkdir tarball-tmp
f348e1
cd tarball-tmp
f348e1
tar xf "../${name}-${version}.orig.tar.gz"
f348e1
f348e1
# CLEAN TARBALL
f348e1
find -name '*.jar' -delete
f348e1
find -name '*.class' -delete
f348e1
f348e1
tar czf "../${name}-${version}.tar.gz" *
f348e1
cd ..
f348e1
rm -r tarball-tmp "${name}-${version}.orig.tar.gz"