File maliit-framework.spec of Package maliit-framework

#
# spec file for package maliit-framework
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%define _shared_libname libmaliit2
%define _minsover 3.0
%define _sover 2
Name:           maliit-framework
Version:        2.3.0
Release:        0
License:        LGPL-2.1-only
Summary:        Maliit input method framework
URL:            https://github.com/maliit/framework
Source0:        https://github.com/maliit/framework/archive/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM - maliit-framework-operator_definition.patch - Move the operator== definition to global namespace
Patch1:         %{name}-operator_definition.patch
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  extra-cmake-modules
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libQt5Gui-private-headers-devel
BuildRequires:  libqt5-qtwayland-private-headers-devel
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5DBus)
BuildRequires:  cmake(Qt5Gui)
BuildRequires:  cmake(Qt5Quick)
BuildRequires:  cmake(Qt5WaylandClient)
BuildRequires:  cmake(Qt5XkbCommonSupport)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-protocols)
BuildRequires:  pkgconfig(wayland-scanner)
BuildRequires:  pkgconfig(xkbcommon)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Maliit provides a flexible and cross-platform input method framework.
It has a plugin-based client-server architecture where applications
act as clients and communicate with the Maliit server via input
context plugins. The communication link currently uses D-Bus. Maliit
is an open source framework (LGPL 2) with open source plugins (BSD).
This package also provides plugin support.

%package        doc
Summary:        Maliit Framework documentation

%description    doc
Provides doxygen documentation for the Maliit Framework.

%package        devel
Summary:        Maliit Framework development packages
Requires:       %{_shared_libname} = %{version}-%{release}

%description    devel
Provides headers and CMake files built for the Maliit Framework.

%package     -n %{_shared_libname}
Summary:        Maliit Framework shared libraries
Requires:       %{name}

%description -n %{_shared_libname}
Provides shared libraries built for the Maliit Framework.

%prep
%autosetup -p1 -n framework-%{version}/

%build
%cmake  -Denable-dbus-activation=ON \
        -Denable-hwkeyboard=ON \
        -Denable-qt5-inputcontext=ON \
        -Denable-wayland-gtk=ON \
        -Denable-wayland=ON \
        -Denable-xcb=ON \
        -Denable-glib=ON \
        -Denable-tests=ON \
        -Denable-docs=ON \
        -Denable-examples=OFF
%cmake_build

%install
%cmake_install
%fdupes %{buildroot}%{_prefix}

%ldconfig_scriptlets -n %{_shared_libname}

%files doc
%{_datadir}/doc/maliit-framework-doc/
%{_datadir}/doc/maliit-framework/

%files devel
%{_includedir}/maliit-2
%{_libdir}/cmake/{MaliitGLib,MaliitPlugins}/
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libmaliit-plugins.so
%{_libdir}/libmaliit-glib.so
%{_libdir}/qt5/mkspecs/features/*.prf

%files -n %{_shared_libname}
%{_libdir}/libmaliit-glib.so.%{_sover}
%{_libdir}/libmaliit-glib.so.%{_sover}.%{_minsover}
%{_libdir}/libmaliit-plugins.so.%{_sover}
%{_libdir}/libmaliit-plugins.so.%{_sover}.%{_minsover}

%files
%defattr(-,root,root,-)
%doc README.md
%license LICENSE.LGPL
%{_bindir}/maliit-server
%{_libdir}/qt5/plugins/platforminputcontexts/libmaliitplatforminputcontextplugin.so
%{_libdir}/qt5/plugins/wayland-shell-integration/libinputpanel-shell.so
%{_datadir}/dbus-1/services/org.maliit.server.service

%changelog
openSUSE Build Service is sponsored by