File looking-glass-kmp.spec of Package looking-glass

#
# spec file for package looking-glass-kmp
#
# Copyright (c) 2025 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/
#

Name:           looking-glass-kmp
Version:        B7
Release:        0
Summary:        Kernel module for Looking Glass (IVSHMEM framebuffer sharing)
License:        GPL-2.0-only
Group:          System/Kernel
URL:            https://looking-glass.io/
Source0:        https://github.com/gnif/LookingGlass/archive/refs/tags/LookingGlass-B7.tar.gz
Source1:        looking-glass-kmp-preamble
BuildRequires:  %kernel_module_package_buildreqs
BuildRequires:  kernel-syms >= 2.6.20

%{?kernel_module_package:%kernel_module_package -n looking-glass -p %name-preamble}

%description
This package provides the kvmfr kernel module used by Looking Glass for IVSHMEM frame sharing.

%package KMP
Summary:        Kernel module for Looking Glass (IVSHMEM framebuffer sharing)

%description KMP
This package provides the kvmfr kernel module used by Looking Glass for IVSHMEM frame sharing.

%prep
echo %flavors_to_build
%setup -q -n LookingGlass-B7
# Se estiver em "module/", mova para a raiz
mv module kvmfr

%build
for flavor in %flavors_to_build; do
    cp -a kvmfr "obj-$flavor"
    make -C /usr/src/linux-obj/%_target_cpu/$flavor \
         M=$PWD/obj-$flavor \
         %{?_smp_mflags}
done

%install
export INSTALL_MOD_PATH="%buildroot"

for flavor in %flavors_to_build; do
    make -C /usr/src/linux-obj/%_target_cpu/$flavor \
         M=$PWD/obj-$flavor \
         modules_install
done

%check
# No test suite provided

%files
%license LICENSE
%doc README.md
openSUSE Build Service is sponsored by