Skip to content

Commit

Permalink
add java_min_classdataversion support
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jan 10, 2017
1 parent d76b9ce commit e9576b9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
19 changes: 15 additions & 4 deletions rpm-java-requires 100644 → 100755
Expand Up @@ -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
Expand All @@ -33,10 +47,7 @@ javaclassversion() {
return 1
fi

local v
for v in $classver; do
echo "java(ClassDataVersion) >= $v"
done
javaclassversionfilter $classver
return 0
}

Expand Down
2 changes: 1 addition & 1 deletion rpm-javadeps.patch
Expand Up @@ -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).
#
2 changes: 1 addition & 1 deletion rpm.spec
Expand Up @@ -51,7 +51,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM
Summary(uk.UTF-8): Менеджер пакетів від RPM
Name: rpm
Version: 5.4.15
Release: 38
Release: 39
License: LGPL v2.1
Group: Base
# http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.15-0.20140824.src.rpm
Expand Down

0 comments on commit e9576b9

Please sign in to comment.