icu/icu.spec
author yukie
Tue, 30 Mar 2010 13:17:20 +0900
changeset 16 203ac65605c6
parent 12 ec51c44224ba
child 25 f705116c90cb
permissions -rw-r--r--
Changed OLD_LIBS location

#   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_0_1
%define svn_pkgversion 4-0-1

%include Solaris.inc

Name: SUNWicu
SUNW_BaseDir: %{_basedir}
Version: 4.0.1
Release: 1
Summary: International Components for Unicode
Copyright: X License
Group: System Environment/Libraries
#Source: %{src_url}/%{version}/icu4c-%{pkgversion}-src.tgz
Source1: old_libs.tar.gz
#Sun patches
Patch0:  source_data_mappings_johab.ucm.patch
#Patch1:  source_common_putil.c.patch
#Patch2:  source_common_ucase.c.patch
#Patch3:  source_common_uchar.c.patch
Patch4:  source_common_ucnv2022.c.patch
Patch5:  source_common_ucnv_u7.c.patch
#Patch6:  source_common_unicode_utypes.h.patch
#Patch7:  source_common_unicode_uversion.h.patch
#Patch8:  source_config_mh-solaris.patch
Patch6:  source_configure.patch
Patch7:  source_config_mh-solaris-x86.patch
Patch8:  source_config_mh-solaris-sparc.patch
Patch9:  source_data_makedata.mak.patch
Patch10: source_data_mappings_convrtrs.txt.patch
Patch11: source_data_mappings_ucmfiles.mk.patch
Patch12: source_data_misc_zoneinfo.txt.patch
Patch13: source_i18n_regexcmp.cpp.patch
Patch14: source_icudefs.mk.in.patch
Patch15: source_io_Makefile.in.patch
#Patch16: source_test_cintltst_udatatst.c.patch
Patch17: source_test_intltest_regextst.cpp.patch
Patch18: source_test_intltest_regextst.h.patch
Patch19: source_tools_pkgdata_dllmode.c.patch
Patch20: source_i18n_Makefile.in.patch

BuildRoot: %{_tmppath}/%{name}-%{version}
SUNW_Copyright: %{src_name}.copyright
%include icu.depend
%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.

%package -n SUNWicud
Summary: International Components for Unicode (development files)
Group: Development/Libraries
%include icu.depend
Requires: SUNWicu
%description -n SUNWicud
ICU is a set of C and C++ libraries that provides robust and full-featured

%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 ] && {
        /usr/bin/svn export %{svn_url}/tags/release-%{svn_pkgversion} %{src_name}
        tar fcp - %{src_name} | bzip2 -c > ../../SOURCES/%{src_name}-%version.tar.bz2
}
[ ! -d %{src_name} ] && bunzip2 -c $HOME/packages/SOURCES/%{src_name}-%version.tar.bz2 | tar fxp -
#Sun patches
cd %{src_name}
%patch0  -p1  
#%patch1  -p1  
#%patch2  -p1 
#%patch3  -p1
%patch4  -p1
%patch5  -p1
%patch6  -p1
%patch7  -p1
%patch8  -p1
%patch9  -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
#%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
#cat Makefile.config.in %{PATCH2} > Makefile.config
#touch Makefile.depend


%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
export CXX="${CXX} -norunpath"
export CFLAGS="%optflags"
export CXXFLAGS="%cxx_optflags"
export LDFLAGS="%_ldflags"

#CFLAGS="%optflags" CXXFLAGS="%cxx_optflags" LDFLAGS="%_ldflags" ./configure --prefix=/usr --sysconfdir=/etc --with-data-packaging=files --enable-shared --enable-static --disable-samples --disable-64-bit-libs
./configure --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
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"

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

#CFLAGS="%optflags64" CXXFLAGS="%cxx_optflags64" LDFLAGS="%_ldflags" ./configure --prefix=/usr/lib/%{_arch64} --sysconfdir=/etc/%{_arch64} --with-data-packaging=files --enable-shared --enable-static --disable-samples
./configure --prefix=%{_prefix}/%{_arch64} --libdir=%{_libdir}/%{_arch64} --sysconfdir=/etc/%{_arch64} --with-data-packaging=library --enable-shared --enable-static --disable-samples
echo 'CPPFLAGS += -DICU_DATA_DIR=\"/usr/share/icu/%{version}\"' >> icudefs.mk
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
%endif

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

cd $RPM_BUILD_DIR/%{src_name}-%{version}
/usr/bin/gzip -dc %SOURCE1 | /usr/bin/tar xf -
OLD_LIBS=$RPM_BUILD_DIR/%{src_name}-%{version}/old_libs/`uname -p`
cp ${OLD_LIBS}/lib*.so.3 ${RPM_BUILD_ROOT}/%{_libdir}
cp ${OLD_LIBS}/lib*.so.2 ${RPM_BUILD_ROOT}/%{_libdir}
cp -r ${RPM_BUILD_ROOT}/usr/man ${RPM_BUILD_ROOT}/usr/share/man
mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}/icu/4

%ifarch amd64 sparcv9
cd %{src_name}-64
cd source
DESTDIR=${RPM_BUILD_ROOT} make install
OLD_LIBS=${RPM_BUILD_DIR}/%{src_name}-%{version}/old_libs/`uname -p`
cp ${OLD_LIBS}/%{_arch64}/lib*.so.3 ${RPM_BUILD_ROOT}/%{_libdir}/%{_arch64}
cp ${OLD_LIBS}/%{_arch64}/lib*.so.2 ${RPM_BUILD_ROOT}/%{_libdir}/%{_arch64}
%endif

find ${RPM_BUILD_ROOT} -name "*.a" -exec rm -rf {} \; -print
find ${RPM_BUILD_ROOT} -name "icudt401" -exec rm -rf {} \; -print
rm -rf ${RPM_BUILD_ROOT}/usr/lib/icu/current
rm -rf ${RPM_BUILD_ROOT}/usr/lib/icu/Makefile.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/%{version}/icudt40l
rm -rf ${RPM_BUILD_ROOT}/usr/share/icu/%{version}/icudt40b
rm -rf ${RPM_BUILD_ROOT}/usr/share/icu/%{version}/config/*
rm -rf ${RPM_BUILD_ROOT}/usr/share/icu/%{version}/install-sh
rm -rf ${RPM_BUILD_ROOT}/usr/share
rm -rf ${RPM_BUILD_ROOT}/usr/man

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

%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/%{version}/Makefile.inc
%dir %attr (0755, root, bin) /usr/bin/derb
%dir %attr (0755, root, bin) /usr/bin/genbrk
%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/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/gensprep
%dir %attr (0755, root, bin) /usr/sbin/genuca
%dir %attr (0755, root, bin) /usr/sbin/icuswap
%dir %attr (0755, root, bin) /usr/sbin/icupkg


%changelog
* 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