File rtl8821au.spec of Package rtl8821au

#
# spec file for package rtl8821au
#
#
# Copyright (c) 2025 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
# norootforbuild
# needssslcertforbuild

%define upstream_version 20251003

Name:		rtl8821au

Summary:	Realtek 8821au Wireless LAN Drivers for USB Devices
Version:	%{upstream_version}
Release:	1.1
Group:		System/Kernel
License:	GPL-2.0
Url:		https://github.com/morrownr/8821au-20210708
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

Source0:	%{name}.tar.gz
Source1:	%{name}-rpmlintrc
Patch1:     leap155.patch
Patch2:		leap156.patch
Patch3:		ccflags.patch
Patch4:		kernel615.patch
Patch5:		kernel616.patch
Patch6:		kernel617.patch

BuildRequires:	%kernel_module_package_buildreqs
%if 0%{?sle_version} > 150600
BuildRequires:  suse-module-tools-scriptlets
%endif
BuildRequires:  pesign-obs-integration
BuildRequires:	bc

Autoreqprov:	on

%kernel_module_package -n rtl8821au -x debug -x trace -c %_sourcedir/_projectcert.crt -p %_sourcedir/preamble
%description
Please note:
This driver is obsolete and will be disabled in future, please use the kernel-buildin driver RTW88 or the RTW88 from my Repo.

Linux Driver for USB WiFi Adapters that are based on the RTL8811AU and RTL8821AU Chipsets

    v5.12.5.2 (Realtek) (20210708) plus updates from the Linux community



%prep
%setup -q -n %{name}
%if 0%{?sle_version} == 150500
%patch -P 1 -p1
%endif
%if 0%{?sle_version} == 150600
%patch -P 2 -p1
%endif
%patch -P 3 -p1
%patch -P 4 -p1
%patch -P 5 -p1
%patch -P 6 -p1

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

%build
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
export CONFIG_RTL8821AU=m
for flavor in %flavors_to_build; do
	rm -rf obj/$flavor
	cp -r source obj/$flavor
	make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
	M=$PWD/obj/$flavor
done

%install
#install the module
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
export CONFIG_RTL8821AU=m
export BRP_PESIGN_FILES='*.ko'
export BRP_PESIGN_COMPRESS_MODULE="xz"

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

%changelog
openSUSE Build Service is sponsored by