1 |
dmorgan |
91643 |
# Copyright statement from JPackage this file is derived from: |
2 |
|
|
|
3 |
|
|
# Copyright (c) 2000-2007, JPackage Project |
4 |
|
|
# All rights reserved. |
5 |
|
|
# |
6 |
|
|
# Redistribution and use in source and binary forms, with or without |
7 |
|
|
# modification, are permitted provided that the following conditions |
8 |
|
|
# are met: |
9 |
|
|
# |
10 |
|
|
# 1. Redistributions of source code must retain the above copyright |
11 |
|
|
# notice, this list of conditions and the following disclaimer. |
12 |
|
|
# 2. Redistributions in binary form must reproduce the above copyright |
13 |
|
|
# notice, this list of conditions and the following disclaimer in the |
14 |
|
|
# documentation and/or other materials provided with the |
15 |
|
|
# distribution. |
16 |
|
|
# 3. Neither the name of the JPackage Project nor the names of its |
17 |
|
|
# contributors may be used to endorse or promote products derived |
18 |
|
|
# from this software without specific prior written permission. |
19 |
|
|
# |
20 |
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
21 |
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
22 |
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
23 |
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
24 |
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
25 |
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
26 |
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
27 |
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
28 |
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
29 |
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
30 |
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
31 |
|
|
# |
32 |
|
|
|
33 |
|
|
# Tests are disabled by default since we don't have |
34 |
|
|
# all the requirements in Mageia yet |
35 |
|
|
%bcond_with test |
36 |
|
|
|
37 |
|
|
Name: xstream |
38 |
|
|
Version: 1.3.1 |
39 |
|
|
Release: %mkrel 2 |
40 |
|
|
Summary: Java XML serialization library |
41 |
|
|
|
42 |
|
|
Group: Development/Java |
43 |
|
|
License: BSD |
44 |
|
|
URL: http://xstream.codehaus.org/ |
45 |
|
|
Source0: http://repository.codehaus.org/com/thoughtworks/%{name}/%{name}-distribution/%{version}/%{name}-distribution-%{version}-src.zip |
46 |
|
|
|
47 |
|
|
BuildRequires: jpackage-utils >= 0:1.7.2 |
48 |
|
|
BuildRequires: ant >= 0:1.6 |
49 |
|
|
BuildRequires: bea-stax >= 0:1.2.0 |
50 |
|
|
BuildRequires: bea-stax-api >= 0:1.0.1 |
51 |
|
|
BuildRequires: cglib >= 0:2.1.3 |
52 |
|
|
BuildRequires: dom4j >= 0:1.6.1 |
53 |
|
|
BuildRequires: jakarta-commons-lang >= 0:2.1 |
54 |
|
|
BuildRequires: jakarta-oro |
55 |
|
|
BuildRequires: jdom >= 0:1.0 |
56 |
|
|
BuildRequires: jettison >= 0:1.0 |
57 |
|
|
BuildRequires: joda-time >= 0:1.2.1 |
58 |
|
|
BuildRequires: junit >= 0:3.8.1 |
59 |
|
|
BuildRequires: xom >= 0:1.0 |
60 |
|
|
BuildRequires: xpp3 >= 0:1.1.3.4 |
61 |
|
|
BuildRequires: unzip |
62 |
|
|
BuildRequires: java-devel-openjdk |
63 |
|
|
%if %with test |
64 |
|
|
BuildRequires: jmock >= 0:1.0.1 |
65 |
|
|
BuildRequires: wstx >= 0:3.2.0 |
66 |
|
|
%endif |
67 |
|
|
Requires: jpackage-utils |
68 |
|
|
Requires: java |
69 |
|
|
Requires: xpp3-minimal |
70 |
|
|
|
71 |
|
|
BuildArch: noarch |
72 |
|
|
|
73 |
|
|
|
74 |
|
|
%description |
75 |
|
|
XStream is a simple library to serialize objects to XML |
76 |
|
|
and back again. A high level facade is supplied that |
77 |
|
|
simplifies common use cases. Custom objects can be serialized |
78 |
|
|
without need for specifying mappings. Speed and low memory |
79 |
|
|
footprint are a crucial part of the design, making it suitable |
80 |
|
|
for large object graphs or systems with high message throughput. |
81 |
|
|
No information is duplicated that can be obtained via reflection. |
82 |
|
|
This results in XML that is easier to read for humans and more |
83 |
|
|
compact than native Java serialization. XStream serializes internal |
84 |
|
|
fields, including private and final. Supports non-public and inner |
85 |
|
|
classes. Classes are not required to have default constructor. |
86 |
|
|
Duplicate references encountered in the object-model will be |
87 |
|
|
maintained. Supports circular references. By implementing an |
88 |
|
|
interface, XStream can serialize directly to/from any tree |
89 |
|
|
structure (not just XML). Strategies can be registered allowing |
90 |
|
|
customization of how particular types are represented as XML. |
91 |
|
|
When an exception occurs due to malformed XML, detailed diagnostics |
92 |
|
|
are provided to help isolate and fix the problem. |
93 |
|
|
|
94 |
|
|
|
95 |
|
|
%package javadoc |
96 |
|
|
Summary: Javadoc for %{name} |
97 |
|
|
Group: Development/Java |
98 |
|
|
Requires: jpackage-utils |
99 |
|
|
|
100 |
|
|
%description javadoc |
101 |
|
|
%{name} API documentation. |
102 |
|
|
|
103 |
|
|
|
104 |
|
|
%prep |
105 |
|
|
%setup -qn %{name}-%{version} |
106 |
|
|
find . -name "*.jar" -delete |
107 |
|
|
|
108 |
|
|
%if %with test |
109 |
|
|
# This test requires megginson's sax2 |
110 |
|
|
rm -f xstream/src/test/com/thoughtworks/xstream/io/xml/SaxWriterTest.java |
111 |
|
|
%endif |
112 |
|
|
|
113 |
|
|
|
114 |
|
|
%build |
115 |
|
|
# Replace bundled tars |
116 |
|
|
pushd xstream/lib |
117 |
|
|
ln -sf $(build-classpath cglib) |
118 |
|
|
ln -sf $(build-classpath commons-lang) |
119 |
|
|
ln -sf $(build-classpath dom4j) |
120 |
|
|
ln -sf $(build-classpath jdom) |
121 |
|
|
ln -sf $(build-classpath jettison) |
122 |
|
|
ln -sf $(build-classpath joda-time) |
123 |
|
|
ln -sf $(build-classpath junit) |
124 |
|
|
ln -sf $(build-classpath oro) |
125 |
|
|
ln -sf $(build-classpath bea-stax-ri) |
126 |
|
|
ln -sf $(build-classpath bea-stax-api) |
127 |
|
|
ln -sf $(build-classpath xom) |
128 |
|
|
ln -sf $(build-classpath xpp3) |
129 |
|
|
%if %with test |
130 |
|
|
ln -sf $(build-classpath jmock) |
131 |
|
|
ln -sf $(build-classpath wstx/wstx-asl) |
132 |
|
|
%endif |
133 |
|
|
popd |
134 |
|
|
|
135 |
|
|
# Build |
136 |
|
|
pushd xstream |
137 |
|
|
%if %with test |
138 |
|
|
ant library javadoc |
139 |
|
|
%else |
140 |
|
|
ant benchmark:compile jar javadoc |
141 |
|
|
%endif |
142 |
|
|
popd |
143 |
|
|
|
144 |
|
|
|
145 |
|
|
%install |
146 |
|
|
rm -rf $RPM_BUILD_ROOT |
147 |
|
|
|
148 |
|
|
# Directory structure |
149 |
|
|
install -d $RPM_BUILD_ROOT%{_javadir} |
150 |
|
|
install -d $RPM_BUILD_ROOT%{_javadocdir} |
151 |
|
|
|
152 |
|
|
# Main jar |
153 |
|
|
pushd xstream |
154 |
|
|
install -p -m644 target/xstream-SNAPSHOT.jar \ |
155 |
|
|
$RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar |
156 |
|
|
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar |
157 |
|
|
|
158 |
|
|
# Benchmarks |
159 |
|
|
install -p -m644 target/xstream-benchmark-SNAPSHOT.jar \ |
160 |
|
|
$RPM_BUILD_ROOT%{_javadir}/%{name}-benchmark-%{version}.jar |
161 |
|
|
ln -s %{name}-benchmark-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-benchmark.jar |
162 |
|
|
|
163 |
|
|
# API Documentation |
164 |
|
|
cp -pr target/javadoc $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} |
165 |
|
|
popd |
166 |
|
|
|
167 |
|
|
# poms |
168 |
|
|
install -d -m 755 %{buildroot}%{_mavenpomdir} |
169 |
|
|
install -pm 644 pom.xml \ |
170 |
|
|
%{buildroot}%{_mavenpomdir}/JPP-%{name}-parent.pom |
171 |
|
|
%add_to_maven_depmap com.thoughtworks.xstream %{name}-parent %{version} JPP %{name}-parent |
172 |
|
|
|
173 |
|
|
install -pm 644 xstream/pom.xml \ |
174 |
|
|
%{buildroot}%{_mavenpomdir}/JPP-%{name}.pom |
175 |
|
|
%add_to_maven_depmap com.thoughtworks.xstream %{name} %{version} JPP %{name} |
176 |
|
|
|
177 |
|
|
|
178 |
|
|
%clean |
179 |
|
|
rm -rf $RPM_BUILD_ROOT |
180 |
|
|
|
181 |
|
|
%post |
182 |
|
|
%update_maven_depmap |
183 |
|
|
|
184 |
|
|
%postun |
185 |
|
|
%update_maven_depmap |
186 |
|
|
|
187 |
|
|
%files |
188 |
|
|
%defattr(-,root,root,-) |
189 |
|
|
%{_javadir}/*.jar |
190 |
|
|
%{_mavenpomdir}/* |
191 |
|
|
%{_mavendepmapfragdir}/* |
192 |
|
|
%doc LICENSE.txt |
193 |
|
|
|
194 |
|
|
|
195 |
|
|
%files javadoc |
196 |
|
|
%defattr(-,root,root,-) |
197 |
|
|
%{_javadocdir}/%{name}-%{version} |
198 |
|
|
|
199 |
|
|
|