c5bd88
#!/bin/bash
c5bd88
set -e
c5bd88
c5bd88
name=aqute-bnd
c5bd88
version="$(sed -n 's/Version:\s*//p' *.spec)"
c5bd88
c5bd88
# RETRIEVE
c5bd88
wget "https://github.com/bndtools/bnd/archive/${version}.REL.tar.gz" -O "${name}-${version}.orig.tar.gz"
c5bd88
c5bd88
rm -rf tarball-tmp
c5bd88
mkdir tarball-tmp
c5bd88
pushd tarball-tmp
c5bd88
tar -xf "../${name}-${version}.orig.tar.gz"
c5bd88
mv "bnd-${version}.REL" "${name}-${version}"
c5bd88
c5bd88
# CLEAN TARBALL
c5bd88
rm -rf "${name}-${version}/docs"
c5bd88
find -name '*.jar' -delete
c5bd88
find -name '*.class' -delete
c5bd88
find -name '*.ar' -delete
c5bd88
find -name '*.tar' -delete
c5bd88
find -name '*.gz' -delete
c5bd88
find -name '*.bz2' -delete
c5bd88
find -name '*.xz' -delete
c5bd88
find -name '*.zip' -delete
c5bd88
find -name '*.exe' -delete
c5bd88
find -name '*.dll' -delete
c5bd88
c5bd88
tar -czf "../${name}-${version}.tar.gz" *
c5bd88
popd
c5bd88
rm -r tarball-tmp "${name}-${version}.orig.tar.gz"