66c5a9
#!/bin/bash
66c5a9
set -e
66c5a9
66c5a9
name=easymock
66c5a9
version="$(sed -n 's/Version:\s*//p' *.spec)"
66c5a9
66c5a9
# RETRIEVE
66c5a9
wget "https://github.com/${name}/${name}/archive/${name}-${version}.tar.gz" -O "${name}-${version}.orig.tar.gz"
66c5a9
66c5a9
rm -rf tarball-tmp
66c5a9
mkdir tarball-tmp
66c5a9
cd tarball-tmp
66c5a9
tar xf "../${name}-${version}.orig.tar.gz"
66c5a9
66c5a9
# CLEAN TARBALL
66c5a9
find -name '*.jar' -delete
66c5a9
find -name '*.class' -delete
66c5a9
# Contains minified js of uncertain origin
66c5a9
rm -r */website
66c5a9
66c5a9
tar cf "../${name}-${version}.tar.gz" *
66c5a9
cd ..
66c5a9
rm -r tarball-tmp "${name}-${version}.orig.tar.gz"