File sogou-pinyin.spec of Package sogou-pinyin

#
# spec file for package sogou-pinyin
#
# Copyright (c) 2016 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:           sogou-pinyin
Version:        2.2.0.0102
Release:        0
Summary:        A script to install Sogou Pinyin Linux for openSUSE
License:        SUSE-Freeware
Group:          System/I18n/Chinese
Url:            http://pinyin.sogou.com/linux/
Source0:        %{name}.sh.in
Source1:        qimpanel-mkdir.txt
Source2:        qimpanel-files.txt
Source3:        README.SUSE
Source4:        openSUSE-sogou-themes.tar.gz
BuildRequires:  fcitx-devel
BuildRequires:  hicolor-icon-theme
Requires:       %{_bindir}/gtk-update-icon-cache
Requires:       binutils
Requires:       desktop-file-utils
Requires:       fcitx >= 4.2.8
Requires:       glibc
Requires:       shared-mime-info
Requires:       wget
Requires:       xz
Conflicts:      fcitx-sogoupinyin
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Based on web search engine technology, Sogou Pinyin input method is
the next-generation input method designed for Internet users. As it
is backed with search engine technology, user input method can be
extremely fast, and it is much more advanced than other input method
engines in terms of the volume of the vocabulary database and its
accuracy. Sogou input method is the most popular input methods in
China, and Sogou promises it will always be free of charge.

%prep
cp -r %{SOURCE0} .
cp -r %{SOURCE2} .
cp -r %{SOURCE3} .
cp -r %{SOURCE4} .
tar -xzf openSUSE-sogou-themes.tar.gz

%build
mv %{name}.sh.in %{name}.sh

%install
%suse_install_update_script %{name}.sh
mkdir -p %{buildroot}%{_localstatedir}/adm/update-messages
touch %{buildroot}%{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-1

install -d %{buildroot}%{_bindir}
touch %{buildroot}%{_bindir}/sogou-qimpanel
touch %{buildroot}%{_bindir}/sogou-qimpanel-watchdog
touch %{buildroot}%{_bindir}/sogou-diag
touch %{buildroot}%{_bindir}/sogou-session
touch %{buildroot}%{_bindir}/sogou-sys-notify
install -d %{buildroot}%{_fcitx_libdir}
touch %{buildroot}%{_fcitx_libdir}/fcitx-autoeng-ng.so
touch %{buildroot}%{_fcitx_libdir}/fcitx-punc-ng.so
touch %{buildroot}%{_fcitx_libdir}/fcitx-fullwidth-char-enhance.so
touch %{buildroot}%{_fcitx_libdir}/fcitx-sogoucloudpinyin.so
touch %{buildroot}%{_fcitx_libdir}/fcitx-sogoupinyin.so
install -d %{buildroot}%{_datadir}/applications
touch %{buildroot}%{_datadir}/applications/fcitx-ui-sogou-qimpanel.desktop
install -d %{buildroot}%{_docdir}/sogoupinyin
touch %{buildroot}%{_docdir}/sogoupinyin/changelog.gz
touch %{buildroot}%{_docdir}/sogoupinyin/copyright
touch %{buildroot}%{_docdir}/sogoupinyin/license_ch.txt.gz
install -d %{buildroot}%{_fcitx_datadir}/{addon,configdesc,data,imicon,inputmethod}
touch %{buildroot}%{_fcitx_addondir}/fcitx-autoeng-ng.conf
touch %{buildroot}%{_fcitx_addondir}/fcitx-punc-ng.conf
touch %{buildroot}%{_fcitx_addondir}/fcitx-fullwidth-char-enhance.conf
touch %{buildroot}%{_fcitx_addondir}/fcitx-sogoucloudpinyin.conf
touch %{buildroot}%{_fcitx_addondir}/fcitx-sogoupinyin.conf
touch %{buildroot}%{_fcitx_descdir}/fcitx-autoeng-ng.desc
touch %{buildroot}%{_fcitx_datadir}/data/AutoEngNg.dat
touch %{buildroot}%{_fcitx_datadir}/data/punc-ng.mb.zh_CN
touch %{buildroot}%{_fcitx_datadir}/data/punc-ng.mb.zh_HK
touch %{buildroot}%{_fcitx_datadir}/data/punc-ng.mb.zh_TW
touch %{buildroot}%{_fcitx_imicondir}/sogoupinyin.png
touch %{buildroot}%{_fcitx_inputmethoddir}/sogoupinyin.conf
install -d %{buildroot}%{_datadir}/sogou-qimpanel/{cell/defaultCell,data,phrase,recommendSkin/skin,skin}
touch %{buildroot}%{_datadir}/sogou-qimpanel/zh_CN.qm
install -d %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/Correction.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/default.ssf
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/env.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/Fuzzy.dat
#touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/MoHuYin.ini
#touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/Phrases.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/PluginRecommend.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ProtectConfig.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/Punctures.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/scdlist.ini
#touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/README.txt
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_adjcache.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_annex.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_blackIfk.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_core.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_eng.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_eng_pre.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_ext.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_fix_first.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_hz.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_infokey.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_numFreqAdjust.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_phrases.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_py.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_tip.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_quick.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_smartInfo.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_url.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_urlGuide.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_usr_v3new.bin
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/Skin.dat
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/urlBaseG.enc
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/ABC.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/MS2003.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/PinyinJiaJia.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/Sogou.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/XiaoHe.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/ZiGuang.ini
touch %{buildroot}%{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/ZiRanMa.ini
install -d %{buildroot}%{_datadir}/icons/hicolor/{128x128,16x16,48x48,64x64}/apps/
touch %{buildroot}%{_datadir}/icons/hicolor/{128x128,16x16,48x48}/apps/fcitx-sogoupinyin.png
touch %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/sogou_notify.png
install -d %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/
touch %{buildroot}%{_datadir}/locale/zh_CN/LC_MESSAGES/fcitx-sogoupinyin.mo
install -d %{buildroot}%{_datadir}/mime/packages/
touch %{buildroot}%{_datadir}/mime/packages/fcitx-ui-sogou-qimpanel.xml
install -d %{buildroot}%{_datadir}/pixmaps/
touch %{buildroot}%{_datadir}/pixmaps/application-x-sogouskin.png
touch %{buildroot}%{_datadir}/pixmaps/application-x-scel.png
install -d %{buildroot}%{_datadir}/sogoupinyin
touch %{buildroot}%{_datadir}/sogoupinyin/sogou-version

# install openSUSE themes
cp -r openSUSE-bottle-* %{buildroot}%{_datadir}/sogou-qimpanel/skin

# /usr/share/fcitx-qimpanel contains some Chinese named directories
pushd %{buildroot}
cp -r %{SOURCE1} .
for i in `cat qimpanel-mkdir.txt` ; do
	mkdir -pv $i
done
rm -rf qimpanel-mkdir.txt
popd

%files -f qimpanel-files.txt
%defattr(-,root,root)
%doc README.SUSE
%{_localstatedir}/adm/update-scripts/*
%{_localstatedir}/adm/update-messages/*
%ghost %{_bindir}/sogou-qimpanel
%ghost %{_bindir}/sogou-qimpanel-watchdog
%ghost %{_bindir}/sogou-diag
%ghost %{_bindir}/sogou-session
%ghost %{_bindir}/sogou-sys-notify
%ghost %{_fcitx_libdir}/fcitx-autoeng-ng.so
%ghost %{_fcitx_libdir}/fcitx-punc-ng.so
%ghost %{_fcitx_libdir}/fcitx-fullwidth-char-enhance.so
%ghost %{_fcitx_libdir}/fcitx-sogoucloudpinyin.so
%ghost %{_fcitx_libdir}/fcitx-sogoupinyin.so
%ghost %{_datadir}/applications/fcitx-ui-sogou-qimpanel.desktop
%dir %{_docdir}/sogoupinyin/
%doc %ghost %{_docdir}/sogoupinyin/changelog.gz
%doc %ghost %{_docdir}/sogoupinyin/copyright
%doc %ghost %{_docdir}/sogoupinyin/license_ch.txt.gz
%ghost %{_fcitx_addondir}/fcitx-autoeng-ng.conf
%ghost %{_fcitx_addondir}/fcitx-punc-ng.conf
%ghost %{_fcitx_addondir}/fcitx-fullwidth-char-enhance.conf
%ghost %{_fcitx_addondir}/fcitx-sogoucloudpinyin.conf
%ghost %{_fcitx_addondir}/fcitx-sogoupinyin.conf
%ghost %{_fcitx_descdir}/fcitx-autoeng-ng.desc
%ghost %{_fcitx_datadir}/data/AutoEngNg.dat
%ghost %{_fcitx_datadir}/data/punc-ng.mb.zh_CN
%ghost %{_fcitx_datadir}/data/punc-ng.mb.zh_HK
%ghost %{_fcitx_datadir}/data/punc-ng.mb.zh_TW
%ghost %{_fcitx_imicondir}/sogoupinyin.png
%ghost %{_fcitx_inputmethoddir}/sogoupinyin.conf
%dir %{_datadir}/sogou-qimpanel/
%dir %{_datadir}/sogou-qimpanel/cell
%dir %{_datadir}/sogou-qimpanel/cell/defaultCell
%dir %{_datadir}/sogou-qimpanel/data
%dir %{_datadir}/sogou-qimpanel/phrase
%dir %{_datadir}/sogou-qimpanel/recommendSkin
%dir %{_datadir}/sogou-qimpanel/recommendSkin/skin
%dir %{_datadir}/sogou-qimpanel/skin
%{_datadir}/sogou-qimpanel/skin/openSUSE-bottle-*
%ghost %{_datadir}/sogou-qimpanel/zh_CN.qm
%dir %{_datadir}/fcitx-sogoupinyin/
%dir %{_datadir}/fcitx-sogoupinyin/SogouInput
%dir %{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/Correction.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/default.ssf
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/env.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/Fuzzy.dat
#%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/MoHuYin.ini
#%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/Phrases.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/PluginRecommend.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/ProtectConfig.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/Punctures.ini
#%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/README.txt
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/scdlist.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_adjcache.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_annex.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_blackIfk.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_core.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_eng.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_eng_pre.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_ext.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_fix_first.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_hz.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_infokey.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_numFreqAdjust.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_phrases.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_py.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_tip.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_quick.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_smartInfo.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_url.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_urlGuide.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/sgim_usr_v3new.bin
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/Skin.dat
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/urlBaseG.enc
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/ABC.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/MS2003.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/PinyinJiaJia.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/Sogou.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/XiaoHe.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/ZiGuang.ini
%ghost %{_datadir}/fcitx-sogoupinyin/SogouInput/ShuangPinSchemes/ZiRanMa.ini
%ghost %{_datadir}/icons/hicolor/128x128/apps/fcitx-sogoupinyin.png
%ghost %{_datadir}/icons/hicolor/16x16/apps/fcitx-sogoupinyin.png
%ghost %{_datadir}/icons/hicolor/48x48/apps/fcitx-sogoupinyin.png
%ghost %{_datadir}/icons/hicolor/64x64/apps/sogou_notify.png
%ghost %{_datadir}/locale/zh_CN/LC_MESSAGES/fcitx-sogoupinyin.mo
%ghost %{_datadir}/mime/packages/fcitx-ui-sogou-qimpanel.xml
%ghost %{_datadir}/pixmaps/application-x-sogouskin.png
%ghost %{_datadir}/pixmaps/application-x-scel.png
%dir %{_datadir}/sogoupinyin
%ghost %{_datadir}/sogoupinyin/sogou-version

%changelog
openSUSE Build Service is sponsored by