Name:           m17n-lib
Version:        1.8.4
Release:        1
Summary:        Multilingual text processing library for the C language

License:        LGPLv2+
URL:            http://www.nongnu.org/m17n/
Source0:        http://download.savannah.gnu.org/releases/m17n/%{name}-%{version}.tar.gz

BuildRequires:  m17n-db-devel libthai-devel libxml2-devel libXft-devel fontconfig-devel
BuildRequires:  freetype-devel fribidi-devel gd-devel libXaw-devel libotf-devel autoconf
BuildRequires:  gettext-devel automake libtool anthy-devel

Requires:       m17n-db libotf gd anthy

Provides:       %{name}-anthy = %{version}-%{release}
Obsoletes:      %{name}-anthy < %{version}-%{release}

%description
A multilingual text processing library for the C language.
This package contains m17n-* programs.

%package devel
Summary:        Development files for m17n-lib
Requires:       %{name}-tools = %{version}-%{release}

%description devel
Development files for m17n-lib.

%package tools
Summary:        GUI Library tools for m17n-lib
Requires:       m17n-db-extras %{name} = %{version}-%{release}

%description tools
GUI Library tools for m17n-lib.

%prep
%autosetup -n %{name}-%{version} -p1

%build
%configure --disable-rpath --disable-static
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make

%install
%make_install
%delete_la

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%post tools
/sbin/ldconfig

%postun tools
/sbin/ldconfig

%files
%doc AUTHORS NEWS ChangeLog README COPYING
%dir %{_libdir}/m17n/1.0
%{_bindir}/m17n-conv
%{_libdir}/{libm17n.so.*,libm17n-core.so.*,libm17n-flt.so.*}
%{_libdir}/m17n/1.0/libmimx-anthy.so
%exclude %{_libdir}/m17n/1.0/libmimx-ispell.so

%files devel
%{_includedir}/*
%{_libdir}/{lib*.so,pkgconfig/*}

%files tools
%{_bindir}/{m17n-date,m17n-dump,m17n-edit,m17n-view}
%{_libdir}/m17n/1.0/{libm17n-X.so,libm17n-gd.so}
%{_libdir}/libm17n-gui.so.*

%changelog
* Thu Sep 28 2023 yaoxin <yao_xin001@hoperun.com> - 1.8.4-1
- Upgrade to 1.8.4

* Mon Jan 20 2020 lihao <lihao129@huawei.com> - 1.8.0-5
- Package init
