Blame SOURCES/generate-tarball.sh

220db9
#!/bin/bash
220db9
set -e
220db9
220db9
version=`grep Version: *spec | sed -e 's/Version:\s*\(.*\)/\1/'`
220db9
220db9
220db9
wget https://github.com/java-native-access/jna/archive/${version}.tar.gz -O jna-${version}.tar.gz
220db9
rm -rf jna-${version}
220db9
tar xf jna-${version}.tar.gz
220db9
#mv twall-jna-* jna-${version}
220db9
# remove bundled things with unknown licensing
220db9
rm -rvf jna-${version}/{dist/*,www,native/libffi}
220db9
# jars in lib/native subdir need to be present in tarball so
220db9
# that final jar can be built. They can be empty and then have no
220db9
# effect on resulting jar. One jar (depending on architecture) will
220db9
# be replaced with full content (containing libjnidispatch.so)
220db9
for njar in jna-${version}/lib/native/*.jar; do
220db9
    rm -v $njar
220db9
    touch empty
220db9
    jar cf $njar empty
220db9
    rm -f empty
220db9
done
220db9
220db9
find jna-${version} -iname '*jar' -size +1b -delete
220db9
find jna-${version} -name '*.class' -delete
220db9
220db9
tar cf jna-${version}-clean.tar jna-${version}
220db9
xz -9 jna-${version}-clean.tar