Blame SOURCES/generate-tarball.sh

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