Name:          m17n-db
Version:       1.8.0
Release:       6
Summary:       Multilingual data files for the m17n library
License:       LGPLv2+
URL:           http://www.nongnu.org/m17n
Source0:       http://download-mirror.savannah.gnu.org/releases/m17n/m17n-db-%{version}.tar.gz
Source1:       http://releases.pagure.org/inscript2/inscript2-20160423.tar.gz
Source2:       https://raw.githubusercontent.com/gnuman/m17n-inglish-mims/master/minglish/minglish.mim
Patch001:      m17n-db-1.6.5-bn-itrans-bug182227.patch
Patch002:      m17n-db-1.6.5-kn-itrans_key-summary_bug228806.patch
Patch003:      m17n-db-1.6.5-kn-inscript-ZWNJ-bug440007.patch
Patch004:      m17n-db-1.6.5-number_pad_itrans-222634.patch
Patch005:      m17n-db-1.7.0-fix-e-o-mappings.patch
BuildRequires: gettext glibc-locale-source gcc
BuildArch:     noarch

Obsoletes:     m17n-contrib < 1.1.14-4.fc20
Provides:      m17n-contrib = 1.1.14-4.fc20

%description
This package provides various multilingual datafiles to m17n library.
the m17n library describe input maps, encoding maps, OpenType font data and
font layout text rendering for languages.

%package       extras
Summary:       Extra data files for m17n-db
Requires:      m17n-db = %{version}-%{release}

Obsoletes:     m17n-contrib-extras < 1.1.14-4.fc20
Provides:      m17n-contrib-extras = 1.1.14-4.fc20

%description extras
Extra files of the m17n-db for input maps that are less used.

%package       devel
Summary:       Development files of the m17n-db
Requires:      m17n-db = %{version}-%{release}

%description devel
Development data files for m17n-db.

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

tar xzf %{SOURCE1}
sed -i 's/ ("ld" "སྡ")/ ("ld" "ལྡ")/g' MIM/bo-ewts.mim

%build
%configure
%make_build

%install
%make_install

install -p inscript2/IM/* %{buildroot}%{_datadir}/m17n/
install -p inscript2/icons/* %{buildroot}%{_datadir}/m17n/icons
install -p %{SOURCE2} %{buildroot}%{_datadir}/m17n

%find_lang m17n-db

%files
%doc AUTHORS README COPYING
%dir %{_datadir}/m17n
%{_datadir}/m17n/{mdb.dir,*.tbl,scripts,*.flt,a*.mim,b*.mim,c*.mim,d*.mim,e*.mim,f*.mim,g*.mim,h*.mim}
%{_datadir}/m17n/{i*.mim,k*.mim,l*.mim,m*.mim,n*.mim,o*.mim,p*.mim,r*.mim,s*.mim,t*.mim,u*.mim,v*.mim,y*.mim}
%{_datadir}/m17n/icons/*.png
%exclude %{_datadir}/m17n/{zh-*.mim,ja-*.mim,bn-unijoy.mim,ispell.mim}
%exclude %{_datadir}/m17n/icons/{zh*.png,ja*.png,bn-unijoy.png}

%files extras -f m17n-db.lang
%{_datadir}/m17n/{zh-*.mim,ja*.mim,*.fst,*.map,*.tab,*.lnm,LOCALE.*}
%{_datadir}/m17n/icons/{zh*.png,ja*.png}

%files devel
%{_bindir}/m17n-db
%{_datadir}/pkgconfig/m17n-db.pc

%changelog
* Wed Jun 09 2021 wulei <wulei80@huawei.com> - 1.8.0-6
- fixes failed: error: no acceptable C compiler found in PATH

* Sat Nov 30 2019 tianfei<tianfei16@huawei.com> - 1.8.0-5
- Package init

