Fix build with jdk9

OBS-URL: https://build.opensuse.org/package/show/Java:packages/javacc?expand=0&rev=11
This commit is contained in:
Fridrich Strba 2017-09-18 16:27:29 +00:00 committed by Git OBS Bridge
parent 9c809bcf88
commit 5414369fc0
2 changed files with 8 additions and 10 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Sep 18 16:25:17 UTC 2017 - fstrba@suse.com
- Fix build with jdk9: specify java source and target 1.6
-------------------------------------------------------------------
Thu Jan 5 15:58:51 UTC 2017 - tchvatal@suse.com

View File

@ -29,10 +29,10 @@ Source2: jjdoc
Source3: jjtree
Patch0: javacc.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: java-devel
BuildRequires: xml-commons-apis
Requires: javapackages-tools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
@ -79,13 +79,8 @@ cp %{SOURCE3} jjtree
mv www/doc .
%build
for file in `find -name build.xml` ; do
if ! grep -q "javac.*source=" $file ; then
perl -p -i -e 's|<javac |<javac source=\"1.4\" |' $file
perl -p -i -e 's|<javadoc |<javadoc source=\"1.4" |' $file
fi
done
ant \
-Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
-Dversion=%{version} \
jar
@ -97,20 +92,18 @@ install -d -m 755 %{buildroot}%{_prefix}/bin
install -m 755 javacc jjdoc jjtree %{buildroot}%{_prefix}/bin
install -d -m 755 %{buildroot}%{_datadir}/%{name}
cp -pr examples %{buildroot}%{_datadir}/%{name}
%fdupes -s %{buildroot}%{_datadir}/%{name}
%files
%defattr(0644,root,root,0755)
%{_javadir}/*.jar
%doc LICENSE README
%defattr(0755,root,root,0755)
%{_bindir}/*
%files manual
%defattr(0644,root,root,0755)
%doc doc/*
%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}/
%changelog