File rtw89.spec of Package rtw89

#
# spec file for package rtlwifi_new-extended
#
#
# Copyright (c) 2016 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
#
%if 0%{?suse_version} >= 1230
%global __requires_exclude ksyms*|kernel-uname-r*
%endif

%if 0%{?opensuse_bs}
%bcond_with buildjobs
%endif



Name:		rtw89
Summary:	RTW89 supports 8852AE chips
Version:	git20210719
Release:	1
Group:		System/Kernel
License:	GPL-2.0
Url:		https://github.com/lwfinger/rtw89
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
Source0:	%{name}.tar.gz
Source1:	preamble
Patch1:     leap153.patch

BuildRequires:	%kernel_module_package_buildreqs unzip
BuildRequires:	libelf-devel

Provides:   %{name} = %{version}
Obsoletes:  %{name} < %{version}
Conflicts:	%{name} = %{version}
Autoreqprov:	on
Requires(post): dracut

%suse_kernel_module_package -n rtw89 -p %_sourcedir/preamble kdump ec2 um

%description
A new driver for the newest Realtek rtlwifi cards.

This repository includes drivers for the following cards:

Realtek 8852AE

%debug_package

%prep
%setup -q -n %{name}

%if 0%{?sle_version} == 150300
%patch1 -p1
%endif


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

%build
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
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 \
%if %{with buildjobs}
		M=$PWD/obj/$flavor %{?jobs:-j%jobs}
%else
		M=$PWD/obj/$flavor
%endif
done

%install
#install the module
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates/rtw89/
for flavor in %flavors_to_build; do
	make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
		M=$PWD/obj/$flavor
done

%post
%{?regenerate_initrd_post}

%postun
%{?regenerate_initrd_post}

%posttrans
%{?regenerate_initrd_posttrans}

%changelog
openSUSE Build Service is sponsored by