bcdf8c
#!/bin/bash
bcdf8c
bcdf8c
set -e
bcdf8c
bcdf8c
# This commit refers to the state of the sources when they were published to
bcdf8c
# Maven Central
bcdf8c
git_tag='dcf154b6d40dd3865e317de7250b7019044543a9'
bcdf8c
version="$(sed -n 's/Version:\s*//p' *.spec)"
bcdf8c
bcdf8c
# Retrieve and set version
bcdf8c
git clone https://github.com/cbeust/jcommander.git
bcdf8c
bcdf8c
pushd jcommander
bcdf8c
git reset --hard "${git_tag}"
bcdf8c
bcdf8c
# Clean
bcdf8c
find -name '*.jar' -delete
bcdf8c
find -name '*.class' -delete
bcdf8c
rm -rf gradle* kobalt* lib
bcdf8c
rm -rf .git
bcdf8c
popd
bcdf8c
bcdf8c
# Pack into tarball
bcdf8c
mv jcommander beust-jcommander-"${version}"
bcdf8c
tar -cvf beust-jcommander-"${version}".tar.gz beust-jcommander-"${version}"/
bcdf8c
rm -rf beust-jcommander-"${version}"