File rtl8852bu.spec of Package rtl8852bu

#
# spec file for package rtl8852bu
#
#
# Copyright (c) 2024 SUSE LINUX Products 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

%bcond_with concurrent_mode

Name:		rtl8852bu
Summary: 	Linux Driver for USB WiFi Adapters that are based on the RTL8852BU and RTL8832BU Chipsets
Version:	1.19.3~25gb0c77f4
Release:	0
Group:		System/Kernel
License:	GPL-2.0
Url:		https://github.com/morrownr/rtl8852bu
Source0:	%{name}-%{version}.tar
Source1:	preamble
Patch1:		leap155.patch
Patch2:		leap156.patch

BuildRequires:  kernel-source
BuildRequires:	%{kernel_module_package_buildreqs}
BuildRequires:  pesign-obs-integration


%kernel_module_package -n rtl8852bu -x debug -x trace -c %_sourcedir/_projectcert.crt -p %_sourcedir/preamble

%description 
Linux Driver for USB WiFi Adapters that are based on the RTL8852BU and RTL8832BU Chipsets

The below adapters are multi-state adapters, meaning that they
have an internal Windows driver, and may be problematic on Linux.

* Brostrend AX1L
* Brostrend AX4L
* ALFA AWUS036AXER
* ALFA AWUS036AX
* Additional adapters that are based on the supported chipsets.


%package	KMP
Summary: 	Linux Driver for USB WiFi Adapters that are based on the RTL8852BU and RTL8832BU Chipsets
Group:		System/Kernel

%description KMP
Linux Driver for USB WiFi Adapters that are based on the RTL8852BU and RTL8832BU Chipsets

The below adapters are multi-state adapters, meaning that they
have an internal Windows driver, and may be problematic on Linux.

* Brostrend AX1L
* Brostrend AX4L
* ALFA AWUS036AXER
* ALFA AWUS036AX
* Additional adapters that are based on the supported chipsets.

%package conf
Summary:        Configuration File for RTL8852bu Wlan
License:        GPL-3.0
Group:          System/Kernel
Requires:       %{name}-kmp = %{version}

%description conf
Contains an example file for settings of the RTL8852bu Wlan Adapter.
Copy this file to /etc/modprobe.d or /usr/etc/modprobe.d and make your changes.

%prep
%setup -q
%if 0%{?sle_version} == 150500
%patch -P 1 -p1
%endif

%if 0%{?sle_version} == 150600
%patch -P 2 -p1
%endif



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

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

%install

#install the module
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
export CONFIG_RTL8852BU=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

%{__mkdir_p} %{buildroot}%{_prefix}/lib/modprobe.d/
install -Dm0644 source/8852bu.conf %{buildroot}%{_prefix}/lib/modprobe.d/rtl8852bu.conf

%clean
rm -rf $RPM_BUILD_ROOT

%files conf
%defattr(-,root,root)
%{_prefix}/lib/modprobe.d/rtl8852bu.conf

%changelog
openSUSE Build Service is sponsored by