junit/generate-tarball.sh

24 lines
555 B
Bash
Raw Normal View History

2019-09-24 09:54:23 +00:00
#!/bin/bash
set -e
name=junit
version="$(sed -n 's/Version:\s*//p' *.spec)"
upstream_version="$(echo ${version} | echo ${version} | sed 's/~\|\(alpha\.\|beta\)\./\1-/g')"
# RETRIEVE
wget "https://github.com/${name}-team/${name}/archive/r${upstream_version}.tar.gz"
rm -rf tarball-tmp
mkdir tarball-tmp
pushd tarball-tmp
tar xf "../r${upstream_version}.tar.gz"
mv * ${name}-${version}
# CLEAN TARBALL
find -name '*.jar' -delete
find -name '*.class' -delete
tar czf "../${name}-${version}.tar.gz" *
popd
rm -r tarball-tmp "r${upstream_version}.tar.gz"