From 3662b2d6db083e6bd7b417ba9c9f02980fa63e82 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Mon, 27 Oct 2014 14:58:17 +0100 Subject: [PATCH] Fix FTBFS (Resolves: rhbz#1106636) - Adapt to current packaging guidelines --- glassfish-jaxb-fix-java8-compatibility.patch | 43 +++++++++++++++++++ glassfish-jaxb.spec | 44 +++++++------------- 2 files changed, 59 insertions(+), 28 deletions(-) create mode 100644 glassfish-jaxb-fix-java8-compatibility.patch diff --git a/glassfish-jaxb-fix-java8-compatibility.patch b/glassfish-jaxb-fix-java8-compatibility.patch new file mode 100644 index 0000000..1f1e4cf --- /dev/null +++ b/glassfish-jaxb-fix-java8-compatibility.patch @@ -0,0 +1,43 @@ +diff --git a/xjc/src/com/sun/tools/jxc/model/nav/ApNavigator.java b/xjc/src/com/sun/tools/jxc/model/nav/ApNavigator.java +index f1d3745..3a16a1c 100644 +--- a/xjc/src/com/sun/tools/jxc/model/nav/ApNavigator.java ++++ b/xjc/src/com/sun/tools/jxc/model/nav/ApNavigator.java +@@ -47,6 +47,7 @@ import com.sun.xml.bind.v2.model.nav.Navigator; + import com.sun.xml.bind.v2.runtime.Location; + + import javax.annotation.processing.ProcessingEnvironment; ++import javax.lang.model.element.AnnotationMirror; + import javax.lang.model.element.Element; + import javax.lang.model.element.ElementKind; + import javax.lang.model.element.ExecutableElement; +@@ -66,6 +67,8 @@ import javax.lang.model.util.ElementFilter; + import javax.lang.model.util.Elements; + import javax.lang.model.util.SimpleTypeVisitor6; + import javax.lang.model.util.Types; ++ ++import java.lang.annotation.Annotation; + import java.util.Collection; + import java.util.HashMap; + import java.util.HashSet; +@@ -387,6 +390,21 @@ public class ApNavigator implements Navigator T[] getAnnotationsByType(Class annotationClass) { ++ throw new IllegalStateException(); ++ } ++ ++ @Override ++ public A getAnnotation(Class annotationType) { ++ throw new IllegalStateException(); ++ } ++ ++ @Override ++ public List getAnnotationMirrors() { ++ throw new IllegalStateException(); ++ } + }; + + public Location getClassLocation(TypeElement typeElement) { diff --git a/glassfish-jaxb.spec b/glassfish-jaxb.spec index d6f43cd..08ec655 100644 --- a/glassfish-jaxb.spec +++ b/glassfish-jaxb.spec @@ -1,6 +1,6 @@ Name: glassfish-jaxb Version: 2.2.5 -Release: 7%{?dist} +Release: 8%{?dist} Summary: JAXB Reference Implementation Group: Development/Libraries @@ -50,6 +50,9 @@ Patch6: %{name}-dont-use-prebuilt-javadocs.patch # Don't build the examples as they need additional dependencies: Patch7: %{name}-dont-build-examples.patch +# Fix Java 8 compatibility +Patch8: %{name}-fix-java8-compatibility.patch + BuildArch: noarch BuildRequires: jpackage-utils @@ -107,6 +110,7 @@ This package contains the API documentation for %{name}. # Unpack the sources: %setup -q + # Put the POM files in place (we do this before patching because we need to # patch the POMs in order to add the dependencies for the artifacts that we are # not bundling): @@ -122,6 +126,7 @@ cp %{SOURCE2} jaxb-xjc.pom %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # Link the libraries where the build script expects them: ln -s $(build-classpath codemodel) tools/lib/rebundle/compiler/codemodel.jar @@ -137,7 +142,7 @@ ln -s $(build-classpath relaxngDatatype) tools/lib/rebundle/runtime/relaxngDatat ln -s $(build-classpath istack-commons-runtime) tools/lib/rebundle/runtime2/istack-commons-runtime.jar ln -s $(build-classpath txw2) tools/lib/rebundle/runtime2/txw2.jar ln -s $(build-classpath jaxb-api) tools/lib/redist/jaxb-api.jar -ln -s $(build-classpath FastInfoset) tools/lib/util/FastInfoset.jar +ln -s $(build-classpath glassfish-fastinfoset) tools/lib/util/FastInfoset.jar ln -s $(build-classpath args4j) tools/lib/util/args4j.jar ln -s $(build-classpath codemodel-annotation-compiler) tools/lib/util/codemodel-annotation-compiler.jar ln -s $(build-classpath dom4j) tools/lib/util/dom4j.jar @@ -166,43 +171,26 @@ ant \ %install +%mvn_artifact jaxb-impl.pom dist/lib/jaxb-impl.jar +%mvn_artifact jaxb-xjc.pom dist/lib/jaxb-xjc.jar -# Jar files: -install -d -m 755 %{buildroot}%{_javadir}/%{name} -install -m 644 dist/lib/jaxb-impl.jar %{buildroot}%{_javadir}/%{name}/jaxb-impl.jar -install -m 644 dist/lib/jaxb-xjc.jar %{buildroot}%{_javadir}/%{name}/jaxb-xjc.jar -install -m 644 tools/pretty-printer/build/pretty-printer.jar %{buildroot}%{_javadir}/%{name}/pretty-printer.jar -install -m 644 tools/xmllint/build/xmllint.jar %{buildroot}%{_javadir}/%{name}/xmllint.jar +%mvn_install -J apidocs/ -# POM files: -install -d -m 755 %{buildroot}%{_mavenpomdir} -install -m 644 jaxb-impl.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-jaxb-impl.pom -install -m 644 jaxb-xjc.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-jaxb-xjc.pom - -# Javadoc files: -install -d -m 755 %{buildroot}%{_javadocdir}/%{name} -cp -rp apidocs/* %{buildroot}%{_javadocdir}/%{name}/. - -# Dependencies map: -%add_maven_depmap JPP.%{name}-jaxb-impl.pom %{name}/jaxb-impl.jar -%add_maven_depmap JPP.%{name}-jaxb-xjc.pom %{name}/jaxb-xjc.jar - - -%files -%{_mavenpomdir}/* -%{_mavendepmapfragdir}/* -%{_javadir}/* +%files -f .mfiles %doc License.txt %doc License.html -%files javadoc -%{_javadocdir}/%{name} +%files javadoc -f .mfiles-javadoc %doc License.txt %doc License.html %changelog +* Mon Oct 27 2014 Michal Srb - 2.2.5-8 +- Fix FTBFS (Resolves: rhbz#1106636) +- Adapt to current packaging guidelines + * Sat Jun 07 2014 Fedora Release Engineering - 2.2.5-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild