SHA256
1
0
forked from pool/icu
icu/icu-59.spec

238 lines
7.3 KiB
RPMSpec

#
# spec file for package icu-59
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define lname libicu59_1
%define amajor 59
%define aversion 59_1
%ifarch %armb hppa mips mips64 ppc ppc64 %sparc s390 s390x m68k
%define be_platform 1
%else
%define be_platform 0
%endif
Name: icu-59
Version: 59.1
Release: 0
Summary: International Components for Unicode
License: ICU
Group: Development/Libraries/C and C++
Url: http://icu-project.org/
Source: http://download.icu-project.org/files/icu4c/%version/icu4c-%aversion-src.tgz
Source100: baselibs.conf
Patch3: icu-versioning.diff
Patch4: icu-fix-install-mode-files.diff
Patch6: icu-error-reporting.diff
Patch7: icu-avoid-x87-excess-precision.diff
Patch8: xlocale.patch
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: pkg-config
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
ICU is a set of C and C++ libraries that provide extensive Unicode and locale
support, such as calendar, 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 zone support, transliteration, and word, line, and
sentence breaking.
This subpackage contains the runtime programs for interacting with ICU.
%package -n %lname
Summary: International Components for Unicode
Group: System/Libraries
Requires: timezone
# Following O/P added in timeframe for 12.2
Provides: libicu = %version
Obsoletes: libicu < %version
%if %be_platform
Requires: libicu%aversion-bedata = %version
%else
Requires: libicu%aversion-ledata = %version
%endif
%description -n %lname
ICU is a set of C and C++ libraries that provide extensive Unicode
and locale support.
This package contains the runtime libraries for ICU.
%package -n libicu%aversion-bedata
Summary: Rule databases and tables for ICU
Group: System/Libraries
%if 0%{?suse_version} >= 1210
BuildArch: noarch
%endif
%if %be_platform
# Added for 13.2
Obsoletes: libicu%aversion-data < %version
Provides: libicu%aversion-data = %version
%endif
%description -n libicu%aversion-bedata
ICU is a set of C and C++ libraries that provide extensive Unicode
and locale support.
ICU makes use of a wide variety of data tables to provide many of its
services: converter mapping tables, collation rules, transliteration
rules, break iterator rules and dictionaries.
This subpackage contains these data tables, in big-endian format.
%package -n libicu%aversion-ledata
Summary: Rule databases and tables for ICU
Group: System/Libraries
%if 0%{?suse_version} >= 1210
BuildArch: noarch
%endif
%if !%be_platform
# Added for 13.2
Obsoletes: libicu%aversion-data < %version
Provides: libicu%aversion-data = %version
%endif
%description -n libicu%aversion-ledata
ICU is a set of C and C++ libraries that provide extensive Unicode
and locale support.
ICU makes use of a wide variety of data tables to provide many of its
services: converter mapping tables, collation rules, transliteration
rules, break iterator rules and dictionaries.
This subpackage contains these data tables, in little-endian format.
%package -n libicu-59-devel
Summary: Development files for the ICU library
Group: Development/Libraries/C and C++
Requires: %lname = %version
%description -n libicu-59-devel
ICU is a set of C and C++ libraries that provide extensive Unicode
and locale support.
This package contains the headers for ICU.
%prep
%setup -q -n icu
%patch -P 3 -P 4 -P 6 -P 7 -P 8 -p1
%build
cd source
export CXXFLAGS="%optflags -DICU_DATA_DIR=\\\"%_datadir/icu/%version/\\\""
export CFLAGS="$CXXFLAGS"
%configure \
--disable-static \
--enable-shared \
--disable-samples \
--with-data-packaging=archive
make %{?_smp_mflags} VERBOSE=1
# Build the other endianess, too.
pushd data/
%if %be_platform
cp in/icudt%{amajor}l.dat out/
%else
LD_LIBRARY_PATH="../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH" \
../bin/icupkg -tb in/icudt%{amajor}l.dat out/icudt%{amajor}b.dat
! cmp in/icudt%{amajor}l.dat out/icudt%{amajor}b.dat
%endif
popd
%install
mkdir -p "%buildroot/%_docdir/%name"
find . -name CVS -type d -exec rm -Rf "{}" "+"
cd source
%make_install
cp data/out/icudt*.dat "%buildroot/%_datadir/icu/%version/"
#
# ICU's "pkgdata" utility is really fragile, so icu-versioning.diff
# does as few actions as possible, but that means we need some additional
# cleanup in the spec file now.
#
pushd "%buildroot/%_libdir/"
for i in *.so.[0-9]*; do
echo "Looking at $i"
if [ "${i##*.so.}" != "%version" ]; then
rm -fv "$i"
continue
fi
# Because U_ICU_VERSION_SHORT is "51_2" and not "51.2",
# create some symlinks.
ln -s "$i" "${i%%%version}%aversion"
done
popd
# /usr/lib/rpm/elfdeps requires +x bit and not all files had it at one point.
# - OpenBSD for example is known to have patched their libtool program
# to kill the x bit on install :(
chmod a+rx "%buildroot/%_libdir"/lib*.so.*
# install uncompiled source data:
mkdir -p "%buildroot/%_datadir/icu/%version/unidata"
install -m 644 data/unidata/*.txt "%buildroot/%_datadir/icu/%version/unidata"
ln -s unidata/UnicodeData.txt "%buildroot/%_datadir/icu/%version/"
rm "%buildroot/%_datadir/icu/%version/install-sh"
rm -Rf "%buildroot/%_mandir" "%buildroot/%_datadir/icu/59.1/unidata" \
"%buildroot/%_datadir/icu/59.1/UnicodeData.txt" \
"%buildroot/%_sbindir"/* "%buildroot/%_libdir/icu/current" \
"%buildroot/%_bindir"/{derb,genbrk,gencfu,gencnval,gendict,genrb,icuinfo,makeconv,pkgdata,uconv} \
"%buildroot/%_libdir/icu/Makefile.inc" \
"%buildroot/%_libdir/icu/pkgdata.inc"
%fdupes %buildroot/%_prefix
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig
%files -n %lname
%defattr(-, root, root)
%_libdir/libicu*.so.*
%dir %_datadir/icu
%dir %_datadir/icu/%version
%_datadir/icu/%version/LICENSE
%doc license.html readme.html
%files -n libicu%aversion-bedata
%defattr(-,root,root)
%dir %_datadir/icu
%dir %_datadir/icu/%version
%_datadir/icu/%version/icudt%{amajor}b.dat
%files -n libicu%aversion-ledata
%defattr(-,root,root)
%dir %_datadir/icu
%dir %_datadir/icu/%version
%_datadir/icu/%version/icudt%{amajor}l.dat
%files -n libicu-59-devel
%defattr(-, root, root)
%_libdir/libicu*.so
%_includedir/unicode/
%dir %_libdir/icu/
%dir %_libdir/icu/%version/
%_libdir/icu/%version/Makefile.inc
%_libdir/icu/%version/pkgdata.inc
%_libdir/pkgconfig/icu-*.pc
%_bindir/icu-config
%dir %_datadir/icu/
%dir %_datadir/icu/%version/
%_datadir/icu/%version/mkinstalldirs
%_datadir/icu/%version/config/
%changelog