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