1 |
# Copyright (c) 2000-2007, 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 |
%global with_eclipse 1 |
32 |
%global with_extra 1 |
33 |
|
34 |
%global section free |
35 |
|
36 |
%global eclipse_base %{_libdir}/eclipse |
37 |
# Note: this next section looks weird having an arch specified in a |
38 |
# noarch specfile but the parts of the build |
39 |
# All arches line up between Eclipse and Linux kernel names except i386 -> x86 |
40 |
%ifarch %{ix86} |
41 |
%global eclipse_arch x86 |
42 |
%else |
43 |
%global eclipse_arch %{_arch} |
44 |
%endif |
45 |
|
46 |
Name: icu4j |
47 |
Version: 4.4.2 |
48 |
Release: %mkrel 3 |
49 |
Epoch: 1 |
50 |
Summary: International Components for Unicode for Java |
51 |
License: MIT and EPL |
52 |
URL: http://site.icu-project.org/ |
53 |
Group: Development/Java |
54 |
#http://source.icu-project.org/repos/icu/icu4j/tags/release-4-4-2-eclipse37-20110208/ icu4j-4.4.2 |
55 |
#tar caf icu4j-4.4.2.tar.xz icu4j-4.4.2/ |
56 |
Source0: icu4j-4.4.2.tar.xz |
57 |
Source1: %{name}-4.4.2.pom |
58 |
|
59 |
Patch0: %{name}-crosslink.patch |
60 |
BuildRequires: ant >= 1.7.0 |
61 |
# FIXME: is this necessary or is it just adding strings in the hrefs in |
62 |
# the docs? |
63 |
BuildRequires: java-javadoc >= 0:1.6.0 |
64 |
# This is to ensure we get OpenJDK and not GCJ |
65 |
BuildRequires: java-devel >= 0:1.6.0 |
66 |
BuildRequires: jpackage-utils >= 0:1.5 |
67 |
Requires: jpackage-utils |
68 |
Requires(post): jpackage-utils |
69 |
Requires(postun): jpackage-utils |
70 |
# This is to ensure we get OpenJDK and not GCJ |
71 |
Requires: java >= 0:1.6.0 |
72 |
%if %{with_eclipse} |
73 |
BuildRequires: eclipse-pde >= 0:3.2.1 |
74 |
%global debug_package %{nil} |
75 |
%else |
76 |
BuildArch: noarch |
77 |
%endif |
78 |
|
79 |
%description |
80 |
The International Components for Unicode (ICU) library provides robust and |
81 |
full-featured Unicode services on a wide variety of platforms. ICU supports |
82 |
the most current version of the Unicode standard, and provides support for |
83 |
supplementary characters (needed for GB 18030 repertoire support). |
84 |
|
85 |
Java provides a very strong foundation for global programs, and IBM and the |
86 |
ICU team played a key role in providing globalization technology into Sun's |
87 |
Java. But because of its long release schedule, Java cannot always keep |
88 |
up-to-date with evolving standards. The ICU team continues to extend Java's |
89 |
Unicode and internationalization support, focusing on improving |
90 |
performance, keeping current with the Unicode standard, and providing |
91 |
richer APIs, while remaining as compatible as possible with the original |
92 |
Java text and internationalization API design. |
93 |
|
94 |
%package javadoc |
95 |
Summary: Javadoc for %{name} |
96 |
Group: Development/Java |
97 |
Requires: jpackage-utils |
98 |
Requires: java-javadoc >= 0:1.6.0 |
99 |
|
100 |
%description javadoc |
101 |
Javadoc for %{name}. |
102 |
|
103 |
%if %{with_eclipse} |
104 |
%package eclipse |
105 |
Summary: Eclipse plugin for %{name} |
106 |
Group: Development/Java |
107 |
Requires: jpackage-utils |
108 |
|
109 |
%description eclipse |
110 |
Eclipse plugin support for %{name}. |
111 |
|
112 |
%endif |
113 |
|
114 |
%if %{with_extra} |
115 |
%package extra |
116 |
Summary: Extra %{name} libraries |
117 |
Group: Development/Java |
118 |
Requires: %{name} = %{version}-%{release} |
119 |
Requires: jpackage-utils |
120 |
|
121 |
%description extra |
122 |
Extra %{name} libraries. |
123 |
|
124 |
%endif |
125 |
|
126 |
%prep |
127 |
%setup -q |
128 |
#%patch0 -p0 |
129 |
|
130 |
cp %{SOURCE1} . |
131 |
|
132 |
%{__sed} -i 's/\r//' APIChangeReport.html |
133 |
%{__sed} -i 's/\r//' readme.html |
134 |
|
135 |
sed --in-place "s/ .*bootclasspath=.*//g" build.xml |
136 |
sed --in-place "s/<date datetime=.*when=\"after\"\/>//" build.xml |
137 |
sed --in-place "/javac1.3/d" build.xml |
138 |
sed --in-place "s:/usr/lib:%{_libdir}:g" build.xml |
139 |
|
140 |
%build |
141 |
%ant -Dicu4j.javac.source=1.5 -Dicu4j.javac.target=1.5 -Dj2se.apidoc=%{_javadocdir}/java jar docs |
142 |
%if %{with_eclipse} |
143 |
pushd eclipse-build |
144 |
%ant -Dj2se.apidoc=%{_javadocdir}/java -Declipse.home=%{eclipse_base} \ |
145 |
-Declipse.basews=gtk -Declipse.baseos=linux \ |
146 |
-Declipse.basearch=%{eclipse_arch} \ |
147 |
-Declipse.pde.dir=%{eclipse_base}/dropins/sdk/plugins/`ls %{eclipse_base}/dropins/sdk/plugins/|grep org.eclipse.pde.build_` |
148 |
popd |
149 |
%endif |
150 |
|
151 |
%if %{with_extra} |
152 |
ant \ |
153 |
-Dicu4j.javac.source=1.5 \ |
154 |
-Dicu4j.javac.target=1.5 \ |
155 |
-Dj2se.apidoc=%{_javadocdir}/java \ |
156 |
richeditJar richeditDocs xliff cldrUtil icutzucheck jarTests jarDemos |
157 |
|
158 |
pushd localespi |
159 |
ant \ |
160 |
-Dicu4j.javac.source=1.5 \ |
161 |
-Dicu4j.javac.target=1.5 \ |
162 |
build-jar |
163 |
popd |
164 |
%endif |
165 |
|
166 |
%install |
167 |
# jars |
168 |
%__mkdir_p %{buildroot}%{_javadir} |
169 |
%__cp -ap %{name}.jar %{buildroot}%{_javadir}/%{name}.jar |
170 |
|
171 |
# required by apache harmony |
172 |
%__cp -ap %{name}-charsets.jar %{buildroot}%{_javadir}/%{name}-charsets-%{version}.jar |
173 |
|
174 |
%__cp -ap localespi/%{name}-localespi.jar %{buildroot}%{_javadir}/%{name}-localespi-%{version}.jar |
175 |
%__cp -ap utilities.jar %{buildroot}%{_javadir}/%{name}-utilities-%{version}.jar |
176 |
%__cp -ap xliff.jar %{buildroot}%{_javadir}/%{name}-xliff-%{version}.jar |
177 |
%__cp -ap richedit/richedit.jar %{buildroot}%{_javadir}/%{name}-richedit-%{version}.jar |
178 |
%__cp -ap icu4jtzu/icutzu.jar %{buildroot}%{_javadir}/%{name}-icutzu-%{version}.jar |
179 |
|
180 |
# javadoc |
181 |
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version} |
182 |
%__cp -pr doc/* %{buildroot}%{_javadocdir}/%{name}-%{version} |
183 |
%__ln_s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name} |
184 |
|
185 |
%if %{with_eclipse} |
186 |
# eclipse |
187 |
install -d -m755 %{buildroot}/%{eclipse_base} |
188 |
|
189 |
unzip -qq -d %{buildroot}/%{eclipse_base} eclipse-build/out/projects/ICU4J.com.ibm.icu/com.ibm.icu-com.ibm.icu.zip |
190 |
%endif |
191 |
|
192 |
# maven stuff |
193 |
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir} |
194 |
cp %{name}-4.4.2.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom |
195 |
%add_to_maven_depmap com.ibm.icu %{name} %{version} JPP %{name} |
196 |
|
197 |
%post |
198 |
%update_maven_depmap |
199 |
|
200 |
%postun |
201 |
%update_maven_depmap |
202 |
|
203 |
%files |
204 |
%defattr(-,root,root,-) |
205 |
%doc readme.html APIChangeReport.html |
206 |
%{_javadir}/%{name}-%{version}.jar |
207 |
%{_javadir}/%{name}.jar |
208 |
%{_mavendepmapfragdir}/* |
209 |
%{_mavenpomdir}/*.pom |
210 |
|
211 |
%files javadoc |
212 |
%defattr(-,root,root,-) |
213 |
%doc %{_javadocdir}/* |
214 |
|
215 |
%if %{with_eclipse} |
216 |
%files eclipse |
217 |
%defattr(-,root,root,-) |
218 |
%dir %{_libdir}/eclipse |
219 |
%dir %{_libdir}/eclipse/features |
220 |
%dir %{_libdir}/eclipse/plugins |
221 |
%{_libdir}/eclipse/features/* |
222 |
%{_libdir}/eclipse/plugins/* |
223 |
%doc readme.html |
224 |
%endif |
225 |
|
226 |
%if %{with_extra} |
227 |
%files extra |
228 |
%defattr(0644,root,root,0755) |
229 |
%{_javadir}/icu4j-charsets-%{version}.jar |
230 |
%{_javadir}/icu4j-charsets.jar |
231 |
%{_javadir}/icu4j-icutzu-%{version}.jar |
232 |
%{_javadir}/icu4j-icutzu.jar |
233 |
%{_javadir}/icu4j-localespi-%{version}.jar |
234 |
%{_javadir}/icu4j-localespi.jar |
235 |
%{_javadir}/icu4j-richedit-%{version}.jar |
236 |
%{_javadir}/icu4j-richedit.jar |
237 |
%{_javadir}/icu4j-utilities-%{version}.jar |
238 |
%{_javadir}/icu4j-utilities.jar |
239 |
%{_javadir}/icu4j-xliff-%{version}.jar |
240 |
%{_javadir}/icu4j-xliff.jar |
241 |
%endif |