1 |
%bcond_without activation |
2 |
%bcond_without cglib |
3 |
%bcond_without dom4j |
4 |
%bcond_without jdom |
5 |
%bcond_without jdom2 |
6 |
%bcond_with jettison |
7 |
%bcond_with joda-time |
8 |
%bcond_with kxml2 |
9 |
%bcond_with stax |
10 |
%bcond_with woodstox |
11 |
%bcond_with xom |
12 |
%bcond_with xpp3 |
13 |
|
14 |
Name: xstream |
15 |
Version: 1.4.20 |
16 |
Release: %mkrel 2 |
17 |
Group: Development/Java |
18 |
Summary: Java XML serialization library |
19 |
License: BSD |
20 |
URL: https://x-stream.github.io |
21 |
BuildArch: noarch |
22 |
#ExclusiveArch: %%{java_arches} noarch |
23 |
Source0: https://repo1.maven.org/maven2/com/thoughtworks/%{name}/%{name}-distribution/%{version}/%{name}-distribution-%{version}-src.zip |
24 |
BuildRequires: maven-local |
25 |
BuildRequires: mvn(io.github.x-stream:mxparser) |
26 |
BuildRequires: mvn(jakarta.xml.bind:jakarta.xml.bind-api:2) |
27 |
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) |
28 |
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) |
29 |
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) |
30 |
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) |
31 |
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) |
32 |
%if %{with activation} |
33 |
BuildRequires: mvn(jakarta.activation:jakarta.activation-api:1) |
34 |
%endif |
35 |
%if %{with cglib} |
36 |
BuildRequires: mvn(cglib:cglib-nodep) |
37 |
%endif |
38 |
%if %{with dom4j} |
39 |
BuildRequires: mvn(dom4j:dom4j) |
40 |
%endif |
41 |
%if %{with jdom} |
42 |
BuildRequires: mvn(org.jdom:jdom) |
43 |
%endif |
44 |
%if %{with jdom2} |
45 |
BuildRequires: mvn(org.jdom:jdom2) |
46 |
%endif |
47 |
%if %{with jettison} |
48 |
BuildRequires: mvn(org.codehaus.jettison:jettison) |
49 |
%endif |
50 |
%if %{with joda-time} |
51 |
BuildRequires: mvn(joda-time:joda-time) |
52 |
%endif |
53 |
%if %{with kxml2} |
54 |
BuildRequires: mvn(net.sf.kxml:kxml2-min) |
55 |
%endif |
56 |
%if %{with stax} |
57 |
BuildRequires: mvn(stax:stax) |
58 |
BuildRequires: mvn(stax:stax-api) |
59 |
%endif |
60 |
%if %{with woodstox} |
61 |
BuildRequires: mvn(org.codehaus.woodstox:wstx-asl) |
62 |
%endif |
63 |
%if %{with xom} |
64 |
BuildRequires: mvn(xom:xom) |
65 |
%endif |
66 |
%if %{with xpp3} |
67 |
BuildRequires: mvn(xpp3:xpp3_min) |
68 |
%endif |
69 |
|
70 |
%description |
71 |
XStream is a simple library to serialize objects to XML |
72 |
and back again. A high level facade is supplied that |
73 |
simplifies common use cases. Custom objects can be serialized |
74 |
without need for specifying mappings. Speed and low memory |
75 |
footprint are a crucial part of the design, making it suitable |
76 |
for large object graphs or systems with high message throughput. |
77 |
No information is duplicated that can be obtained via reflection. |
78 |
This results in XML that is easier to read for humans and more |
79 |
compact than native Java serialization. XStream serializes internal |
80 |
fields, including private and final. Supports non-public and inner |
81 |
classes. Classes are not required to have default constructor. |
82 |
Duplicate references encountered in the object-model will be |
83 |
maintained. Supports circular references. By implementing an |
84 |
interface, XStream can serialize directly to/from any tree |
85 |
structure (not just XML). Strategies can be registered allowing |
86 |
customization of how particular types are represented as XML. |
87 |
When an exception occurs due to malformed XML, detailed diagnostics |
88 |
are provided to help isolate and fix the problem. |
89 |
|
90 |
%package -n %{name}-benchmark |
91 |
Summary: Benchmark module for %{name} |
92 |
%description -n %{name}-benchmark |
93 |
Benchmark module for %{name}. |
94 |
|
95 |
%{?javadoc_package} |
96 |
|
97 |
%prep |
98 |
# -n: base directory name |
99 |
%autosetup -n %{name}-%{version} |
100 |
# delete precompiled jar and class files |
101 |
find -type f '(' -iname '*.jar' -o -iname '*.class' ')' -print -delete |
102 |
# change javax to jakarta |
103 |
# https://jakarta.ee/about/faq#What_happened_with_javax.*_namespace? |
104 |
%pom_change_dep -r javax.activation:activation jakarta.activation:jakarta.activation-api:1 |
105 |
%pom_change_dep -r javax.xml.bind:jaxb-api jakarta.xml.bind:jakarta.xml.bind-api:2 |
106 |
# remove dependency plugin |
107 |
%pom_remove_plugin -r :maven-dependency-plugin |
108 |
# optional dep: activation |
109 |
%if %{without activation} |
110 |
%pom_remove_dep -r jakarta.activation:jakarta.activation-api |
111 |
rm xstream/src/java/com/thoughtworks/xstream/converters/extended/ActivationDataFlavorConverter.java |
112 |
%endif |
113 |
# optional dep: cglib |
114 |
%if %{without cglib} |
115 |
%pom_remove_dep -r cglib:cglib-nodep |
116 |
rm xstream/src/java/com/thoughtworks/xstream/converters/reflection/CGLIBEnhancedConverter.java |
117 |
rm xstream/src/java/com/thoughtworks/xstream/mapper/CGLIBMapper.java |
118 |
rm xstream/src/java/com/thoughtworks/xstream/security/CGLIBProxyTypePermission.java |
119 |
%endif |
120 |
# optional dep: dom4j |
121 |
%if %{without dom4j} |
122 |
%pom_remove_dep -r dom4j:dom4j |
123 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/Dom4JDriver.java |
124 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/Dom4JReader.java |
125 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/Dom4JWriter.java |
126 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/Dom4JXmlWriter.java |
127 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamDom4J.java |
128 |
%endif |
129 |
# optional dep: jdom |
130 |
%if %{without jdom} |
131 |
%pom_remove_dep -r org.jdom:jdom |
132 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/JDomDriver.java |
133 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/JDomReader.java |
134 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/JDomWriter.java |
135 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamJDom.java |
136 |
%endif |
137 |
# optional dep: jdom2 |
138 |
%if %{without jdom2} |
139 |
%pom_remove_dep -r org.jdom:jdom2 |
140 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/JDom2Driver.java |
141 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/JDom2Reader.java |
142 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/JDom2Writer.java |
143 |
%endif |
144 |
# optional dep: jettison |
145 |
%if %{without jettison} |
146 |
%pom_remove_dep -r org.codehaus.jettison:jettison |
147 |
rm xstream/src/java/com/thoughtworks/xstream/io/json/JettisonMappedXmlDriver.java |
148 |
rm xstream/src/java/com/thoughtworks/xstream/io/json/JettisonStaxWriter.java |
149 |
%endif |
150 |
# optional dep: joda-time |
151 |
%if %{without joda-time} |
152 |
%pom_remove_dep -r joda-time:joda-time |
153 |
rm xstream/src/java/com/thoughtworks/xstream/core/util/ISO8601JodaTimeConverter.java |
154 |
%endif |
155 |
# optional dep: kxml2 |
156 |
%if %{without kxml2} |
157 |
%pom_remove_dep -r net.sf.kxml:kxml2-min |
158 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/KXml2DomDriver.java |
159 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/KXml2Driver.java |
160 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamKXml2.java |
161 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamKXml2DOM.java |
162 |
%endif |
163 |
# optional dep: stax |
164 |
%if %{without stax} |
165 |
%pom_remove_dep -r stax:stax |
166 |
%pom_remove_dep -r stax:stax-api |
167 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/BEAStaxDriver.java |
168 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamBEAStax.java |
169 |
%endif |
170 |
# optional dep: woodstox |
171 |
%if %{without woodstox} |
172 |
%pom_remove_dep -r org.codehaus.woodstox:wstx-asl |
173 |
%pom_remove_dep -r com.fasterxml.woodstox:woodstox-core |
174 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/WstxDriver.java |
175 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamWoodstox.java |
176 |
%endif |
177 |
# optional dep: xom |
178 |
%if %{without xom} |
179 |
%pom_remove_dep -r xom:xom |
180 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/XomDriver.java |
181 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/XomReader.java |
182 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/XomWriter.java |
183 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamXom.java |
184 |
%endif |
185 |
# optional dep: xpp3 |
186 |
%if %{without xpp3} |
187 |
%pom_remove_dep -r xpp3:xpp3_min |
188 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/Xpp3DomDriver.java |
189 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/Xpp3Driver.java |
190 |
rm xstream/src/java/com/thoughtworks/xstream/io/xml/xppdom/Xpp3DomBuilder.java |
191 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamXpp3.java |
192 |
rm xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/products/XStreamXpp3DOM.java |
193 |
%endif |
194 |
# disable module distribution |
195 |
%pom_disable_module %{name}-distribution |
196 |
# disable module hibernate |
197 |
%pom_disable_module %{name}-hibernate |
198 |
# disable module jmh |
199 |
%pom_disable_module %{name}-jmh |
200 |
# don't install parent package |
201 |
%mvn_package :%{name}-parent __noinstall |
202 |
|
203 |
%build |
204 |
%mvn_build -s -f -- -Dversion.java.source=1.8 -Dversion.java.target=1.8 |
205 |
|
206 |
%install |
207 |
%mvn_install |
208 |
|
209 |
%files -n %{name} -f .mfiles-%{name} |
210 |
%license LICENSE.txt |
211 |
%doc README.txt |
212 |
%files -n %{name}-benchmark -f .mfiles-%{name}-benchmark |
213 |
%license LICENSE.txt |
214 |
%doc README.txt |