[packages/rpm/dev-5.4.17] add java_min_classdataversion support
qboosh
qboosh at pld-linux.org
Wed Feb 5 17:22:05 CET 2020
commit 65eb5f63db6780ab0ac02c40b71fa6a099a2060a
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Jan 10 18:05:17 2017 +0200
add java_min_classdataversion support
http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2017-January/025273.html
rpm-java-requires | 19 +++++++++++++++----
rpm-javadeps.patch | 2 +-
2 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/rpm-java-requires b/rpm-java-requires
old mode 100644
new mode 100755
index dc069c8..8bbac6f
--- a/rpm-java-requires
+++ b/rpm-java-requires
@@ -16,9 +16,23 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
# xsltproc for eclipse feature.xml
: ${xsltproc=/usr/bin/xsltproc}
+# "%define java_min_classdataversion 51.0" in spec to minimum version to be 51.0
+: ${MIN_CLASSDATAVERSION=}
+
# save $- state, to enable in functions
debug=$-
+javaclassversionfilter() {
+ if [ "$MIN_CLASSDATAVERSION" ]; then
+ set -- $* "$MIN_CLASSDATAVERSION"
+ fi
+
+ local v
+ for v in $*; do
+ echo "java(ClassDataVersion) >= $v"
+ done | sort -V | tail -n 1
+}
+
javaclassversion() {
set -$debug
local mode=$1; shift
@@ -33,10 +47,7 @@ javaclassversion() {
return 1
fi
- local v
- for v in $classver; do
- echo "java(ClassDataVersion) >= $v"
- done
+ javaclassversionfilter $classver
return 0
}
diff --git a/rpm-javadeps.patch b/rpm-javadeps.patch
index 9a88b49..3e8303c 100644
--- a/rpm-javadeps.patch
+++ b/rpm-javadeps.patch
@@ -20,7 +20,7 @@
-%__java_provides %{_rpmhome}/javadeps.sh --provides
-%__java_requires %{_rpmhome}/javadeps.sh --requires
+%__java_provides %{nil}
-+%__java_requires env RPM_BUILD_ROOT=%{buildroot} %{_rpmhome}/java-find-requires
++%__java_requires env RPM_BUILD_ROOT=%{buildroot} MIN_CLASSDATAVERSION=%{?java_min_classdataversion} %{_rpmhome}/java-find-requires
# The value of CLASSPATH in build scriptlets (iff configured).
#
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/cffb64ba2db7b311147604c09b2ed00ea8974d6d
More information about the pld-cvs-commit
mailing list