File mingw32-icu.spec of Package mingw32-icu

#
# spec file for package mingw32-icu
#
# Copyright (c) 2014 SUSE LINUX Products 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 source_version %(echo %{version} | sed 's/\\./_/')
Name:           mingw32-icu
Version:        53.1
Release:        0
Summary:        International Components for Unicode
License:        IPL-1.0
Group:          Development/Libraries/C and C++
Url:            http://icu-project.org
Source0:        http://download.icu-project.org/files/icu4c/%{version}/icu4c-%{source_version}-src.tgz
Patch0:         icu4c-%{source_version}-crossbuild.patch
BuildRequires:  gcc-c++
BuildRequires:  mingw32-cross-binutils
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-filesystem >= 25
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#!BuildIgnore: post-build-checks
%_mingw32_package_header_debug
BuildArch:      noarch

%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 zone support, transliteration, and word,
line, and sentence breaking, etc.

%package -n mingw32-libicu53
Summary:        International Components for Unicode (libraries)
Group:          System/Libraries
Obsoletes:      mingw32-libicu

%description -n mingw32-libicu53
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 zone support, transliteration, and word,
line, and sentence breaking, etc.

%package -n mingw32-libicu-devel
Summary:        International Components for Unicode (development files)
Group:          Development/Libraries/C and C++

%description -n mingw32-libicu-devel
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 zone support, transliteration, and word,
line, and sentence breaking, etc.

%_mingw32_debug_package

%prep
%setup -q -n icu

%patch0 -p1 -b .crossbuild

%build
pushd source

mkdir -p nativebuild

pushd nativebuild

../configure --enable-static --disable-shared

make %{?_smp_mflags} || make

popd

%{_mingw32_configure} \
	--enable-shared --disable-static \
	--with-cross-build=$(pwd)/nativebuild \
	--with-data-packaging=library

%{_mingw32_make} %{?_smp_mflags} || %{_mingw32_make}

popd

%install

pushd source

make DESTDIR=%{buildroot} install %{?_smp_mflags}

popd

# UGLY HACKS RESTARTING

find %{buildroot}%{_mingw32_libdir} -name "*.dll" -type l -delete

for i in %{buildroot}%{_mingw32_libdir}/*.dll; \
	do mv $i %{buildroot}%{_mingw32_bindir}/; done

pushd %{buildroot}%{_mingw32_libdir}

for i in *.dll.a; do mv $i lib$i; done

popd

sed -i -e 's,default_ENABLE_RPATH=.*,default_ENABLE_RPATH="N",g' %{buildroot}%{_mingw32_bindir}/icu-config

# UGLY HACKS ENDING AGAIN

%files
%defattr(-,root,root)
%{_mingw32_bindir}/genrb.exe
%{_mingw32_bindir}/gencnval.exe
%{_mingw32_bindir}/uconv.exe
%{_mingw32_bindir}/gencmn.exe
%{_mingw32_bindir}/makeconv.exe
%{_mingw32_bindir}/genbrk.exe
%{_mingw32_bindir}/gensprep.exe
%{_mingw32_bindir}/pkgdata.exe
%{_mingw32_bindir}/icupkg.exe
%{_mingw32_bindir}/derb.exe
%{_mingw32_bindir}/genccode.exe
%{_mingw32_bindir}/gencfu.exe
%{_mingw32_bindir}/gendict.exe
%{_mingw32_bindir}/gennorm2.exe
%{_mingw32_bindir}/icuinfo.exe
%{_mingw32_mandir}/man1/makeconv.1*
%{_mingw32_mandir}/man1/gencnval.1*
%{_mingw32_mandir}/man1/derb.1*
%{_mingw32_mandir}/man1/gencfu.1*
%{_mingw32_mandir}/man1/gendict.1*
%{_mingw32_mandir}/man1/icu-config.1*
%{_mingw32_mandir}/man1/genbrk.1*
%{_mingw32_mandir}/man1/uconv.1*
%{_mingw32_mandir}/man1/genrb.1*
%{_mingw32_mandir}/man1/pkgdata.1*
%{_mingw32_mandir}/man8/gencmn.8*
%{_mingw32_mandir}/man8/genccode.8*
%{_mingw32_mandir}/man8/icupkg.8*
%{_mingw32_mandir}/man8/gensprep.8*

%files -n mingw32-libicu53
%defattr(-,root,root)
%{_mingw32_bindir}/icuio53.dll
%{_mingw32_bindir}/icuuc*.dll
%{_mingw32_bindir}/icule*.dll
%{_mingw32_bindir}/icui18n*.dll
%{_mingw32_bindir}/icutu*.dll
%{_mingw32_bindir}/icudata*.dll
%{_mingw32_bindir}/iculx*.dll
%{_mingw32_bindir}/icutest*.dll

%files -n mingw32-libicu-devel
%defattr(-,root,root)
%{_mingw32_bindir}/icu-config
%{_mingw32_libdir}/libicule.dll.a
%{_mingw32_libdir}/libicudata.dll.a
%{_mingw32_libdir}/libicui18n.dll.a
%{_mingw32_libdir}/libicuuc.dll.a
%{_mingw32_libdir}/libiculx.dll.a
%{_mingw32_libdir}/libicuio.dll.a
%{_mingw32_libdir}/libicutest.dll.a
%{_mingw32_libdir}/libicutu.dll.a
%{_mingw32_libdir}/pkgconfig/icu-i18n.pc
%{_mingw32_libdir}/pkgconfig/icu-io.pc
%{_mingw32_libdir}/pkgconfig/icu-le.pc
%{_mingw32_libdir}/pkgconfig/icu-lx.pc
%{_mingw32_libdir}/pkgconfig/icu-uc.pc
%{_mingw32_includedir}/layout
%{_mingw32_includedir}/unicode
%{_mingw32_libdir}/icu
%{_mingw32_datadir}/icu

%changelog
openSUSE Build Service is sponsored by