File rtw89.spec of Package rtw89

#
# spec file for package rtw89
#
# 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/
#
# needssslcertforbuild


Name:           rtw89
Version:        5.17~84.gd1fced1
Release:        0
Summary:        Driver for Realtek 8852AE, 8852BE, 8852CE, and RTW8922AE Wifi chip
License:        GPL-2.0-only
Group:          System/Kernel
URL:            https://github.com/lwfinger/rtw89
Source0:        %{name}-%{version}.tar
Source1:        preamble

Patch1:			Makefile.patch
Patch2:			kernel613.patch
Patch3:			kernel614.patch
Patch4:			sync_skb_for_device.patch
Patch5:			leap.patch

BuildRequires:  kernel-source
BuildRequires:  %{kernel_module_package_buildreqs}
BuildRequires:  pesign-obs-integration
%kernel_module_package -n rtw89 -x debug -x trace -c %{_sourcedir}/_projectcert.crt -p %{_sourcedir}/preamble

%description
A driver for the Realtek 8852AE, 8852BE, 8852CE, and RTW8922AE Wifi chip with
802.11ax / Wi-Fi 6 support.

%prep
%setup -q

%autopatch -p1


set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
[ -n "$SOURCE_DATE_EPOCH" ] && export KBUILD_BUILD_TIMESTAMP=@$SOURCE_DATE_EPOCH
for flavor in %{flavors_to_build}; do
	rm -rf obj/$flavor
	cp -r source obj/$flavor
	%make_build -C %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor modules \
	     M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates/rtw89/
export BRP_PESIGN_FILES='*.ko'
export BRP_PESIGN_COMPRESS_MODULE="xz"

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

%changelog
openSUSE Build Service is sponsored by