diff --git a/glassfish-jaxb.spec b/glassfish-jaxb.spec index 6d2391d..35e926f 100644 --- a/glassfish-jaxb.spec +++ b/glassfish-jaxb.spec @@ -1,12 +1,13 @@ Name: glassfish-jaxb Version: 2.2.11 -Release: 1%{?dist} +Release: 2%{?dist} Summary: JAXB Reference Implementation License: CDDL and GPLv2 with exceptions URL: http://jaxb.java.net Source0: https://jaxb.java.net/%{version}/jaxb-ri-%{version}.src.zip +Patch0: txw2-args4j.patch BuildRequires: maven-local BuildRequires: mvn(args4j:args4j) @@ -32,11 +33,137 @@ BuildRequires: mvn(org.jvnet.staxex:stax-ex) BuildRequires: mvn(relaxngDatatype:relaxngDatatype) BuildRequires: mvn(xmlunit:xmlunit) +Requires: glassfish-jaxb1-impl = %{version}-%{release} +Requires: %{name}-bom = %{version}-%{release} +Requires: %{name}-bom-ext = %{version}-%{release} +Requires: %{name}-codemodel = %{version}-%{release} +Requires: %{name}-codemodel-annotation-compiler = %{version}-%{release} +Requires: %{name}-codemodel-parent = %{version}-%{release} +Requires: %{name}-core = %{version}-%{release} +Requires: %{name}-external-parent = %{version}-%{release} +Requires: %{name}-jxc = %{version}-%{release} +Requires: %{name}-parent = %{version}-%{release} +Requires: %{name}-rngom = %{version}-%{release} +Requires: %{name}-runtime = %{version}-%{release} +Requires: %{name}-runtime-parent = %{version}-%{release} +Requires: %{name}-txw2 = %{version}-%{release} +Requires: %{name}-txwc2 = %{version}-%{release} +Requires: %{name}-txw-parent = %{version}-%{release} +Requires: %{name}-xjc = %{version}-%{release} + BuildArch: noarch %description GlassFish JAXB Reference Implementation. +%package codemodel +Summary: Codemodel Core + +%description codemodel +The core functionality of the CodeModel java source code generation +library. + +%package codemodel-annotation-compiler +Summary: Codemodel Annotation Compiler + +%description codemodel-annotation-compiler +The annotation compiler ant task for the CodeModel java source code +generation library. + +%package -n glassfish-jaxb1-impl +Summary: JAXB1 Runtime + +%description -n glassfish-jaxb1-impl +Runtime classes for JAXB1 runtime implementation. + +%package bom +Summary: JAXB BOM + +%description bom +JAXB Bill of Materials (BOM) + +%package bom-ext +Summary: JAXB BOM with all dependencies + +%description bom-ext +JAXB Bill of Materials (BOM) with all dependencies. + +%package codemodel-parent +Summary: Codemodel parent POM + +%description codemodel-parent +This package contains codemodel parent POM. + +%package core +Summary: JAXB Core + +%description core +JAXB Core module. Contains sources required by XJC, JXC and Runtime +modules. + +%package external-parent +Summary: JAXB External parent POM + +%description external-parent +JAXB External parent POM. + +%package jxc +Summary: JAXB schema generator + +%description jxc +The tool to generate XML schema based on java classes. + +%package parent +Summary: JAXB parent POM + +%description parent +This package contains parent POM. + +%package runtime +Summary: JAXB Runtime + +%description runtime +JAXB (JSR 222) Reference Implementation + +%package runtime-parent +Summary: JAXB Runtime parent POM + +%description runtime-parent +This package contains Runtime parent POM. + +%package txw-parent +Summary: JAXB TXW parent POM + +%description txw-parent +This package contains TXW parent POM. + +%package xjc +Summary: JAXB XJC + +%description xjc +JAXB Binding Compiler. Contains source code needed for binding +customization files into java sources. In other words: the tool to +generate java classes for the given xml representation. + +%package rngom +Summary: RELAX NG Object Model/Parser + +%description rngom +This package contains RELAX NG Object Model/Parser. + +%package txw2 +Summary: TXW2 Runtime + +%description txw2 +TXW is a library that allows you to write XML documents. + +%package txwc2 +Summary: TXW2 Compiler + +%description txwc2 +JAXB schema generator. The tool to generate XML schema based on java +classes. + %package javadoc Summary: Javadocs for %{name} @@ -45,8 +172,9 @@ This package contains the API documentation for %{name}. %prep %setup -q -c -# uses very old args4j -%pom_disable_module compiler txw + +%patch0 -p1 + %pom_disable_module bundles %pom_remove_dep com.sun:tools @@ -64,12 +192,64 @@ This package contains the API documentation for %{name}. %mvn_alias org.glassfish.jaxb:jaxb-xjc "com.sun.xml.bind:jaxb-xjc" %build -%mvn_build -f -- -Ddev +%mvn_build -f -s -- -Ddev %install %mvn_install -%files -f .mfiles +%files +%doc License.txt licenceheader.txt License.html + +%files codemodel -f .mfiles-codemodel +%dir %{_javadir}/%{name} +%doc License.txt licenceheader.txt License.html + +%files codemodel-annotation-compiler -f .mfiles-codemodel-annotation-compiler +%dir %{_javadir}/%{name} + +%files -n glassfish-jaxb1-impl -f .mfiles-jaxb1-impl +%dir %{_javadir}/%{name} + +%files bom -f .mfiles-jaxb-bom +%doc License.txt licenceheader.txt License.html + +%files bom-ext -f .mfiles-jaxb-bom-ext + +%files codemodel-parent -f .mfiles-jaxb-codemodel-parent + +%files core -f .mfiles-jaxb-core +%dir %{_javadir}/%{name} +%doc License.txt licenceheader.txt License.html + +%files external-parent -f .mfiles-jaxb-external-parent + +%files jxc -f .mfiles-jaxb-jxc +%dir %{_javadir}/%{name} +%doc License.txt licenceheader.txt License.html + +%files parent -f .mfiles-jaxb-parent + +%files runtime -f .mfiles-jaxb-runtime +%dir %{_javadir}/%{name} +%doc License.txt licenceheader.txt License.html + +%files runtime-parent -f .mfiles-jaxb-runtime-parent + +%files txw-parent -f .mfiles-jaxb-txw-parent + +%files xjc -f .mfiles-jaxb-xjc +%dir %{_javadir}/%{name} + +%files rngom -f .mfiles-rngom +%dir %{_javadir}/%{name} +%doc License.txt licenceheader.txt License.html + +%files txw2 -f .mfiles-txw2 +%dir %{_javadir}/%{name} +%doc License.txt licenceheader.txt License.html + +%files txwc2 -f .mfiles-txwc2 +%dir %{_javadir}/%{name} %doc License.txt licenceheader.txt License.html %files javadoc -f .mfiles-javadoc @@ -77,6 +257,9 @@ This package contains the API documentation for %{name}. %changelog +* Fri Mar 20 2015 Michal Srb - 2.2.11-2 +- Split into subpackages (Resolves: rhbz#1204187) + * Mon Jan 19 2015 Michal Srb - 2.2.11-1 - Update to upstream version 2.2.11 diff --git a/txw2-args4j.patch b/txw2-args4j.patch new file mode 100644 index 0000000..df71f86 --- /dev/null +++ b/txw2-args4j.patch @@ -0,0 +1,147 @@ +diff --git a/txw/compiler/src/main/java/com/sun/tools/txw2/Main.java b/txw/compiler/src/main/java/com/sun/tools/txw2/Main.java +index 3c8cc84..3f1a092 100644 +--- a/txw/compiler/src/main/java/com/sun/tools/txw2/Main.java ++++ b/txw/compiler/src/main/java/com/sun/tools/txw2/Main.java +@@ -43,10 +43,10 @@ package com.sun.tools.txw2; + import com.sun.codemodel.writer.FileCodeWriter; + import com.sun.codemodel.writer.SingleStreamCodeWriter; + import com.sun.tools.txw2.model.NodeSet; ++import org.kohsuke.args4j.Argument; ++import org.kohsuke.args4j.Option; + import org.kohsuke.args4j.CmdLineException; + import org.kohsuke.args4j.CmdLineParser; +-import org.kohsuke.args4j.opts.BooleanOption; +-import org.kohsuke.args4j.opts.StringOption; + import org.kohsuke.rngom.parse.IllegalSchemaException; + import org.kohsuke.rngom.parse.Parseable; + import org.kohsuke.rngom.parse.compact.CompactParseable; +@@ -60,6 +60,8 @@ import java.io.File; + import java.io.IOException; + import java.net.MalformedURLException; + import java.util.Properties; ++import java.util.List; ++import java.util.ArrayList; + + /** + * Programatic entry point to the TXW compiler. +@@ -73,26 +75,39 @@ public class Main { + this.opts = opts; + } + +- public static void main(String[] args) { +- System.exit(run(args)); ++ public static class Options { ++ @Argument ++ public List arguments = new ArrayList(); ++ ++ @Option(name="-o") ++ public String output; ++ ++ @Option(name="-p") ++ public String pkg; ++ ++ @Option(name="-c") ++ public boolean compact; ++ ++ @Option(name="-x") ++ public boolean xml; ++ ++ @Option(name="-xsd") ++ public boolean xsd; ++ ++ @Option(name="-h") ++ public boolean chain; + } + +- public static class Options { +- public StringOption output = new StringOption("-o"); +- public StringOption pkg = new StringOption("-p"); +- public BooleanOption compact = new BooleanOption("-c"); +- public BooleanOption xml = new BooleanOption("-x"); +- public BooleanOption xsd = new BooleanOption("-xsd"); +- public BooleanOption chain = new BooleanOption("-h"); ++ public static void main(String[] args) { ++ System.exit(run(args)); + } + + public static int run(String[] args) { + Options opts = new Options(); +- CmdLineParser parser = new CmdLineParser(); +- parser.addOptionClass(opts); ++ CmdLineParser parser = new CmdLineParser(opts); + + try { +- parser.parse(args); ++ parser.parseArgument(args); + } catch (CmdLineException e) { + System.out.println(e.getMessage()); + printUsage(); +@@ -102,9 +117,9 @@ public class Main { + TxwOptions topts = new TxwOptions(); + topts.errorListener = new ConsoleErrorReporter(System.out); + +- if(opts.output.value!=null) { ++ if(opts.output != null) { + try { +- topts.codeWriter = new FileCodeWriter(new File(opts.output.value)); ++ topts.codeWriter = new FileCodeWriter(new File(opts.output)); + } catch( IOException e ) { + System.out.println(e.getMessage()); + printUsage(); +@@ -114,12 +129,12 @@ public class Main { + topts.codeWriter = new SingleStreamCodeWriter(System.out); + } + +- if(opts.chain.isOn()) { ++ if(opts.chain) { + topts.chainMethod = true; + } + +- if(opts.pkg.value!=null) { +- topts._package = topts.codeModel._package(opts.pkg.value); ++ if(opts.pkg != null) { ++ topts._package = topts.codeModel._package(opts.pkg); + } else { + topts._package = topts.codeModel.rootPackage(); + } +@@ -146,21 +161,21 @@ public class Main { + * out of the specified schema file. + */ + private static SchemaBuilder makeSourceSchema(CmdLineParser parser, Options opts, ErrorHandler eh) throws MalformedURLException { +- File f = new File((String)parser.getArguments().get(0)); ++ File f = new File(opts.arguments.get(0)); + final InputSource in = new InputSource(f.toURL().toExternalForm()); + +- if(opts.xsd.isOff() && opts.xml.isOff() && opts.compact.isOff()) { ++ if(!opts.xsd && !opts.xml && !opts.compact) { + // auto detect + if(in.getSystemId().endsWith(".rnc")) +- opts.compact.value=true; ++ opts.compact = true; + else + if(in.getSystemId().endsWith(".rng")) +- opts.xml.value=true; ++ opts.xml = true; + else +- opts.xsd.value=true; ++ opts.xsd = true; + } + +- if(opts.xsd.isOn()) ++ if(opts.xsd) + return new XmlSchemaLoader(in); + + final Parseable parseable = makeRELAXNGSource(opts, in, eh, f); +@@ -169,10 +184,10 @@ public class Main { + } + + private static Parseable makeRELAXNGSource(Options opts, final InputSource in, ErrorHandler eh, File f) { +- if(opts.compact.isOn()) ++ if(opts.compact) + return new CompactParseable(in,eh); + +- if(opts.xml.isOn()) ++ if(opts.xml) + return new SAXParseable(in,eh); + + // otherwise sniff from the file extension