aqute-bnd/generate-tarball.sh
2023-06-29 11:16:56 +02:00

33 lines
770 B
Bash

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