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