50094ee
# Copyright (c) 2000-2007, JPackage Project
50094ee
# All rights reserved.
50094ee
#
50094ee
# Redistribution and use in source and binary forms, with or without
50094ee
# modification, are permitted provided that the following conditions
50094ee
# are met:
50094ee
#
50094ee
# 1. Redistributions of source code must retain the above copyright
50094ee
#    notice, this list of conditions and the following disclaimer.
50094ee
# 2. Redistributions in binary form must reproduce the above copyright
50094ee
#    notice, this list of conditions and the following disclaimer in the
50094ee
#    documentation and/or other materials provided with the
50094ee
#    distribution.
50094ee
# 3. Neither the name of the JPackage Project nor the names of its
50094ee
#    contributors may be used to endorse or promote products derived
50094ee
#    from this software without specific prior written permission.
50094ee
#
50094ee
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
50094ee
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
50094ee
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
50094ee
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
50094ee
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50094ee
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
50094ee
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50094ee
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50094ee
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
50094ee
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50094ee
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50094ee
#
50094ee
50094ee
# If you want to build with eclipse support
50094ee
# give rpmbuild option '--with eclipse'
50094ee
c3a9fc5
%define _with_eclipse 1
50094ee
50094ee
%define with_eclipse %{?_with_eclipse:1}%{!?_with_eclipse:0}
50094ee
%define without_eclipse %{!?_with_eclipse:1}%{?_with_eclipse:0}
50094ee
50094ee
%define _with_gcj_support 1
50094ee
50094ee
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
50094ee
50094ee
%define section free
50094ee
50094ee
%define eclipse_name            eclipse
50094ee
%define eclipse_base            %{_datadir}/%{eclipse_name}
50094ee
%define eclipse_lib_base        %{_libdir}/%{eclipse_name}
50094ee
50094ee
Name:           icu4j
c3a9fc5
Version:        3.6.1
98d5f59
Release:        1jpp.2%{?dist}
50094ee
Epoch:          0
50094ee
Summary:        International Components for Unicode for Java
50094ee
License:        MIT style 
50094ee
URL:            http://www-306.ibm.com/software/globalization/icu/index.jsp
50094ee
Group:          Development/Libraries/Java
c3a9fc5
Source0:	http://download.icu-project.org/files/icu4j/3.6.1/icu4jsrc_3_6_1.jar
50094ee
Patch0:         %{name}-crosslink.patch
50094ee
Patch1:         %{name}-disable-javadocs.patch
50094ee
BuildRequires:  ant
50094ee
BuildRequires:  java-javadoc
50094ee
BuildRequires:  jpackage-utils >= 0:1.5
50094ee
Requires:       jpackage-utils
50094ee
%if %{with_eclipse}
50094ee
BuildRequires:  eclipse-pde >= 0:3.2.1
50094ee
%endif
50094ee
%if ! %{gcj_support}
50094ee
BuildArch:      noarch
50094ee
%endif
50094ee
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
50094ee
%if %{gcj_support}
50094ee
BuildRequires:          java-gcj-compat-devel
50094ee
Requires(post):         java-gcj-compat
50094ee
Requires(postun):       java-gcj-compat
50094ee
%endif
50094ee
50094ee
%description
50094ee
The International Components for Unicode (ICU) library provides robust and
50094ee
full-featured Unicode services on a wide variety of platforms. ICU supports
50094ee
the most current version of the Unicode standard, and provides support for
50094ee
supplementary characters (needed for GB 18030 repertoire support).
50094ee
50094ee
Java provides a very strong foundation for global programs, and IBM and the
50094ee
ICU team played a key role in providing globalization technology into Sun's
50094ee
Java. But because of its long release schedule, Java cannot always keep
50094ee
up-to-date with evolving standards. The ICU team continues to extend Java's
50094ee
Unicode and internationalization support, focusing on improving
50094ee
performance, keeping current with the Unicode standard, and providing
50094ee
richer APIs, while remaining as compatible as possible with the original
50094ee
Java text and internationalization API design.
50094ee
50094ee
%package javadoc
50094ee
Summary:        Javadoc for %{name}
50094ee
Group:          Development/Documentation
50094ee
Requires:       jpackage-utils
50094ee
50094ee
%description javadoc
50094ee
Javadoc for %{name}.
50094ee
50094ee
%if %{with_eclipse}
50094ee
%package eclipse
50094ee
Summary:        Eclipse plugin for %{name}
50094ee
Group:          Text Editors/Integrated Development Environments (IDE) 
50094ee
Requires:       jpackage-utils
50094ee
50094ee
%description eclipse
50094ee
Eclipse plugin support for %{name}.
50094ee
50094ee
%endif
50094ee
50094ee
%prep
50094ee
%setup -q -c
50094ee
%patch0 -p0
50094ee
%patch1 -p0
50094ee
50094ee
%{__sed} -i 's/\r//' license.html
50094ee
%{__sed} -i 's/\r//' APIChangeReport.html
50094ee
%{__sed} -i 's/\r//' readme.html
50094ee
50094ee
sed --in-place "s/ .*bootclasspath=.*//g" build.xml
c3a9fc5
sed --in-place "s/<date datetime=.*when=\"after\"\/>//" build.xml
50094ee
50094ee
%build
50094ee
%if %{without_eclipse}
c3a9fc5
%ant -Dicu4j.javac.source=1.5 -Dicu4j.javac.target=1.5 -Dj2se.apidoc=%{_javadocdir}/java jar docs
50094ee
%else
c3a9fc5
%ant -Dicu4j.javac.source=1.5 -Dicu4j.javac.target=1.5 -Dj2se.apidoc=%{_javadocdir}/java jar docs eclipseProjects
50094ee
%endif
50094ee
50094ee
%if %{with_eclipse}
50094ee
# eclipse build
50094ee
export JAVA_HOME=%{java_home}
50094ee
export PATH=%{java_bin}:/usr/bin:$PATH
50094ee
    
50094ee
# See comments in the script to understand this.
50094ee
/bin/sh -x %{eclipse_base}/buildscripts/copy-platform SDK %{eclipse_base}
50094ee
SDK=$(cd SDK >/dev/null && pwd)
50094ee
    
50094ee
# Eclipse may try to write to the home directory.
50094ee
%__mkdir_p home
50094ee
50094ee
homedir=$(cd home > /dev/null && pwd)
50094ee
50094ee
pushd eclipseProjects
50094ee
java -cp $SDK/startup.jar \
bb9346c
     -Dosgi.sharedConfiguration.area=%{_libdir}/eclipse/configuration \
50094ee
     -Duser.home=$homedir                        \
50094ee
     org.eclipse.core.launcher.Main             \
50094ee
     -application org.eclipse.ant.core.antRunner       \
50094ee
     -Dtype=feature                                    \
50094ee
     -Did=com.ibm.icu                                  \
50094ee
     -DsourceDirectory=$(pwd)                          \
50094ee
     -DbaseLocation=$SDK                               \
50094ee
     -Dbuilder=%{eclipse_base}/plugins/org.eclipse.pde.build/templates/package-build  \
50094ee
     -f %{eclipse_base}/plugins/org.eclipse.pde.build/scripts/build.xml
50094ee
50094ee
%endif
50094ee
50094ee
%install
50094ee
%__rm -rf %{buildroot} 
50094ee
50094ee
# jars
50094ee
%__mkdir_p %{buildroot}%{_javadir}
50094ee
%__cp -ap %{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
50094ee
(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do %__ln_s ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
50094ee
50094ee
# javadoc
50094ee
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
50094ee
%__cp -pr doc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
50094ee
%__ln_s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
50094ee
50094ee
%if %{with_eclipse}
50094ee
# eclipse
50094ee
install -d -m755 %{buildroot}/%{eclipse_lib_base}
50094ee
50094ee
pushd eclipseProjects
50094ee
# FIXME: icu4j generates res_index.txt differently on different arches - possible libgcj bug.
50094ee
unzip -qq -d %{buildroot}/%{_datadir}/ build/rpmBuild/com.ibm.icu.zip
50094ee
popd
50094ee
50094ee
%endif
50094ee
50094ee
%if %{gcj_support}
50094ee
%{_bindir}/aot-compile-rpm
50094ee
%endif
50094ee
50094ee
%clean
50094ee
%__rm -rf %{buildroot}
50094ee
50094ee
%if %{gcj_support}
50094ee
%post
50094ee
if [ -x %{_bindir}/rebuild-gcj-db ]
50094ee
then
50094ee
  %{_bindir}/rebuild-gcj-db
50094ee
fi
50094ee
%endif
50094ee
50094ee
%if %{gcj_support}
50094ee
%postun
50094ee
if [ -x %{_bindir}/rebuild-gcj-db ]
50094ee
then
50094ee
  %{_bindir}/rebuild-gcj-db
50094ee
fi
50094ee
%endif
50094ee
50094ee
%files
50094ee
%defattr(0644,root,root,0755)
50094ee
%doc license.html readme.html APIChangeReport.html
50094ee
%{_javadir}/%{name}*.jar
50094ee
%if %{gcj_support}
50094ee
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
c3a9fc5
%attr(-,root,root) %{_libdir}/gcj/%{name}/icu4j-%{version}.jar.*
50094ee
%endif
50094ee
50094ee
%files javadoc
50094ee
%defattr(0644,root,root,0755)
50094ee
%doc %{_javadocdir}/*
50094ee
50094ee
%if %{with_eclipse}
50094ee
%files eclipse
50094ee
%defattr(0644,root,root,0755)
c3a9fc5
%dir %{_datadir}/eclipse
c3a9fc5
%dir %{_datadir}/eclipse/features
c3a9fc5
%dir %{_datadir}/eclipse/plugins
50094ee
%{_datadir}/eclipse/features/*
50094ee
%{_datadir}/eclipse/plugins/*
50094ee
%doc license.html readme.html
50094ee
%if %{gcj_support}
50094ee
%{_libdir}/gcj/%{name}/com.ibm.icu*
50094ee
%endif
50094ee
%endif
50094ee
50094ee
%changelog
98d5f59
* Wed Jun 27 2007 Ben Konrath <bkonrath@redhat.com> - 0:3.6.1-1jpp.2
98d5f59
- Remove requires eclipse-rcp in eclipse sub-package.
98d5f59
c3a9fc5
* Thu Jun 07 2007 Ben Konrath <bkonrath@redhat.com> - 0:3.6.1-1jpp.1
c3a9fc5
- 3.6.1.
c3a9fc5
- Enable eclipse sub-package.
c3a9fc5
bb9346c
* Fri Mar 16 2007 Jeff Johnston <jjohnstn@redhat.com> - 0:3.4.5-2jpp.2
bb9346c
- Disable eclipse plugin support temporarily until build problems
bb9346c
  can be worked out.  Plugin is still being built as part of
bb9346c
  eclipse platform.
bb9346c
- BuildRequire sinjdoc.
bb9346c
50094ee
* Mon Feb 12 2007 Matt Wringe <mwringe@redhat.com> - 0:3.4.5-2jpp.1
50094ee
- Fix some rpmlint issues
50094ee
- Make use of buildroot more consistent
50094ee
- Remove javadoc post and postun sections as per new jpp standard
50094ee
- Change license section to 'MIT style' license from 'MIT' license.
50094ee
  This was done since the source package calls the license the 
50094ee
  "X license" (see readme.html in src jar).
50094ee
- Install eclipse plugin into /usr/share/eclipse
50094ee
50094ee
* Mon Jan 22 2007 Fernando Nasser <fnasser@redhat.com> - 0:3.4.5-2jpp.1
50094ee
- Merge with upstream
50094ee
50094ee
* Mon Jan 22 2007 Fernando Nasser <fnasser@redhat.com> - 0:3.4.5-2jpp
50094ee
- Add optional eclipse subpackage, created by
50094ee
  Jeff Johnston  <jjohnstn@rdhat.com> :
50094ee
- Add eclipse sub-package to create plugins.
50094ee
50094ee
* Mon Jan 22 2007 Fernando Nasser <fnasser@redhat.com> - 0:3.4.5-1jpp
50094ee
- Upgrade to 3.4.5 with merge
50094ee
- Re-enable javadoc
50094ee
50094ee
* Mon Sep 04 2006 Ben Konrath <bkonrath@redhat.com> 0:3.4.5-1jpp_1fc
50094ee
- 3.4.5.
50094ee
- Add GCJ support with spec-convert-gcj-1.6.
50094ee
50094ee
* Mon Jul 17 2006 Ben Konrath <bkonrath@redhat.com> 0:3.4.4-1jpp_1fc
50094ee
- 3.4.4.
50094ee
- Add disable javadocs patch.
50094ee
50094ee
* Tue Feb 28 2006 Fernando Nasser <fnasser@redhat.com> - 0:3.2-2jpp_1rh
50094ee
- First Red Hat build
50094ee
50094ee
* Mon Feb 27 2006 Fernando Nasser <fnasser@redhat.com> - 0:3.2-2jpp
50094ee
- First JPP 1.7 build
50094ee
50094ee
* Sun Jan 29 2005 David Walluck <david@jpackage.org> 0:3.2-1jpp
50094ee
- release (contributed by Mary Ellen Foster <mefoster at gmail.com>)