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