# if you want to make scim-mozc package, rpm --define with_scim:1 %define with_scim 0 %if %{with_scim} %define scim_dir %(pkg-config --variable=moduledir scim) %endif %define mozc_el mozc-el %global _metainfodir %{_datadir}/metainfo Name: mozc Summary: Japanese Input Method Editor designed for multi-platform Summary(ja): マルチプラットホームで動くように設計された日本語インプットメソッドエディタ Version: 2.26.4486.102 Release: 1%{?_dist_release} Group: localization Distribution: Vine Linux Vendor: Project Vine Packager: kazutaka, daisuke License: BSD and ASL 2.0 and UCD and Public Domain and mecab-ipadic URL: https://github.com/google/mozc Source0: %{name}-%{version}.tar.bz2 # for mozc-el Source2: %{name}-install.sh Source3: %{name}-remove.sh Source4: vine-default-%{name}.el Source5: %{name}-init.el Source6: ibus-setup-mozc-jp.desktop Source1000: get-tarball.sh # build patch Patch0: mozc-build-ninja.patch Patch1: mozc-build-gcc.patch Patch2: mozc-build-verbosely.patch Patch3: mozc-build-id.patch Patch4: mozc-build-gcc-common.patch # Vine Lunux Source10: README.vine # fcitx-mozc Patch15: fcitx-mozc-2.26.4486.102.patch Source15: fcitx-mozc-icon.tar.gz # japanpost Source20: http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip Source21: http://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: git BuildRequires: python3, python3-devel, ibus-devel, dbus-devel BuildRequires: openssl-devel, zlib-devel BuildRequires: curl-devel BuildRequires: gtest-devel BuildRequires: qt5-qtbase-devel BuildRequires: gyp BuildRequires: pkgconfig BuildRequires: gtk2-devel BuildRequires: protobuf-devel BuildRequires: desktop-file-utils BuildRequires: ninja >= 1.6.0 %if %{with_scim} # for scim-mozc BuildRequires: scim-devel %endif # for 1.1.690.102+ BuildRequires: zinnia-devel # fcitx BuildRequires: fcitx-devel Requires: mozc-server = %{version}-%{release} %description Mozc is a Japanese Input Method Editor (IME) designed for multi-platform such as Chromium OS, Windows, Mac and Linux. This open-source project originates from Google Japanese Input. %description -l ja Mozc は日本語入力用の IME (Imput Method Editor)です。 Chromium OS や Windows、Mac、Linux といったマルチプラット フォームで利用できるようにデザインされており、「Google日本語 入力」のオープンソース版です。 %package server Summary: Server part of the Mozc input method Summary(ja): Mozc インプットメソッドのサーバ部分 Group: localization Obsoletes: mozc-utils-gui < %{version}-%{release} %description server Server part of the Mozc input method, used by Mozc clients such as ibus-mozc. %description server -l ja Mozc インプットメソッドのサーバ部分。ibus-mozcなどのMozcクライアントから 使うことができます。 %package -n ibus-mozc Summary: iBus engine module for Mozc Summary(ja): Mozc 用 iBus エンジンモジュール Group: localization Requires: mozc = %{version}-%{release} %description -n ibus-mozc iBus engine module for Mozc. %description -n ibus-mozc -l ja Mozc 用 iBus エンジンモジュール。 %if %{with_scim} %package -n scim-mozc Summary: SCIM IMEngine module for Mozc Summary(ja): Mozc 用 SCIM IM エンジンモジュール Group: localization Requires: mozc = %{version}-%{release} Requires: scim gtk2 %description -n scim-mozc SCIM IMEngine module for Mozc. %description -n scim-mozc -l ja Mozc 用 SCIM IMエンジンモジュール %endif %package -n fcitx-mozc Summary: Fcitx IMEngine module for Mozc Summary(ja): Mozc 用 Fcitx IM エンジンモジュール Group: localization Requires: mozc = %{version}-%{release} Requires: fcitx %description -n fcitx-mozc Fcitx IMEngine module for Mozc. %description -n fcitx-mozc -l ja Mozc 用 Fcitx IM エンジンモジュール %package -n %{mozc_el} Summary: Emacs Lisp frontend for Mozc Summary(ja): Mozc 用 Emacs Lisp フロントエンド Group: Applications/Editors/Emacs BuildRequires: emacs Requires(post,preun): emacsen, emacsen-common >= 0.1 Requires: mozc-server = %{version}-%{release} %description -n %{mozc_el} Emacs Lisp frontend for Mozc %description -n %{mozc_el} -l ja Mozc のための Emacs-lisp フロントエンド %debug_package %prep %setup -q -c -n %{name}-%{version} -a 20 -a 21 -a 15 pushd src %patch0 -p1 -b .0-ninja %patch1 -p1 -b .1-gcc %patch2 -p1 -b .2-verbose %patch3 -p1 -b .3-build-id %patch4 -p1 -b .8-gcc-common sed -i \ -e 's/"Direct input"/"直接入力"/' \ -e 's/"Hiragana"/"ひらがな"/' \ -e 's/"Katakana"/"全角カタカナ"/' \ -e 's/"Latin"/"半角英数"/' \ -e 's/"Wide Latin"/"全角英数"/' \ -e 's/"Half width katakana"/"半角カタカナ"/' \ -e 's/"Properties"/"プロパティ"/' \ -e 's/"Dictionary Tool"/"辞書ツール"/' \ -e 's/"Add Word"/"単語登録"/' \ -e 's/"Handwriting"/"手書き文字認識"/' \ -e 's/"Character Palette"/"文字パレット"/' \ -e 's/"About Mozc"/"Mozcについて"/' \ unix/ibus/mozc_engine_property.cc (cd data/dictionary_oss; PYTHONPATH="${PYTHONPATH}:../.." python3 ../../dictionary/gen_zip_code_seed.py --zip_code=../../../KEN_ALL.CSV --jigyosyo=../../../JIGYOSYO.CSV >> dictionary09.txt; ) # fcitx git init git config user.email "Vine@vinelinux.org" git config user.name "Vine Linux Build System" git add . git commit -m "pre-patch" git apply -p2 %{PATCH15} # update execute files path %{__sed} -i -e "s|/usr/lib/mozc|%{_libexecdir}|g" base/const.h popd %build pushd src # replace compiler flags to build with the proper debugging information t=$(mktemp /tmp/mozc.gyp-XXXXXXXX) opts=$(for i in $RPM_OPT_FLAGS; do echo "i \\" echo "\"$i\"," done) sed -ne "/'linux_cflags':/{p;n;p;:a;/[[:space:]]*\],/{\ $opts p;b b};n;b a;};{p};:b" gyp/common.gypi > $t && mv $t gyp/common.gypi || exit 1 unset QTDIR GYP_DEFINES="use_libprotobuf=1 use_fcitx5=NO zinnia_model_file=/usr/share/zinnia/model/tomoe/handwriting-ja.model ibus_mozc_path=%{_libexecdir}/ibus-engine-mozc ibus_mozc_icon_path=%{_datadir}/ibus-mozc/product_icon.png" \ %{__python3} build_mozc.py gyp \ --gypdir=%{_bindir} \ --server_dir=%{_libexecdir}/mozc \ --target_platform=Linux %{__python3} build_mozc.py build -c Release \ unix/ibus/ibus.gyp:ibus_mozc \ %if %{with_scim} unix/scim/scim.gyp:scim_mozc \ unix/scim/scim.gyp:scim_mozc_setup \ %endif unix/fcitx/fcitx.gyp:fcitx-mozc \ unix/emacs/emacs.gyp:mozc_emacs_helper \ server/server.gyp:mozc_server \ gui/gui.gyp:mozc_tool \ renderer/renderer.gyp:mozc_renderer popd %install %{__rm} -rf %{buildroot} pushd src %{__mkdir_p} %{buildroot}%{_libdir} %{__mkdir_p} %{buildroot}%{_libexecdir}/mozc %define output_dir out_linux/Release # main # ibus-mozc %{__cp} -p %{output_dir}/ibus_mozc %{buildroot}%{_libexecdir}/ibus-engine-mozc %{__mkdir_p} %{buildroot}%{_datadir}/ibus/component/ %{__cp} -p %{output_dir}/gen/unix/ibus/mozc.xml %{buildroot}%{_datadir}/ibus/component/ ## install icons %{__mkdir_p} %{buildroot}%{_datadir}/ibus-mozc/setup (cd data/images/unix; install -p -m0644 ime_product_icon_opensource-32.png %{buildroot}%{_datadir}/ibus-mozc/product_icon.png for i in ui-*.png; do install -p -m0644 $i %{buildroot}%{_datadir}/ibus-mozc/${i//ui-/} done) # mozc_renderer %{__cp} -p %{output_dir}/mozc_renderer %{buildroot}%{_libexecdir}/mozc desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE6} %if %{with_scim} # scim-mozc %{__mkdir_p} %{buildroot}%{scim_dir}/{IMEngine,SetupUI} %{__cp} -p %{output_dir}/lib.target/libscim_mozc.so \ %{buildroot}%{scim_dir}/IMEngine/mozc.so %{__cp} -p %{output_dir}/lib.target/libscim_mozc_setup.so \ %{buildroot}%{scim_dir}/SetupUI/mozc-setup.so ## install icons %{__mkdir_p} %{buildroot}%{_datadir}/scim/icons (cd data/images/unix; install -p -m0644 ime_product_icon_opensource-32.png %{buildroot}%{_datadir}/scim/icons/product_icon.png for i in ui-*.png; do install -p -m0644 $i %{buildroot}%{_datadir}/scim/icons/${i//ui-/} done) %endif # fcitx-mozc %{__mkdir_p} %{buildroot}%{_libdir}/fcitx %{__cp} -p %{output_dir}/fcitx-mozc.so %{buildroot}%{_libdir}/fcitx %{__mkdir_p} %{buildroot}%{_datadir}/fcitx/addon/ %{__cp} -p unix/fcitx/fcitx-mozc.conf %{buildroot}%{_datadir}/fcitx/addon/ %{__mkdir_p} %{buildroot}%{_datadir}/fcitx/inputmethod/ %{__cp} -p unix/fcitx/mozc.conf %{buildroot}%{_datadir}/fcitx/inputmethod/ (cd %{output_dir}/gen/unix/fcitx/po; for i in *.mo; do %{__mkdir_p} %{buildroot}%{_localedir}/${i/.mo/}/ ; %{__cp} -p $i %{buildroot}%{_localedir}/${i/.mo/}/fcitx-mozc.mo done) %{__mkdir_p} %{buildroot}%{_datadir}/fcitx/mozc/icon/ %{__cp} -p ../fcitx-mozc-icons/*.png %{buildroot}%{_datadir}/fcitx/mozc/icon/ # mozc-server %{__cp} -p %{output_dir}/mozc_server %{buildroot}%{_libexecdir}/mozc # mozc_tool %{__cp} -p %{output_dir}/mozc_tool %{buildroot}%{_libexecdir}/mozc # mozc-el %{__cp} -p %{output_dir}/mozc_emacs_helper %{buildroot}%{_libexecdir}/mozc mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp/%{name}/packages mkdir -p %{buildroot}%{emacsen_pkgdir}/install mkdir -p %{buildroot}%{emacsen_pkgdir}/remove cp -p unix/emacs/mozc.el %{SOURCE4} %{SOURCE5} %{buildroot}%{_datadir}/emacs/site-lisp/%{name} # # install script (bytecompile el and install elc , remove) # %_installemacsenscript %{name} %{SOURCE2} %_removeemacsenscript %{name} %{SOURCE3} popd # install document %{__cp} %{SOURCE10} . # Register as an AppStream component to be visible in the software center # # NOTE: It would be *awesome* if this file was maintained by the upstream # project, translated and installed into the right place during `make install`. # # See http://www.freedesktop.org/software/appstream/docs/ for more details. # install -d -m 0755 %{buildroot}%{_metainfodir} cat > %{buildroot}%{_metainfodir}/mozc.appdata.xml < mozc.xml CC0-1.0 Mozc Japanese input method

The Mozc input method is designed for entering Japanese text. It is multi-platform and is available on Chromium OS, Windows, Mac and Linux.

Input methods are typing systems allowing users to input complex languages. They are necessary because these contain too many characters to simply be laid out on a traditional keyboard.

https://github.com/google/mozc https://github.com/google/mozc/issues ja
EOF %clean rm -rf $RPM_BUILD_ROOT %post -n %{mozc_el} # # bytecompile and install # if [ "$1" = 2 ]; then %_emacsenPackageRemove %{name} fi %_addemacsenlist %{name} %_emacsenPackageInstall %{name} %preun -n %{mozc_el} if [ "$1" = 0 ]; then %_emacsenPackageRemove %{name} %_removeemacsenlist %{name} fi %files %defattr(-,root,root) %doc README.vine CONTRIBUTORS %files server %defattr(-,root,root) %doc README.vine %dir %{_libexecdir}/mozc %{_libexecdir}/mozc/mozc_server %files -n ibus-mozc %defattr(-,root,root) %{_libexecdir}/ibus-engine-mozc %dir %{_libexecdir}/mozc %{_libexecdir}/mozc/mozc_renderer %{_libexecdir}/mozc/mozc_tool %{_datadir}/ibus/component/mozc.xml %dir %{_datadir}/ibus-mozc %dir %{_datadir}/ibus-mozc/setup %{_datadir}/ibus-mozc/*.png %{_datadir}/applications/ibus-setup-mozc-jp.desktop %{_metainfodir}/*.appdata.xml %if %{with_scim} %files -n scim-mozc %defattr(-,root,root) %{scim_dir}/SetupUI/mozc-setup.so %{scim_dir}/IMEngine/mozc.so %{_datadir}/scim/icons/*.png %endif %files -n fcitx-mozc %defattr(-,root,root) %{_libdir}/fcitx/*.so %{_datadir}/fcitx/addon/fcitx-mozc.conf %{_datadir}/fcitx/inputmethod/mozc.conf %{_localedir}/*/fcitx-mozc.mo %dir %{_datadir}/fcitx/mozc/icon/ %{_datadir}/fcitx/mozc/icon/*.png %files -n %{mozc_el} %defattr(-,root,root) %{_libexecdir}/mozc/mozc_emacs_helper %{_datadir}/emacs/site-lisp/%{name} %{emacsen_pkgdir}/install/%{name} %{emacsen_pkgdir}/remove/%{name} %changelog * Thu Sep 09 2021 Tomohiro "Tomo-p" KATO 2.26.4486.102-1 - new upstream release. - dropped mozc-utils-gui. * Thu Feb 15 2018 Satoshi IWAMOTO 2.17.2077.102-3 - rebuilt * Thu Feb 15 2018 Satoshi IWAMOTO 2.17.2077.102-2.1 - add patch11 (allways on when mozc starting) - test package * Thu Jun 30 2016 Tomohiro "Tomo-p" KATO 2.17.2077.102-2 - rebuilt with new toolchan, ninja and zinnia. - updated postal database. * Mon Jan 18 2016 Daisuke SUZUKI 2.17.2077.102-1 - update to 2.17.2077.102 - update mozc-fcitx - add BR: ninja >= 1.6.0 * Thu Aug 28 2014 Daisuke SUZUKI 1.15.1870.102-1 - update to 1.15.1870.102 * Tue Jun 03 2014 Daisuke SUZUKI 1.13.1651.102-1 - update to 1.13.1651.102 * Sun Dec 29 2013 IWAI, Masaharu 1.12.1599.102-4 - update vine-default-mozc.el (Source4) - always 'setq mozc-helper-program-name' * Tue Dec 24 2013 IWAI, Masaharu 1.12.1599.102-3 - apply vine-default: fix Source5 * Sat Nov 16 2013 Daisuke SUZUKI 1.12.1599.102-2 - fix ibus-engine-mozc path * Wed Nov 13 2013 Daisuke SUZUKI 1.12.1599.102-1 - update to 1.12.1599.102 - add fcitx-mozc patch - create fcitx-mozc subpackage * Sun Apr 07 2013 Daisuke SUZUKI 1.10.1390.102-1 - new upstream release - use internal protobuf (add Source10) * Fri Oct 12 2012 Daisuke SUZUKI 1.6.1187.102-1 - new upstream release * Sun Sep 30 2012 Yoji TOYODA 1.5.1090.102-2 - rebuild with ibus-1.4.99.20120822 * Tue Jun 26 2012 Daisuke SUZUKI 1.5.1090.102-1 - new upstream release - enable mozc_renderer - move ibus-engine-mozc to %%_libexecdir * Wed May 09 2012 Daisuke SUZUKI 1.5.1053.102-1 - new upstream release - add --use_libprotobuf to link with system protobuf - add zipcode dictionaries (ken_all.zip, jigyosyo.zip) * Sun Feb 19 2012 Yoji TOYODA 1.3.975.102-2 - rebuild with protobuf-2.4.1 * Mon Feb 13 2012 Daisuke SUZUKI 1.3.975.102-1 - new upstream release * Sat Dec 24 2011 Daisuke SUZUKI 1.3.931.102-1 - new upstream release * Fri Dec 02 2011 Daisuke SUZUKI 1.3.911.102-1 - new upstream release - drop patch0 - add patch10 to translate panel menu * Wed Nov 30 2011 Daisuke SUZUKI 1.2.855.102-1 - new upstram release * Tue Aug 23 2011 Daisuke SUZUKI 1.1.773.102-1 - new upstram release * Fri Jul 22 2011 IWAI, Masaharu 1.1.717.102-2 - fix typo in ibus lang panel patch (Patch0): - stop built scim-mozc package by default * Fri May 20 2011 IWAI, Masaharu 1.1.717.102-1 - new upstream release * Tue Apr 19 2011 IWAI, Masaharu 1.1.690.102-2 - add Requires: tegaki-zinnia-japanese for utils-gui - build with "--channel_dev=0" option - fix License: droped mozcdic-ut dictionary in 0.12.402.102-1 * Fri Apr 15 2011 IWAI, Masaharu 1.1.690.102-1 - new upstream release - add BuildRequires: zinnia-devel * Fri Mar 25 2011 IWAI, Masaharu 1.1.626.102-1 - new upstream release * Sun Jan 30 2011 IWAI, Masaharu 1.0.558.102-2vl6 - build with openssl 1.0.0c * Sat Dec 18 2010 IWAI, Masaharu 1.0.558.102-1 - new upstream release - add CONTRIBUTORS in main package %%doc * Sat Nov 6 2010 IWAI, Masaharu 0.13.523.102-1 - new upstream release - drop unnecessary fixed compile error for Vine5 patch (Patch1) * Mon Oct 11 2010 IWAI, Masaharu 0.13.499.102-1 - new upstream release - new elisp sub-package: mozc-el: upstream released * Fri Sep 10 2010 IWAI, Masaharu 0.13.464.102-1 - new upstream release * Sun Aug 15 2010 IWAI, Masaharu 0.12.434.102-1 - new upstream release - replace icons: using official icons - drop AWASHIRO Ikuya's icons (Source3,4,5,6) * Mon Jul 12 2010 IWAI, Masaharu 0.12.402.102-2 - drop obsolete x86_64 libdir patch (Patch2) - replace source tarball: using upstream tarball - add mozc-copyright (Source1) from SVN debian/copyright * Fri Jul 2 2010 IWAI, Masaharu 0.12.402.102-1 - new upstream release - drop mozcdic-ut dictionary - update README.vine (Source10) - defined output_dir macro for %%install section * Thu Jun 24 2010 IWAI, Masaharu 0.11.383.102-3 - add x86_64 libdir patch (Patch2): based openSUSE by kazukado * Mon Jun 21 2010 IWAI, Masaharu 0.11.383.102-2 - create new package scim-mozc - add icons (Source5, Source6) - update icons (Source3, Source4) * Fri Jun 18 2010 IWAI, Masaharu 0.11.383.102-1 - update to 0.11.383.102 (svn rev.30) * Wed Jun 9 2010 IWAI, Masaharu 0.11.0-9.svn28 - update execute files path: * Fri Jun 4 2010 IWAI, Masaharu 0.11.0-8.svn28 - disable all mozcdic-ut dictionary (disable jinmei and zipcode) - update README.vine - add BuildRequires: gyp - drop BuildRequires: subversion * Wed Jun 2 2010 IWAI, Masaharu 0.11.0-7.svn28 - add mozc_tool's icon (Source4) - rename Source0: fixed created directory name "src" * Tue Jun 1 2010 IWAI, Masaharu 0.11.0-6.svn28 - update mozcdic-ut 20100601 (Source10) - include documents for all dictionaries - add BuildRequires: qt4-devel * Tue Jun 1 2010 IWAI, Masaharu 0.11.0-5.svn28 - rename base name: mozc - add new sub packages: - mozc-server - mozc-utils-gui - update source to revision 28 - replace icon (Source3) - drop mozc-config: upstream implement same tool * Sun May 23 2010 Kazutaka HARADA 0.11.0-4 - update source to revision 23 - add BuildRequires protobuf-devel, gtest-devel - drop Patch0 (ibus-mozc-fix-for-x86_64.diff) - add mozc-config as Source10 and desktop entry as Source11 * Sat May 15 2010 IWAI, Masaharu 0.11.0-3 - rebuild with ibus-1.3.3 * Fri May 14 2010 Kazutaka HARADA 0.11.0-2 - add Patch1 to fix compile error on i386 (workaround patch) * Thu May 13 2010 Kazutaka HARADA 0.11.0-1 - initial build for Vine Liux based on custom mandriva package made by UTUMI-san * Thu May 13 2010 UTUMI Hirosi 0.11.0-2.20110511.1mdv2010.1 - add some dictionaries * Wed May 12 2010 UTUMI Hirosi 0.11.0-1.20110511.1mdv2010.1 - first release