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