10d1ac
#!/bin/bash
10d1ac
set -e
10d1ac
10d1ac
name=qdox
10d1ac
version="$(sed -n 's/Version:\s*//p' *.spec)"
10d1ac
10d1ac
# RETRIEVE
10d1ac
wget "http://repo2.maven.org/maven2/com/thoughtworks/qdox/qdox/${version/'~'/'-'}/${name}-${version/'~'/'-'}-project.tar.gz" -O "${name}-${version}.orig.tar.gz"
10d1ac
10d1ac
rm -rf tarball-tmp
10d1ac
mkdir tarball-tmp
10d1ac
cd tarball-tmp
10d1ac
tar xf "../${name}-${version}.orig.tar.gz"
10d1ac
10d1ac
# CLEAN TARBALL
10d1ac
find -name '*.jar' -delete
10d1ac
find -name '*.class' -delete
10d1ac
# contains possibly proprietary binaries of YACC
10d1ac
rm -r */bootstrap
10d1ac
10d1ac
tar cf "../${name}-${version}.tar.gz" *
10d1ac
cd ..
10d1ac
rm -r tarball-tmp "${name}-${version}.orig.tar.gz"