File librime.spec of Package librime

#
# spec file for package librime
#
# Copyright (c) 2015 SUSE LINUX 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:           librime
Version:        1.2.9+git20150802.ee3029e
Release:        0
Summary:        Rime Input Method Engine
License:        BSD-3-Clause
Group:          System/I18n/Chinese
Url:            https://github.com/rime/librime
Source:         %{name}-%{version}.tar.xz
#PATCH-FIX-OPENSUSE workaround for gcc bug 53613 on 12.3 and lower
Patch1:         librime-1.1-gcc53613.patch
#PATCH-FIX-OPENSUSE fix boost 1.49 filesystem linking on 12.3 and lower
Patch2:         librime-1.2-BOOST_NO_SCOPED_ENUMS.patch
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  glog-devel
BuildRequires:  googletest-devel
BuildRequires:  leveldb-devel
%if 0%{?suse_version} >= 1220
BuildRequires:  boost-devel
%endif
%if 0%{?suse_version} == 1140
BuildRequires:  libboost_filesystem1_44_0
BuildRequires:  libboost_regex1_44_0
BuildRequires:  libboost_signals1_44_0
BuildRequires:  libboost_system1_44_0
BuildRequires:  libboost_thread1_44_0
%endif
%if 0%{?suse_version} == 1210
BuildRequires:  libboost_filesystem1_46_1
BuildRequires:  libboost_regex1_46_1
BuildRequires:  libboost_signals1_46_1
BuildRequires:  libboost_system1_46_1
BuildRequires:  libboost_thread1_46_1
%endif
%if 0%{?sles_version}
BuildRequires:  libboost_filesystem1_36_0
BuildRequires:  libboost_regex1_36_0
BuildRequires:  libboost_signals1_36_0
BuildRequires:  libboost_system1_36_0
BuildRequires:  libboost_thread1_36_0
%endif
BuildRequires:  libkyotocabinet-devel
BuildRequires:  marisa-devel
BuildRequires:  opencc-devel >= 1.0.2
BuildRequires:  pkg-config
BuildRequires:  xorg-x11-proto-devel
BuildRequires:  yaml-cpp-devel
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Rime is an Traditional Chinese input method engine.
Its idea comes from ancient Chinese brush and carving art.
Mainly it's about to express your thinking with your keystrokes.

%package -n rime
Summary:        Rime Input Method Engine
Group:          System/I18n/Chinese

%description -n rime
Rime is an Traditional Chinese input method engine.
Its idea comes from ancient Chinese brush and carving art.
Mainly it's about to express your thinking with your keystrokes.

%package -n librime1
Summary:        Rime Input Method Engine
Group:          System/Libraries

%description -n librime1
Rime is an Traditional Chinese input method engine.
Its idea comes from ancient Chinese brush and carving art.
Mainly it's about to express your thinking with your keystrokes.

This package is the runtime libraries of Rime.

%package devel
Summary:        Development files of Rime
Group:          Development/Libraries/C and C++
Requires:       librime1 = %{version}
Requires:       rime = %{version}

%description devel
Rime is an Traditional Chinese input method engine.
Its idea comes from ancient Chinese brush and carving art.
Mainly it's about to express your thinking with your keystrokes.

This package is the development headers of Rime.

%prep
%setup -q
%if 0%{?suse_version} <= 1230
%patch1 -p1
%patch2 -p1
%endif
sed -i "s/1.46.0/1.36.0/" CMakeLists.txt

%build
mkdir -pv build
pushd build
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR=%{_libdir} \
      -DCMAKE_CXX_FLAGS="%{optflags}" ..
make %{?_smp_mflags}

%install
pushd build
make DESTDIR=%{buildroot} install

%post -n librime1 -p /sbin/ldconfig

%postun -n librime1 -p /sbin/ldconfig

%files -n rime
%defattr(-,root,root)
%doc LICENSE README.md
%{_bindir}/rime_deployer
%{_bindir}/rime_dict_manager

%files -n librime1
%defattr(-,root,root)
%{_libdir}/%{name}.so.1
%{_libdir}/%{name}.so.1.2.9

%files devel
%defattr(-,root,root)
%{_includedir}/rime_api.h
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/rime.pc
%{_datadir}/cmake/rime/

%changelog
openSUSE Build Service is sponsored by