File kinput2.spec of Package kinput2

# spec file for package kinput2
# Copyright (c) 2018 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

Name:           kinput2
Version:        v3.1
Release:        0
Summary:        Kanji Input Server for the X Window System
License:        HPND
Group:          System/I18n/Japanese
Source10:       etc-x11-xim.d-kinput2-canna
Source11:       etc-x11-xim.d-kinput2-wnn
Patch1:         Kinput2.conf.patch
Patch3:         %{name}-v3.1-beta3.dif
Patch4:         %{name}-v3.1-beta3-java.dif
Patch5:         kinput2-v3.1-rootwindow-1.patch
Patch6:         reset_state.patch
Patch7:         kinput2-nonvoid.patch
Patch8:         64bit.patch
Patch9:         bugzilla-47203-keep-auxiliary-windows-on-top.patch
Patch10:        bugzilla-63978-hoge.patch
Patch11:        bugzilla-62553-spotlocation.patch
Patch12:        %{name}-%{version}-prototypes.patch
Patch13:        canna_c-warn.diff
Patch14:        bugzilla-137396-cannot-work-after-specific-function-calls.patch
Patch15:        bugzilla-368441-local-variable-used-before-set.patch
# PATCH-FIX-UPSTREAM getline() is a standard function in stdio.h
# rename to getLine
Patch16:        kinput2-v3.1-getline.patch
BuildRequires:  canna-devel
BuildRequires:  fwnn-devel
BuildRequires:  imake
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xaw7)
BuildRequires:  pkgconfig(xmu)
BuildRequires:  pkgconfig(xt)
# Own /etc/X11/xim.d
BuildRequires:  x11-tools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Kinput2 is an input server for X Window System applications that
require Japanese text input.

%setup -n %{name}-v3.1
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
# doesn't help for this version of kinput2, Java problem still exists.
#%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
head -n 21 cmd/kinput2.c > Copyright

make %{?_smp_mflags} Makefiles
make %{?_smp_mflags} depend
make %{?_smp_mflags} CCOPTIONS="%{optflags}"

make DESTDIR=%{buildroot} install %{?_smp_mflags}
mkdir -p %{buildroot}%{_sysconfdir}/X11/xim.d/ja
install -m 644 %{SOURCE10} \
install -m 644 %{SOURCE11} \
pushd  %{buildroot}%{_sysconfdir}/X11/xim.d/
    ln -s kinput2-canna kinput2
    pushd ja
        ln -s ../kinput2-canna 70-kinput2-canna
	ln -s ../kinput2-wnn   71-kinput2-wnn

%defattr(-, root, root)
%doc Copyright NEWS doc
%doc client/README
%config %{_sysconfdir}/X11/xim.d/*
%doc %{_mandir}/*/*
%dir %{_libexecdir}/X11/ccdef/