7f4ab7
#!/bin/bash
7f4ab7
set -e
7f4ab7
7f4ab7
name=bsh
7f4ab7
version="$(sed -n 's/Version:\s*//p' *.spec)"
7f4ab7
reltag="$(sed -n 's/%global\s*reltag\s*//p' *.spec)"
7f4ab7
7f4ab7
# RETRIEVE
7f4ab7
wget "https://github.com/beanshell/beanshell/archive/${version}${reltag}.tar.gz" -O "${name}-${version}-${reltag}.orig.tar.gz"
7f4ab7
7f4ab7
rm -rf tarball-tmp
7f4ab7
mkdir tarball-tmp
7f4ab7
cd tarball-tmp
7f4ab7
tar xf "../${name}-${version}-${reltag}.orig.tar.gz"
7f4ab7
7f4ab7
# CLEAN TARBALL
7f4ab7
rm -r */lib
7f4ab7
find -name '*.jar' -delete
7f4ab7
find -name '*.class' -delete
7f4ab7
# Files marked as SUN PROPRIETARY/CONFIDENTAIL
7f4ab7
rm -r */engine/javax-src
7f4ab7
7f4ab7
tar cf "../${name}-${version}-${reltag}.tar.gz" *
7f4ab7
cd ..
7f4ab7
rm -r tarball-tmp "${name}-${version}-${reltag}.orig.tar.gz"