File kcm-fcitx.spec of Package kcm-fcitx

#
# spec file for package kcm-fcitx
#
# Copyright (c) 2013 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/
#


%define		pkgname	fcitx-config-kde4

Name:           kcm-fcitx
Version:        0.4.3
Release:        0
Summary:        KDE control module for Fcitx
License:        GPL-2.0+
Group:          System/I18n/Chinese
Url:            http://github.com/fcitx/kcm-fcitx
Source:         http://download.fcitx-im.org/kcm-fcitx/%{name}-%{version}.tar.xz
Source1:        input-keyboard.svg
Obsoletes:      %{name} < 0.2.0
Provides:       %{name} = %{version}
BuildRequires:  fcitx-devel
%if 0%{?suse_version}
BuildRequires:  libkde4-devel
BuildRequires:  rsvg-view
%if 0%{?suse_version} <= 1140 
BuildRequires:  libunique-devel
%else
BuildRequires:  libunique1-devel
%endif
%else
BuildRequires:  kdelibs-devel
BuildRequires:  libX11-devel
BuildRequires:  librsvg2
BuildRequires:  unique-devel
%endif
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  libtool
BuildRequires:  xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
KDE control module for Fcitx. 

You can config fcitx through "Configue Desktop" - "Locale" - Fcitx now.

%package -n %{pkgname}
Summary:        KDE control module for Fcitx
Group:          System/I18n/Chinese
%if 0%{?suse_version}
%kde4_runtime_requires
%fcitx_requires
Provides:       locale(kdebase4:ko;zh_CN;zh_SG)
Supplements:    packageand(fcitx:kdebase4)
%else
Requires:       kde-runtime
Requires:       qt-x11
%endif	

%description -n %{pkgname}
KDE control module for Fcitx.

You can config fcitx through "Configure Desktop" - "Locale" - Fcitx now.

%prep
%setup -q -n %{name}-%{version}

%build
%{__mkdir} -pv build
pushd build

cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR=%{_libdir}

make

%install
pushd build

make DESTDIR=%{buildroot} install

popd

sed -i "s/Categories=Qt;KDE;Utility/Categories=Qt;KDE;Utility;DesktopUtility;/" %{buildroot}%{_datadir}/applications/kde4/kbd-layout-viewer.desktop

ICONSIZE="16 22 32 48 64 128 256"
for i in $ICONSIZE; do
    mkdir -pv %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/devices/
    rsvg-convert -h $i -w $i %{SOURCE1} -o %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/devices/input-keyboard.png
done

%find_lang kcm_fcitx

%if 0%{?suse_version}
%kde_post_install
%endif

%post -n %{pkgname} -p /sbin/ldconfig

%postun -n %{pkgname} -p /sbin/ldconfig

%files -n %{pkgname} -f kcm_fcitx.lang
%defattr(-,root,root,-)
%{_bindir}/kbd-layout-viewer
%{_libdir}/kde4/*
%{_datadir}/kde4/*
%{_datadir}/applications/kde4/kbd-layout-viewer.desktop
%if 0%{?fedora_version}
%{_datadir}/config/fcitx-skin.knsrc
%endif
%{_datadir}/icons/hicolor/*/devices/input-keyboard.png

%changelog
openSUSE Build Service is sponsored by