icu/icu.spec
author pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
Mon, 14 Nov 2011 11:18:43 +0100
changeset 86 0461312d873a
parent 85 de8b1a6f312b
permissions -rw-r--r--
back out the previous change as it is not targeted to SRU

#   Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#   Copyright (C) 2000-2005, International Business Machines
#   Corporation and others.  All Rights Reserved.
#
# RPM specification file for ICU.
#
# Yves Arrouye <[email protected]> is the original author.

# This file can be freely redistributed under the same license as ICU.

%define src_name icu
#%define src_url http://download.icu-project.org/files/icu4c
%define svn_url http://source.icu-project.org/repos/icu/icu
%define pkgversion 4_6
%define svn_pkgversion 4-6
%define majorminor 4.6

%include Solaris.inc

Name: SUNWicu
SUNW_BaseDir: %{_basedir}
Version: 4.6.1
Release: 1
Summary: International Components for Unicode
Copyright: X License, Unicode License
%if %{is_s10}
%else
IPS_Package_Name:	library/icu
IPS_Component_Version:	%{ipscompverdefault}
Meta(info.classification):	%{ipsclass_sys_i18n}
Meta(pkg.description): "ICU is a set of C and C++ libraries that provides robust and full-featured Unicode and locale support. The library provides calendar support, conversions for many character sets, language sensitive collation, date and time formatting, support for many locales, message catalogs and resources, message formatting, normalization, number and currency formatting, time zones support, transliteration, word, line and sentence breaking, etc. This package contains the Unicode character database and derived properties, along with converters and time zones data. This package contains the runtime libraries for ICU."
%endif
#Source: %{src_url}/%{version}/icu4c-%{pkgversion}-src.tgz
Source2: libicui18n.3lib
Source3: libicuuc.3lib
Source4: libiculx.3lib
Source5: libicule.3lib
Source6: libicudata.3lib
Source7: libicutu.3lib
Source8: libicuio.3lib

#Sun patches
Patch0:  source_data_mappings_johab.ucm.patch
Patch4:  source_common_ucnv2022.c.patch
Patch5:  source_common_ucnv_u7.c.patch
Patch6:  source_config_mh_solaris.patch
Patch10: source_data_mappings_convrtrs.txt.patch
Patch11: source_data_mappings_ucmfiles.mk.patch
Patch21: source_runConfigureICU.patch
#patches 25, 26 align tests to previous Oracle modifications
Patch25: source_common_testdata_conversion.txt.patch
Patch26: source_test_ccapitst.c.patch
Patch27: source_i18n_decNumber.h.patch

BuildRoot: %{_tmppath}/%{name}-%{version}
SUNW_Copyright: %{src_name}.copyright
%include icu.depend

%package -n SUNWicud
Summary: International Components for Unicode (development files)
%if %{is_s10}
%else
IPS_Package_Name:	developer/icu
Meta(pkg.description): "ICU is a set of C and C++ libraries that provides robust and full-featured Unicode and locale support. The library provides calendar support, conversions for many character sets, language sensitive collation, date and time formatting, support for many locales, message catalogs and resources, message formatting, normalization, number and currency formatting, time zones support, transliteration, word, line and sentence breaking, etc. This package contains development files and utilities."
%endif
%include icu.depend
Requires: SUNWicu

%prep
#We must fetch locale data directory from svn repository
#%setup -q -n icu
rm -rf %{src_name}-%version
mkdir %{src_name}-%version
cd %{src_name}-%version
rm -rf %{src_name}
[ ! -f $HOME/packages/SOURCES/%{src_name}-%version.tar.bz2 ] && {
	mkdir -p $HOME/packages/SOURCES/
	[ -f $DOWNLOADS/%{src_name}-%version.tar.bz2 ] && {
		cp $DOWNLOADS/%{src_name}-%version.tar.bz2 $HOME/packages/SOURCES/%{src_name}-%version.tar.bz2
	} || {
  		svn export %{svn_url}/tags/release-%{svn_pkgversion} %{src_name}
        	tar fcp - %{src_name} | bzip2 -c > $HOME/packages/SOURCES/%{src_name}-%version.tar.bz2
	}
}
[ ! -d %{src_name} ] && bunzip2 -c $HOME/packages/SOURCES/%{src_name}-%version.tar.bz2 | tar fxp -
#Oracle patches
cd %{src_name}
%patch0  -p1  
%patch4  -p1
%patch5  -p1
%ifarch sparc
%patch6  -p1
%endif
%patch10 -p1
%patch11 -p1
%patch21 -p1
%patch25 -p1
%patch26 -p1
%patch27

%ifarch amd64 sparcv9
cd ..
rm -rf %{src_name}-64
cp -rp %{src_name} %{src_name}-64
%endif

%build
cd %{src_name}-%{version}
cd %{src_name}
cd source
chmod a+x ./configure
chmod a+x ./runConfigureICU
export CFLAGS="%optflags"
export CXXFLAGS="%cxx_optflags"
export LDFLAGS="%_ldflags -lCrun -lCstd"

%ifarch i386 amd64
OSTARGET=SolarisX86
%else 
OSTARGET=Solaris
%endif
./runConfigureICU ${OSTARGET} --prefix=%{_prefix} --libdir=%{_libdir} --sysconfdir=/etc --with-data-packaging=library --enable-shared --enable-static --disable-samples --disable-64bit-libs
echo 'CPPFLAGS += -DICU_DATA_DIR=\"/usr/share/icu/%{version}\"' >> icudefs.mk
gmake RPM_OPT_FLAGS="$RPM_OPT_FLAGS"

%ifarch amd64 sparcv9
pwd
cd ../../%{src_name}-64
cd source
chmod a+x ./configure
chmod a+x ./runConfigureICU
export CFLAGS="%optflags"
export CXXFLAGS="%cxx_optflags"
export LDFLAGS="%_ldflags -lCrun -lCstd"

./runConfigureICU ${OSTARGET} --prefix=%{_prefix}/%{_arch64} --libdir=%{_libdir}/%{_arch64} --sysconfdir=/etc/%{_arch64} --with-data-packaging=library --enable-shared --enable-static --disable-samples --with-library-bits=64 --bindir=%{_bindir}/%{_arch64} --sbindir=/usr/sbin/%{_arch64}
echo 'CPPFLAGS += -DICU_DATA_DIR=\"/usr/share/icu/%{version}\"' >> icudefs.mk
gmake RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
%endif

%install
rm -rf $RPM_BUILD_ROOT
cd %{src_name}-%{version}
cd %{src_name}
cd source
gmake install DESTDIR=$RPM_BUILD_ROOT

cd $RPM_BUILD_DIR/%{src_name}-%{version}

%ifarch amd64 sparcv9
cd %{src_name}-64
cd source
DESTDIR=${RPM_BUILD_ROOT} gmake install
%endif

find ${RPM_BUILD_ROOT} -name "*.a" -exec rm -rf {} \; -print
rm -rf ${RPM_BUILD_ROOT}/usr/lib/icu/current
rm -f ${RPM_BUILD_ROOT}/usr/lib/icu/Makefile.inc
rm -f ${RPM_BUILD_ROOT}/usr/lib/icu/pkgdata.inc
rm -rf ${RPM_BUILD_ROOT}/usr/amd64
rm -rf ${RPM_BUILD_ROOT}/usr/sparcv9
rm -rf ${RPM_BUILD_ROOT}/usr/lib/amd64/icu
rm -rf ${RPM_BUILD_ROOT}/usr/lib/sparcv9/icu
rm -rf ${RPM_BUILD_ROOT}/usr/share/icu
mv ${RPM_BUILD_ROOT}/usr/lib/icu/4.6/pkgdata.inc ${RPM_BUILD_ROOT}/usr/lib/icu
mv ${RPM_BUILD_ROOT}/usr/lib/icu/4.6/Makefile.inc ${RPM_BUILD_ROOT}/usr/lib/icu
rm -rf ${RPM_BUILD_ROOT}/usr/lib/icu/4.6

mkdir ${RPM_BUILD_ROOT}/usr/share/man/man1m
mv ${RPM_BUILD_ROOT}/usr/share/man/man8/genccode.8 ${RPM_BUILD_ROOT}/usr/share/man/man1m/genccode.1m
mv ${RPM_BUILD_ROOT}/usr/share/man/man8/gencmn.8 ${RPM_BUILD_ROOT}/usr/share/man/man1m/gencmn.1m
mv ${RPM_BUILD_ROOT}/usr/share/man/man8/gensprep.8 ${RPM_BUILD_ROOT}/usr/share/man/man1m/gensprep.1m
mv ${RPM_BUILD_ROOT}/usr/share/man/man8/icupkg.8 ${RPM_BUILD_ROOT}/usr/share/man/man1m/icupkg.1m
rmdir ${RPM_BUILD_ROOT}/usr/share/man/man8

mkdir ${RPM_BUILD_ROOT}/usr/share/man/man3lib
cp %SOURCE2 ${RPM_BUILD_ROOT}/usr/share/man/man3lib
cp %SOURCE3 ${RPM_BUILD_ROOT}/usr/share/man/man3lib
cp %SOURCE4 ${RPM_BUILD_ROOT}/usr/share/man/man3lib
cp %SOURCE5 ${RPM_BUILD_ROOT}/usr/share/man/man3lib
cp %SOURCE6 ${RPM_BUILD_ROOT}/usr/share/man/man3lib
cp %SOURCE7 ${RPM_BUILD_ROOT}/usr/share/man/man3lib
cp %SOURCE8 ${RPM_BUILD_ROOT}/usr/share/man/man3lib

# removing CDDL from copies of source/text files delivered to the binary product
(cd ${RPM_BUILD_ROOT}; ggrep -rlF 'CDDL HEADER START' . 2>/dev/null|xargs perl -i -ne 'print unless /CDDL HEADER START/ .. /CDDL HEADER END/')

%files
%defattr(-, root, bin)
%dir %attr (0755, root, bin) %{_libdir}/lib*.so*
%dir %attr (0755, root, bin) %{_libdir}/icu

%ifarch amd64 sparcv9
%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/lib*.so*
%endif

%files -n SUNWicud
%defattr(-, root, bin)
%dir %attr (0755, root, bin) /usr/include/unicode/*.h
%dir %attr (0755, root, bin) /usr/include/layout/*.h
%dir %attr (0755, root, bin) %{_libdir}/icu/pkgdata.inc
%dir %attr (0755, root, bin) %{_libdir}/icu/Makefile.inc

%dir %attr (0755, root, other) %{_libdir}/pkgconfig
%dir %attr (0755, root, other) %{_libdir}/pkgconfig/icu-le.pc
%dir %attr (0755, root, other) %{_libdir}/pkgconfig/icu-io.pc
%dir %attr (0755, root, other) %{_libdir}/pkgconfig/icu-i18n.pc
%dir %attr (0755, root, other) %{_libdir}/pkgconfig/icu-uc.pc
%dir %attr (0755, root, other) %{_libdir}/pkgconfig/icu-lx.pc
%ifarch amd64 sparcv9
%dir %attr (0755, root, other) %{_libdir}/%{_arch64}/pkgconfig
%dir %attr (0755, root, other) %{_libdir}/%{_arch64}/pkgconfig/icu-le.pc
%dir %attr (0755, root, other) %{_libdir}/%{_arch64}/pkgconfig/icu-io.pc
%dir %attr (0755, root, other) %{_libdir}/%{_arch64}/pkgconfig/icu-i18n.pc
%dir %attr (0755, root, other) %{_libdir}/%{_arch64}/pkgconfig/icu-uc.pc
%dir %attr (0755, root, other) %{_libdir}/%{_arch64}/pkgconfig/icu-lx.pc
%endif

%dir %attr (0755, root, bin) /usr/bin/derb
%dir %attr (0755, root, bin) /usr/bin/genbrk
%dir %attr (0755, root, bin) /usr/bin/gencfu
%dir %attr (0755, root, bin) /usr/bin/gencnval
%dir %attr (0755, root, bin) /usr/bin/genrb
%dir %attr (0755, root, bin) /usr/bin/icu-config
%dir %attr (0755, root, bin) /usr/bin/icuinfo
%dir %attr (0755, root, bin) /usr/bin/makeconv
%dir %attr (0755, root, bin) /usr/bin/pkgdata
%dir %attr (0755, root, bin) /usr/bin/uconv
%dir %attr (0755, root, bin) /usr/bin/genctd

%dir %attr (0755, root, bin) /usr/sbin/genccode
%dir %attr (0755, root, bin) /usr/sbin/gencmn
%dir %attr (0755, root, bin) /usr/sbin/gennorm2
%dir %attr (0755, root, bin) /usr/sbin/gensprep
%dir %attr (0755, root, bin) /usr/sbin/icupkg

%ifarch amd64 sparcv9
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/derb
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/genbrk
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/gencfu
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/gencnval
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/genrb
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/icu-config
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/icuinfo
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/makeconv
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/pkgdata
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/uconv
%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}/genctd

%dir %attr (0755, root, bin) /usr/sbin/%{_arch64}/genccode
%dir %attr (0755, root, bin) /usr/sbin/%{_arch64}/gencmn
%dir %attr (0755, root, bin) /usr/sbin/%{_arch64}/gennorm2
%dir %attr (0755, root, bin) /usr/sbin/%{_arch64}/gensprep
%dir %attr (0755, root, bin) /usr/sbin/%{_arch64}/icupkg
%endif

%dir %attr (0755, root, sys) %{_datadir}
%dir %attr (0755, root, bin) %{_mandir}
%dir %attr (0444, root, bin) /usr/share/man/man1/derb.1
%dir %attr (0444, root, bin) /usr/share/man/man1/genbrk.1
%dir %attr (0444, root, bin) /usr/share/man/man1/gencnval.1
%dir %attr (0444, root, bin) /usr/share/man/man1/genctd.1
%dir %attr (0444, root, bin) /usr/share/man/man1/genrb.1
%dir %attr (0444, root, bin) /usr/share/man/man1/icu-config.1
%dir %attr (0444, root, bin) /usr/share/man/man1/makeconv.1
%dir %attr (0444, root, bin) /usr/share/man/man1/pkgdata.1
%dir %attr (0444, root, bin) /usr/share/man/man1/uconv.1
%dir %attr (0444, root, bin) /usr/share/man/man1m/genccode.1m
%dir %attr (0444, root, bin) /usr/share/man/man1m/gencmn.1m
%dir %attr (0444, root, bin) /usr/share/man/man1m/gensprep.1m
%dir %attr (0444, root, bin) /usr/share/man/man1m/icupkg.1m
%dir %attr (0444, root, bin) /usr/share/man/man3lib/libicudata.3lib
%dir %attr (0444, root, bin) /usr/share/man/man3lib/libicui18n.3lib
%dir %attr (0444, root, bin) /usr/share/man/man3lib/libicuio.3lib
%dir %attr (0444, root, bin) /usr/share/man/man3lib/libicule.3lib
%dir %attr (0444, root, bin) /usr/share/man/man3lib/libiculx.3lib
%dir %attr (0444, root, bin) /usr/share/man/man3lib/libicutu.3lib
%dir %attr (0444, root, bin) /usr/share/man/man3lib/libicuuc.3lib

%changelog
* Fri May  6 2011 Pavel Heimlich <[email protected]>
- fix CR 7038520 - broken symlink
* Mon May  2 2011 Pavel Heimlich <[email protected]>
- fix CR 7035907
- EOF ICU2 and ICU 3
* Thu Mar 24 2011 Pavel Heimlich <[email protected]>
- ICU 4.6.1
- delete unused patches
* Thu Oct 21 2010 Pavel Heimlich <[email protected]>
- fix 6966217 in the .so.3 libraries (old_libs)
- add JDS includes
- partial fix of 6944449(icu 4.0.1 test suites output some errors in locale ja_JP.)
* Sun Mar 21 2010 Suresh Chandrasekharan <[email protected]>
- Run runConfigureICU instead of configure. Pass OS version to that
- Added patch for removing reassigning CC/CXX within runConfigureICU
- Additional Makefile.in patches for lCstd library for icu libs which
  were compiling without them.
- tarred up/gziped old_lib contents
- Removed reliance of information about current child WS in spec file
- Added tarfile directory in pkgtool options in build-icu.sh
* Thu Apr 30 2009 Feng Zhu <[email protected]>
- Checkout source from svn repository because it has locale data src files.
* Tue Feb 24 2009 Rachel Zhang <[email protected]>
- remove man pages from SUNWicud, since they will be added by SUNWman via Man Page group

* Mon Feb 8 2009 Rachel Zhang <[email protected]>
- redesign SUNWlibicu-40 to SUNWicu, including old 3.2,2.1 libs in SUNWicu

* Fri Jan 16 2009 Rachel Zhang <[email protected]>
- update to 4.0 for Solaris pkgs
* Mon Jun 07 2004 Alexei Dets <[email protected]>
- update to 3.0
* Tue Aug 16 2003 Steven Loomis <[email protected]>
- update to 2.6.1 - include license
* Thu Jun 05 2003 Steven Loomis <[email protected]>
- Update to 2.6
* Fri Dec 27 2002 Steven Loomis <[email protected]>
- Update to 2.4 spec
* Fri Sep 27 2002 Steven Loomis <[email protected]>
- minor updates to 2.2 spec. Rpath is off by default, don't pass it as an option.
* Mon Sep 16 2002 Ian Holsman <[email protected]>
- update to icu 2.2