%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Summary: X.Org X11 XKB parsing library
Summary(ja): X.Org X11 XKB 解析ライブラリ
Name: libxkbcommon
Version: 1.4.1
Release: 1%{?_dist_release}
Group: system
Vendor: Project Vine
Distribution: Vine Linux

License: MIT
URL: http://xkbcommon.org/
Source0: http://xkbcommon.org/download/%{name}-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: libxcb-devel
BuildRequires: xorg-x11-util-macros
BuildRequires: xkeyboard-config
BuildRequires: bison
BuildRequires: meson
BuildRequires: libxml2-devel

%description
xkbcommon is a library to handle keyboard descriptions, including
loading them from disk, parsing them and handling their state. 
It's mainly meant for client toolkits, window systems, and other
system applications; currently that includes Wayland, kmscon, GTK+,
Qt, Clutter, and more. It is also used by some XCB applications for
proper keyboard support. 


%package        devel
Summary:        Development tools for %{name}
Summary(ja):    %{name} の開発環境
Group:          programming
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig
Requires:       libxcb-devel

%description devel
Header files and libraries for building a extension library for the %{name}.


%package utils
Summary:        X.Org X11 XKB parsing utilities
Group:          admin-tools
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description utils
%{name}-utils is a set of utilities to analyze and test XKB parsing.


# compat32
%package -n compat32-%{name}
Summary: X.Org X11 XKB parsing library
Summary(ja): X.Org X11 XKB 解析ライブラリ
Group: system,legacy
Requires: %{name} = %{version}-%{release}

%description -n compat32-%{name}
xkbcommon is a library to handle keyboard descriptions, including
loading them from disk, parsing them and handling their state. 
It's mainly meant for client toolkits, window systems, and other
system applications; currently that includes Wayland, kmscon, GTK+,
Qt, Clutter, and more. It is also used by some XCB applications for
proper keyboard support. 


%package -n compat32-%{name}-devel
Summary:        Development tools for %{name}
Summary(ja):    %{name} の開発環境
Group:          programming,legacy
Requires:       %{name}-devel = %{version}-%{release}
Requires:       pkgconfig
Requires:       compat32-libxcb-devel

%description -n compat32-%{name}-devel
Header files and libraries for building a extension library for the %{name}.


%debug_package


%prep
%setup -q


%build
%meson \
	-Denable-docs=false \
	-Denable-x11=true \
	-Denable-wayland=false \
	-Ddefault-model=pc106 \
	-Ddefault-layout=jp

%meson_build


%install
rm -rf $RPM_BUILD_ROOT
%meson_install


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc COPYING NEWS README.md
%{_libdir}/libxkbcommon-x11.so.*
%{_libdir}/libxkbcommon.so.*
%{_libdir}/libxkbregistry.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/xkbcommon/
%{_libdir}/libxkbcommon-x11.so
%{_libdir}/libxkbcommon.so
%{_libdir}/libxkbregistry.so
%{_libdir}/pkgconfig/xkbcommon-x11.pc
%{_libdir}/pkgconfig/xkbcommon.pc
%{_libdir}/pkgconfig/xkbregistry.pc

%files utils
%{_bindir}/xkbcli
%{_libexecdir}/xkbcommon/xkbcli-compile-keymap
%{_libexecdir}/xkbcommon/xkbcli-how-to-type
%{_libexecdir}/xkbcommon/xkbcli-interactive-evdev
%{_libexecdir}/xkbcommon/xkbcli-interactive-x11
%{_libexecdir}/xkbcommon/xkbcli-list
%{_mandir}/man1/xkbcli-compile-keymap.1.gz
%{_mandir}/man1/xkbcli-how-to-type.1.gz
%{_mandir}/man1/xkbcli-interactive-evdev.1.gz
%{_mandir}/man1/xkbcli-interactive-x11.1.gz
%{_mandir}/man1/xkbcli-list.1.gz
%{_mandir}/man1/xkbcli.1.gz

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root,-)
%{_libdir}/libxkbcommon-x11.so.*
%{_libdir}/libxkbcommon.so.*
%{_libdir}/libxkbregistry.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root,-)
%{_libdir}/libxkbcommon-x11.so
%{_libdir}/libxkbcommon.so
%{_libdir}/libxkbregistry.so
%endif


%changelog
* Tue Sep 13 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.1-1
- new upstream release.

* Sun Jul  3 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.6.1-1
- new upstream release.

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4.3-1
- initial build

