File libpinyin.spec of Package libpinyin
#
# spec file for package libpinyin
#
# Copyright (c) 2012 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/
#
Name: libpinyin
Version: 0.5
Release: 0
Summary: Intelligent Pinyin IME
License: GPL-2.0+
Group: System/I18n/Chinese
Url: https://github.com/libpinyin/libpinyin
Source: %{name}-%{version}.tar.bz2
Source1: model.text.tar.bz2
BuildRequires: gcc-c++
BuildRequires: glib2-devel
BuildRequires: intltool
%if 0%{?suse_version} >= 1140
BuildRequires: libdb-4_8-devel
%else
BuildRequires: libdb-4_5-devel
%endif
BuildRequires: wget
BuildRequires: libtool
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Libpinyin is a staging joint effort of many Chinese Pinyin IME development teams.
It aims to be an Intelligent (and Universal) Sentence-based Pinyin IME Backend supports many Language Models and Frontends.
%package -n %{name}0
Summary: Intelligent Pinyin IME
Group: System/I18n/Chinese
Provides: %{name} = %{version}
%description -n %{name}0
Libpinyin is a staging joint effort of many Chinese Pinyin IME development teams.
It aims to be an Intelligent (and Universal) Sentence-based Pinyin IME Backend supports many Language Models and Frontends.
%package devel
Summary: Intelligent Pinyin IME
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
Libpinyin is a staging joint effort of many Chinese Pinyin IME development teams.
It aims to be an Intelligent (and Universal) Sentence-based Pinyin IME Backend supports many Language Models and Frontends.
%prep
%setup -q
%build
./autogen.sh
%configure
pushd data
%{__cp} -r %{S:1} ./
tar -xjvf model.text.tar.bz2
popd
make %{?_smp_mflags}
%install
%makeinstall
%{__rm} -rf %{buildroot}%{_libdir}/%{name}.a
%{__rm} -rf %{buildroot}%{_libdir}/%{name}.la
%post -n %{name}0 -p /sbin/ldconfig
%postun -n %{name}0 -p /sbin/ldconfig
%files -n %{name}0
%defattr(-,root,root)
%doc ChangeLog AUTHORS COPYING
%{_bindir}/*
%{_libdir}/%{name}.so.*
%{_datadir}/%{name}
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}-0.3/
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%changelog