-# TODO: fep?
#
# Conditional build:
-%bcond_without apidocs # do not build and package API docs
-%bcond_without static_libs # don't build static libraries
-#
+%bcond_without apidocs # valadoc/devhelp based API documentation
+%bcond_without static_libs # static library
+%bcond_without fep # fep client
+
Summary: Library to deal with Japanese kana-to-kanji conversion method
Summary(pl.UTF-8): Biblioteka obsługi metody konwersji tekstu japońskiego kana do kanji
Name: libskk
-Version: 1.0.0
+Version: 1.0.5
Release: 1
License: GPL v3+
Group: Libraries
-#Source0Download: https://github.com/ueno/libskk/downloads
-Source0: https://github.com/downloads/ueno/libskk/%{name}-%{version}.tar.gz
-# Source0-md5: 4318fabf49041950cabb0ed1d5bf286a
+#Source0Download: https://github.com/ueno/libskk/releases
+Source0: https://github.com/ueno/libskk/releases/download/%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: 683c5a2dd23171297132453afd62e3c4
URL: https://github.com/ueno/libskk/
-BuildRequires: gettext-devel
-BuildRequires: glib2-devel >= 2.0
+BuildRequires: gettext-tools >= 0.19.8
+BuildRequires: glib2-devel >= 1:2.36
BuildRequires: gobject-introspection-devel >= 0.9.0
BuildRequires: json-glib-devel
-BuildRequires: libgee0.6-devel
+BuildRequires: libgee-devel >= 0.8
BuildRequires: pkgconfig
# not needed for releases
#BuildRequires: vala >= 2:0.14.0
-%{?with_apidocs:BuildRequires: valadoc >= 0.3.1}
+%{?with_apidocs:BuildRequires: valadoc >= 0.40}
+BuildRequires: tar >= 1:1.22
+BuildRequires: xorg-lib-libxkbcommon-devel
+BuildRequires: xz
+%if %{with fep}
+BuildRequires: libfep-devel >= 0.0.7
+BuildRequires: vala-libfep >= 0.0.7
+%endif
+BuildRequires: vala-libgee >= 0.8
+Requires: glib2 >= 1:2.36
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
libskk to biblioteka do obsługi metody konwersji tekstu japońśkiego
kana do kanji.
+%package fep
+Summary: skkfep - Japanese SKK input method on text terminal
+Summary(pl.UTF-8): skkfep - metoda wprowadzania znaków japońskich SKK z terminala tekstowego
+Group: Applications/Text
+Requires: %{name} = %{version}-%{release}
+Requires: libfep >= 0.0.7
+
+%description fep
+skkfep is a tool that allows to use Japanese input method called SKK
+(Simple Kana to Kanji conversion program) on ANSI compliant text
+terminals.
+
+%description fep -l pl.UTF-8
+skkfep to narzędzie pozwalające na używanie metody wprowadzania znaków
+japońskich SKK (Simple Kana to Kanji - konwersja uproszczonego kana do
+kanji) na terminalach tekstowych zgodnych z ANSI.
+
%package devel
Summary: Header files for libskk library
Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libskk
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
-Requires: glib2-devel >= 2.0
+Requires: glib2-devel >= 1:2.36
Requires: json-glib-devel
-Requires: libgee0.6-devel
+Requires: libgee-devel >= 0.8
%description devel
Header files for libskk library.
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: vala >= 2:0.14.0
-Requires: vala-libgee0.6
+Requires: vala-libgee >= 0.8
+%if "%{_rpmversion}" >= "4.6"
+BuildArch: noarch
+%endif
%description -n vala-libskk
Vala API for libskk library.
Summary: libskk API documentation
Summary(pl.UTF-8): Dokumentacja API biblioteki libskk
Group: Documentation
+%if "%{_rpmversion}" >= "4.6"
+BuildArch: noarch
+%endif
%description apidocs
API and internal documentation for libskk library.
%setup -q
%build
+# pass fake VALADOC_* args to avoid requiring valadoc-devel
+# (only utility is needed here, but configure checks for development package)
%configure \
+ VALADOC_CFLAGS=fake \
+ VALADOC_LIBS=fake \
%{?with_apidocs:--enable-docs} \
+ %{?with_fep:--enable-fep} \
%{?with_static_libs:--enable-static}
%{__make}
%{_datadir}/libskk
%{_mandir}/man1/skk.1*
+%if %{with fep}
+%files fep
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/skkfep
+%attr(755,root,root) %{_libdir}/skkfep-client
+%{_mandir}/man1/skkfep.1*
+%endif
+
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libskk.so
%files apidocs
%defattr(644,root,root,755)
%{_gtkdocdir}/libskk
+# should it be here?
+%{_datadir}/devhelp/references/libskk
%endif