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