e36559
#!/bin/bash
e36559
set -e
e36559
e36559
name=antlr
e36559
version="$(sed -n 's/Version:\s*//p' *.spec)"
e36559
e36559
# RETRIEVE
e36559
wget "http://www.antlr2.org/download/antlr-${version}.tar.gz" -O "${name}-${version}.orig.tar.gz"
e36559
e36559
rm -rf tarball-tmp
e36559
mkdir tarball-tmp
e36559
cd tarball-tmp
e36559
tar xf "../${name}-${version}.orig.tar.gz"
e36559
e36559
# CLEAN TARBALL
e36559
# contain questionable things, such as csflex.exe
e36559
find -name '*.jar' -delete
e36559
find -name '*.class' -delete
e36559
find -name '*.exe' -delete
e36559
find -name '*.dll' -delete
e36559
find -name '*.so' -delete
e36559
e36559
tar cf "../${name}-${version}.tar.gz" *
e36559
cd ..
e36559
rm -r tarball-tmp "${name}-${version}.orig.tar.gz"