# Copyright (c) 2000-2007, JPackage Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the # distribution. # 3. Neither the name of the JPackage Project nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # %global with_eclipse 1 %global with_extra 1 %global section free # Note: this next section looks weird having an arch specified in a # noarch specfile but the parts of the build # All arches line up between Eclipse and Linux kernel names except i386 -> x86 %ifarch %{ix86} %global eclipse_arch x86 %else %global eclipse_arch %{_arch} %endif %define section free %define eclipse_name eclipse %define eclipse_base %{_libdir}/%{eclipse_name} # Note: this next section looks weird having an arch specified in a # noarch specfile but the parts of the build # All arches line up between Eclipse and Linux kernel names except i386 -> x86 %ifarch %{ix86} %define eclipse_arch x86 %else %define eclipse_arch %{_arch} %endif Name: icu4j Version: 4.2.1 Release: %mkrel 3 Epoch: 1 Summary: International Components for Unicode for Java License: MIT and EPL URL: http://www-306.ibm.com/software/globalization/icu/index.jsp Group: Development/Java Source0: http://download.icu-project.org/files/icu4j/3.8.1/icu4j-4_2_1-src.jar Source1: http://repo2.maven.org/maven2/com/ibm/icu/icu4j/4.0.1/%{name}-4.0.1.pom Patch0: %{name}-crosslink.patch # PDE Build is in a location the upstream build.xml doesn't check Patch4: %{name}-pdebuildlocation.patch BuildRequires: ant BuildRequires: java-javadoc BuildRequires: java-rpmbuild >= 0:1.5 BuildRequires: zip Requires: jpackage-utils %if %{with_eclipse} BuildRequires: eclipse-pde >= 0:3.2.1 %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %description The International Components for Unicode (ICU) library provides robust and full-featured Unicode services on a wide variety of platforms. ICU supports the most current version of the Unicode standard, and provides support for supplementary characters (needed for GB 18030 repertoire support). Java provides a very strong foundation for global programs, and IBM and the ICU team played a key role in providing globalization technology into Sun's Java. But because of its long release schedule, Java cannot always keep up-to-date with evolving standards. The ICU team continues to extend Java's Unicode and internationalization support, focusing on improving performance, keeping current with the Unicode standard, and providing richer APIs, while remaining as compatible as possible with the original Java text and internationalization API design. %package javadoc Summary: Javadoc for %{name} Group: Development/Java Requires: jpackage-utils %description javadoc Javadoc for %{name}. %if %{with_eclipse} %package eclipse Summary: Eclipse plugin for %{name} Group: Development/Java Requires: jpackage-utils %description eclipse Eclipse plugin support for %{name}. %endif %if %{with_extra} %package extra Summary: Extra %{name} libraries Group: Development/Java Requires: %{name} = %{version}-%{release} Requires: jpackage-utils %description extra Extra %{name} libraries. %endif %prep %setup -q -c %patch0 -p0 %patch4 -p0 cp %{SOURCE1} . %{__sed} -i 's/\r//' license.html %{__sed} -i 's/\r//' APIChangeReport.html %{__sed} -i 's/\r//' readme.html sed --in-place "s/ .*bootclasspath=.*//g" build.xml sed --in-place "s///" build.xml sed --in-place "/javac1.3/d" build.xml sed --in-place "s:/usr/lib:%{_libdir}:g" build.xml %build %if %{with_eclipse} %ant -Dj2se.apidoc=%{_javadocdir}/java -Declipse.home=%{eclipse_base} \ -Declipse.basews=gtk -Declipse.baseos=linux \ -Declipse.basearch=%{eclipse_arch} \ -Dicu4j.eclipse.build.version.string=4.2.1.v20100412 \ jar docs eclipsePDEBuild %else %ant -Dicu4j.javac.source=1.5 -Dicu4j.javac.target=1.5 -Dj2se.apidoc=%{_javadocdir}/java jar docs %endif %if %{with_extra} ant \ -Dicu4j.javac.source=1.5 \ -Dicu4j.javac.target=1.5 \ -Dj2se.apidoc=%{_javadocdir}/java \ richeditJar richeditDocs xliff cldrUtil icutzucheck jarTests jarDemos pushd localespi ant \ -Dicu4j.javac.source=1.5 \ -Dicu4j.javac.target=1.5 \ build-jar popd %endif %install %__rm -rf %{buildroot} # jars %__mkdir_p %{buildroot}%{_javadir} %__cp -ap %{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar # required by apache harmony %__cp -ap %{name}-charsets.jar %{buildroot}%{_javadir}/%{name}-charsets-%{version}.jar %__cp -ap localespi/%{name}-localespi.jar %{buildroot}%{_javadir}/%{name}-localespi-%{version}.jar %__cp -ap utilities.jar %{buildroot}%{_javadir}/%{name}-utilities-%{version}.jar %__cp -ap xliff.jar %{buildroot}%{_javadir}/%{name}-xliff-%{version}.jar %__cp -ap richedit/richedit.jar %{buildroot}%{_javadir}/%{name}-richedit-%{version}.jar %__cp -ap icu4jtzu/icutzu.jar %{buildroot}%{_javadir}/%{name}-icutzu-%{version}.jar (cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do %__ln_s ${jar} `echo $jar| sed "s|-%{version}||g"`; done) # javadoc %__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version} %__cp -pr doc/* %{buildroot}%{_javadocdir}/%{name}-%{version} %__ln_s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name} %if %{with_eclipse} # eclipse install -d -m755 %{buildroot}/%{eclipse_base} unzip -qq -d %{buildroot}/%{eclipse_base} eclipseProjects/ICU4J.com.ibm.icu/com.ibm.icu-com.ibm.icu.zip %endif # maven stuff install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir} cp %{name}-4.0.1.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom %add_to_maven_depmap com.ibm.icu %{name} %{version} JPP %{name} %post %update_maven_depmap %postun %update_maven_depmap %files %defattr(0644,root,root,0755) %doc license.html readme.html APIChangeReport.html %{_javadir}/%{name}-%{version}.jar %{_javadir}/%{name}.jar %{_mavendepmapfragdir}/* %{_mavenpomdir}/JPP-icu4j.pom %files javadoc %defattr(0644,root,root,0755) %doc %{_javadocdir}/* %if %{with_eclipse} %files eclipse %defattr(0644,root,root,0755) %dir %{_libdir}/eclipse %dir %{_libdir}/eclipse/features %dir %{_libdir}/eclipse/plugins %{_libdir}/eclipse/features/* %{_libdir}/eclipse/plugins/* %doc license.html readme.html %endif %if %{with_extra} %defattr(0644,root,root,0755) %{_javadir}/icu4j-charsets-%{version}.jar %{_javadir}/icu4j-charsets.jar %{_javadir}/icu4j-icutzu-%{version}.jar %{_javadir}/icu4j-icutzu.jar %{_javadir}/icu4j-localespi-%{version}.jar %{_javadir}/icu4j-localespi.jar %{_javadir}/icu4j-richedit-%{version}.jar %{_javadir}/icu4j-richedit.jar %{_javadir}/icu4j-utilities-%{version}.jar %{_javadir}/icu4j-utilities.jar %{_javadir}/icu4j-xliff-%{version}.jar %{_javadir}/icu4j-xliff.jar %endif