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 gcj_support 1 |
32 |
|
33 |
%define section free |
34 |
|
35 |
Summary: XML Im-/Exporter |
36 |
Name: xml-im-exporter |
37 |
Version: 1.1 |
38 |
Release: %mkrel 2.0.9 |
39 |
Epoch: 0 |
40 |
License: LGPL |
41 |
URL: http://xml-im-exporter.sourceforge.net/ |
42 |
Group: Development/Java |
43 |
Source0: xml-im-exporter1.1.tgz |
44 |
Source1: xml-im-exporter-1.1.pom |
45 |
Patch0: xml-im-exporter-build_xml.patch |
46 |
BuildRequires: ant >= 0:1.6 |
47 |
BuildRequires: ant-junit |
48 |
BuildRequires: java-rpmbuild >= 0:1.6 |
49 |
BuildRequires: junit |
50 |
%if %{gcj_support} |
51 |
BuildRequires: java-gcj-compat-devel |
52 |
%else |
53 |
BuildArch: noarch |
54 |
%endif |
55 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
56 |
|
57 |
%description |
58 |
XML Im-/Exporter is a low level library to assist |
59 |
you in the straight forward process of importing |
60 |
and exporting XML from and to your Java classes. |
61 |
All of this is designed having performance and |
62 |
simplicity in mind. |
63 |
|
64 |
%package javadoc |
65 |
Summary: Javadoc for %{name} |
66 |
Group: Development/Java |
67 |
|
68 |
%description javadoc |
69 |
%{summary}. |
70 |
|
71 |
%prep |
72 |
%setup -q -n %{name} |
73 |
# XXX: file encoding invalid |
74 |
%{__rm} src/test/de/zeigermann/xml/XMLWriterTest.java |
75 |
# remove all binary libs |
76 |
find . -name "*.jar" -exec rm -f {} \; |
77 |
#for j in $(find . -name "*.jar"); do |
78 |
# mv $j $j.no |
79 |
#done |
80 |
|
81 |
%patch0 -b .sav |
82 |
|
83 |
%{_bindir}/find . -type f -name '*.txt' -o -type f -name '*.html' -o -type f -name '*.css' -o -type f -name package-list | \ |
84 |
%{_bindir}/xargs -t %{__perl} -pi -e 's/\r$//g' |
85 |
|
86 |
%build |
87 |
export CLASSPATH=$(build-classpath junit) |
88 |
export OPT_JAR_LIST="ant/ant-junit" |
89 |
%{ant} jar test javadocs |
90 |
|
91 |
|
92 |
%install |
93 |
rm -rf $RPM_BUILD_ROOT |
94 |
|
95 |
# jars |
96 |
install -d -m 755 $RPM_BUILD_ROOT%{_javadir} |
97 |
|
98 |
install -m 644 build/lib/%{name}%{version}.jar \ |
99 |
$RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar |
100 |
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done) |
101 |
|
102 |
#poms |
103 |
%add_to_maven_depmap de.zeigermann.xml xml-im-exporter %{version} JPP/ xml-im-exporter |
104 |
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms |
105 |
install -pm 644 %{SOURCE1} \ |
106 |
$RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-xml-im-exporter.pom |
107 |
|
108 |
# javadoc |
109 |
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} |
110 |
cp -pr doc/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} |
111 |
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} |
112 |
|
113 |
|
114 |
# docs |
115 |
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} |
116 |
install -m 644 doc/index.html $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} |
117 |
install -m 644 *.txt $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} |
118 |
|
119 |
%{__perl} -pi -e 's/\r$//g' $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Copying.txt \ |
120 |
$RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/**/**/**/* |
121 |
|
122 |
%if %{gcj_support} |
123 |
%{_bindir}/aot-compile-rpm |
124 |
%endif |
125 |
|
126 |
%clean |
127 |
rm -rf $RPM_BUILD_ROOT |
128 |
|
129 |
%post |
130 |
%update_maven_depmap |
131 |
%if %{gcj_support} |
132 |
%{update_gcjdb} |
133 |
%endif |
134 |
|
135 |
%postun |
136 |
%update_maven_depmap |
137 |
%if %{gcj_support} |
138 |
%{clean_gcjdb} |
139 |
%endif |
140 |
|
141 |
%files |
142 |
%defattr(0644,root,root,0755) |
143 |
%{_datadir}/doc/%{name}-%{version}/index.html |
144 |
%{_datadir}/doc/%{name}-%{version}/*.txt |
145 |
%{_javadir}/%{name}.jar |
146 |
%{_javadir}/%{name}-%{version}.jar |
147 |
%{_datadir}/maven2/poms/* |
148 |
%{_mavendepmapfragdir} |
149 |
%if %{gcj_support} |
150 |
%dir %{_libdir}/gcj/%{name} |
151 |
%attr(-,root,root) %{_libdir}/gcj/%{name}/* |
152 |
%endif |
153 |
|
154 |
%files javadoc |
155 |
%defattr(0644,root,root,0755) |
156 |
%{_javadocdir}/%{name}-%{version} |
157 |
%{_javadocdir}/%{name} |
158 |
|
159 |
|