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