File libzhuyin.spec of Package libzhuyin

#
# spec file for package libzhuyin
#
# 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/
#


Name:           libzhuyin
Version:        0.9.99.20140929
Release:        0
Summary:        Library to deal with zhuyin
License:        GPL-2.0
Group:          System/I18n/Chinese
Url:            https://github.com/libzhuyin/libzhuyin
Source:         %{name}-%{version}.tar.gz
Source1:        http://downloads.sourceforge.net/libzhuyin/models/model9.text.tar.gz
# PATCH-FIX-UPSTREAM marguerite@opensuse.org - no download when build
Patch:          libzhuyin-no-download.patch
# PATCH-FIX-UPSTREAM marguerite@opensuse.org 
# it will use current date eg. /usr/include/libzhuyin-0.9.99.20140716
# Don't do this
Patch1:         libzhuyin-no-random-version-number-includedir.patch
BuildRequires:  db-devel
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  glib2-devel
BuildRequires:  gnome-common
BuildRequires:  libtool
Obsoletes:      libzhuyin-tools < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The libzhuyin project aims to provide the algorithms core 
for intelligent sentence-based Chinese zhuyin input methods.


%package -n libzhuyin6
Summary:        Runtime libraries for libzhuyin
Group:          System/Libraries
Requires:       libzhuyin-data

%description -n libzhuyin6
The libzhuyin project aims to provide the algorithms core
for intelligent sentence-based Chinese zhuyin input methods.

This package provides the runtime libraries for libzhuyin.

%package data
Summary:        Data files for libzhuyin
Group:          System/I18n/Chinese

%description data
The libzhuyin project aims to provide the algorithms core
for intelligent sentence-based Chinese zhuyin input methods.

This package provides the data files used by libzhuyin to be functional.

%package devel
Summary:        Development headers for libzhuyin
Group:          Development/Libraries/C and C++
#Requires:       libzhuyin-tools = %{version}
Requires:       libzhuyin6 = %{version}

%description devel
The libzhuyin project aims to provide the algorithms core
for intelligent sentence-based Chinese zhuyin input methods.

This package provides the development headers for libzhuyin project.

%prep
%setup -q
%patch -p1
%patch1 -p1
cp -r %{SOURCE1} data
pushd data &> /dev/null
tar -xf model9.text.tar.gz
popd &> /dev/null
./autogen.sh

%build
%configure --prefix=%{_prefix} --libdir=%{_libdir}
make %{?_smp_mflags}

%install
%make_install


rm -rf %{buildroot}%{_libdir}/%{name}.{a,la}

%fdupes %{buildroot}

%post -n libzhuyin6 -p /sbin/ldconfig

%postun -n libzhuyin6 -p /sbin/ldconfig


%files -n libzhuyin6
%defattr(-,root,root)
%doc AUTHORS ChangeLog README COPYING
%dir %{_libdir}/%{name}
%{_libdir}/libzhuyin.so.*
%{_mandir}/man1/%{name}.1.gz

%files data
%defattr(-,root,root)
%{_libdir}/%{name}/data

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}-0.9.99
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc


%changelog
openSUSE Build Service is sponsored by