File input-leap.spec of Package input-leap

#
# spec file for package input-leap
#
# 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/
#

Summary: Keyboard and mouse sharing solution
Name: input-leap
# This version is overwriten by the _service
Version: placeholder
Release: 1%{?dist}
License: GPL-2.0-only
Group: System Environment/Daemons
URL: https://github.com/input-leap/input-leap
Source0: input-leap-%{version}.tar.xz

%if 0%{?fedora}
BuildRequires: avahi-compat-libdns_sd-devel
BuildRequires: cmake3
BuildRequires: desktop-file-utils
BuildRequires: gcc-c++
BuildRequires: gmock-devel
BuildRequires: gtest-devel
BuildRequires: gulrak-filesystem-devel
BuildRequires: libX11-devel
BuildRequires: libXtst-devel libXinerama-devel libXrandr-devel
BuildRequires: libICE-devel libSM-devel
BuildRequires: libcurl-devel
BuildRequires: openssl-devel
BuildRequires: qt6-qtbase-devel
BuildRequires: qt6-linguist
BuildRequires: make
%endif

%if 0%{?suse_version}
BuildRequires: avahi-compat-mDNSResponder-devel
BuildRequires: cmake >= 3
BuildRequires: desktop-file-utils
BuildRequires: gcc-c++
BuildRequires: gmock
BuildRequires: gtest
BuildRequires: libX11-devel
BuildRequires: libXtst-devel libXinerama-devel libXrandr-devel
BuildRequires: libICE-devel libSM-devel
BuildRequires: libcurl-devel
BuildRequires: libopenssl-devel
BuildRequires: qt6-base-devel qt6-qt5compat-devel
BuildRequires: qt6-tools-linguist qt6-linguist-devel
BuildRequires: libei1 libei-devel
BuildRequires: libportal1 libportal-devel libportal-qt6-1 libportal-qt6-devel
BuildRequires: make
BuildRequires: libxkbcommon-devel
%{?!cmake3:%define cmake3 %cmake}
%endif

%description
InputLeap allows you to share one mouse and keyboard between multiple computers.
Work seamlessly across Windows, macOS and Linux.

%prep
%setup -T -b 0 -q

%build
%{cmake} . \
    -DINPUTLEAP_VERSION_STAGE:STRING=snapshot \
    -DQT_DEFAULT_MAJOR_VERSION=6 \
    -DINPUTLEAP_BUILD_LIBEI=ON \
    -DINPUTLEAP_USE_EXTERNAL_GTEST=True \
    -DINPUTLEAP_REVISION:STRING=%{version}
%{cmake_build}


%install
%{cmake_install}

desktop-file-install --delete-original \
  --dir %{buildroot}%{_datadir}/applications \
  --set-icon=%{_datadir}/icons/hicolor/scalable/apps/io.github.input_leap.InputLeap.svg \
  %{buildroot}%{_datadir}/applications/io.github.input_leap.InputLeap.desktop

desktop-file-validate %{buildroot}/%{_datadir}/applications/io.github.input_leap.InputLeap.desktop

%files
# None of the documentation files are actually useful here, they all point to
# the online website, so include just one, the README
%doc LICENSE ChangeLog res/Readme.txt doc/input-leap.conf.example*
%{_bindir}/input-leap
%{_bindir}/input-leapc
%{_bindir}/input-leaps
%{_datadir}/icons/hicolor
%{_datadir}/icons/hicolor/scalable/apps
%{_datadir}/icons/hicolor/scalable/apps/io.github.input_leap.InputLeap.svg
%{_datadir}/applications/io.github.input_leap.InputLeap.desktop
%{_datadir}/metainfo/io.github.input_leap.InputLeap.appdata.xml
%{_mandir}/man1/input-leapc.1*
%{_mandir}/man1/input-leaps.1*

%changelog
openSUSE Build Service is sponsored by