jna/generate-tarball.sh
Petr Šabata aefd102bb0 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/jna#82a0a123311fb18e15ac6dc722a3f6628951199e
2020-10-15 14:19:13 +02:00

29 lines
922 B
Bash
Executable File

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