1 |
# Copyright (c) 2000-2005, JPackage Project |
2 |
# All rights reserved. |
3 |
# |
4 |
# Redistribution and use in source and binary forms, with or without |
5 |
# modification, are permitted provided that the following conditions |
6 |
# are met: |
7 |
# |
8 |
# 1. Redistributions of source code must retain the above copyright |
9 |
# notice, this list of conditions and the following disclaimer. |
10 |
# 2. Redistributions in binary form must reproduce the above copyright |
11 |
# notice, this list of conditions and the following disclaimer in the |
12 |
# documentation and/or other materials provided with the |
13 |
# distribution. |
14 |
# 3. Neither the name of the JPackage Project nor the names of its |
15 |
# contributors may be used to endorse or promote products derived |
16 |
# from this software without specific prior written permission. |
17 |
# |
18 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 |
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 |
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
21 |
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 |
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 |
# |
30 |
|
31 |
%define _with_gcj_support 1 |
32 |
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support: |
33 |
%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support: |
34 |
%{_gcj_support}}%{!?_gcj_support:0}}} |
35 |
|
36 |
Summary: Small fast XML parser |
37 |
Name: piccolo |
38 |
Version: 1.04 |
39 |
Release: %mkrel 2.2.7 |
40 |
Epoch: 0 |
41 |
License: Apache Software License |
42 |
URL: http://piccolo.sourceforge.net/ |
43 |
Group: Development/Java |
44 |
Source0: piccolo-%{version}-src.zip |
45 |
Patch0: piccolo-build_xml.patch |
46 |
BuildRequires: java-rpmbuild >= 0:1.5.32 |
47 |
BuildRequires: ant >= 0:1.6 |
48 |
BuildRequires: ant-junit |
49 |
BuildRequires: junit |
50 |
Requires: jpackage-utils |
51 |
%if ! %{gcj_support} |
52 |
BuildArch: noarch |
53 |
%endif |
54 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
55 |
|
56 |
%if %{gcj_support} |
57 |
BuildRequires: java-gcj-compat-devel |
58 |
%endif |
59 |
|
60 |
%description |
61 |
Piccolo is a small, extremely fast XML parser for |
62 |
Java. It implements the SAX 1, SAX 2.0.1, and |
63 |
JAXP 1.1 (SAX parsing only) interfaces as a |
64 |
non-validating parser and attempts to detect |
65 |
all XML well-formedness errors. |
66 |
|
67 |
%package javadoc |
68 |
Summary: Javadoc for %{name} |
69 |
Group: Development/Java |
70 |
|
71 |
%description javadoc |
72 |
%{summary}. |
73 |
|
74 |
%prep |
75 |
%setup -q -T -c -n %{name}-%{version} |
76 |
cd .. |
77 |
unzip -q %{SOURCE0} |
78 |
cd %{name}-%{version} |
79 |
rm -r src/org src/javax |
80 |
%patch0 |
81 |
#Fix wrong-file-end-of-line-encoding |
82 |
sed -i 's/\r$//g' LICENSE.txt |
83 |
|
84 |
%build |
85 |
export OPT_JAR_LIST="ant/ant-junit junit" |
86 |
export CLASSPATH= |
87 |
ant -Dbuild.sysclasspath=first build javadoc |
88 |
|
89 |
%install |
90 |
rm -rf $RPM_BUILD_ROOT |
91 |
|
92 |
# jars |
93 |
mkdir -p $RPM_BUILD_ROOT%{_javadir} |
94 |
cp -p lib/Piccolo.jar \ |
95 |
$RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar |
96 |
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done) |
97 |
|
98 |
# javadoc |
99 |
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name} |
100 |
cp -pr doc/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} |
101 |
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} |
102 |
|
103 |
|
104 |
%if %{gcj_support} |
105 |
%{_bindir}/aot-compile-rpm |
106 |
%endif |
107 |
|
108 |
%clean |
109 |
rm -rf $RPM_BUILD_ROOT |
110 |
|
111 |
%if %{gcj_support} |
112 |
%post |
113 |
%{update_gcjdb} |
114 |
|
115 |
%postun |
116 |
%{clean_gcjdb} |
117 |
%endif |
118 |
|
119 |
%files |
120 |
%defattr(0644,root,root,0755) |
121 |
%doc LICENSE.txt |
122 |
%{_javadir}/%{name}.jar |
123 |
%{_javadir}/%{name}-%{version}.jar |
124 |
|
125 |
%if %{gcj_support} |
126 |
%dir %{_libdir}/gcj/%{name} |
127 |
%attr(-,root,root) %{_libdir}/gcj/%{name}/piccolo-1.04.jar.* |
128 |
%endif |
129 |
|
130 |
%files javadoc |
131 |
%defattr(0644,root,root,0755) |
132 |
%doc %{_javadocdir}/* |
133 |
|
134 |
# ----------------------------------------------------------------------------- |
135 |
|
136 |
|