File rtl8822bu.spec of Package rtl8822bu

#
# spec file for package rtl8723bu
#
#
# Copyright (c) 2018 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
#

%if 0%{?suse_version} >= 1230
%global __requires_exclude ksyms*|kernel-uname-r*
%endif


%bcond_with concurrent_mode

Name:		rtl8822bu
Summary: 	RTL8822BU wireless lan driver
Version:	git20200409
Release:	0
Group:		System/Kernel
License:	GPL-2.0
Url:		https://github.com/cilynx/rtl88x2bu
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
Source0:	%{name}.tar.gz
Source1:	preamble
Source100:	%{name}.changes
Patch1:     makefile.patch
Patch2:     Leap151.patch
Patch3:     new-usb-ID.patch
Patch4:     warning.patch

BuildRequires:	%kernel_module_package_buildreqs
BuildRequires:	libelf-devel
BuildRequires:  bc
Autoreqprov:	on
Provides:   %{name} = %{version}
Obsoletes:  %{name} < %{version}
Conflicts:	%{name} = %{version}

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

%description 
RTL8822BU for Linux

Driver for 802.11ac USB Adapter with
RTL8822BU chipset
Only STA/Monitor Mode is supported, no AP.

A few known wireless cards that use this driver include

    ASUS AC-53 NANO
    ASUS AC1300 USB-AC55 B1
    D-Link DWA-182 (Revision D1 only)
    D-Link DWA-182
    Edimax EW-7822ULC
    Edimax EW-7822UTC
    TP-Link Archer T3U V1
    TP-Link Archer T4U V3



%package	KMP
Summary: 	RTL8822BU wireless lan driver
Group:		System/Kernel

%description KMP
RTL8822BU for Linux

Driver for 802.11ac USB Adapter with
RTL8822BU chipset
Only STA/Monitor Mode is supported, no AP.

A few known wireless cards that use this driver include

    ASUS AC-53 NANO
    ASUS AC1300 USB-AC55 B1
    D-Link DWA-182 (Revision D1 only)
    D-Link DWA-182
    Edimax EW-7822ULC
    Edimax EW-7822UTC
    TP-Link Archer T3U V1
    TP-Link Archer T4U V3

%prep
%setup -q -n %{name}
%patch1 -p1
%if 0%{?sle_version} == 150100 && 0%{?is_opensuse}
%patch2 -p1
%endif
%patch3 -p1
%patch4 -p1

%if !%{with concurrent_mode}
%__sed -i 's|EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE|#EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE|g' Makefile
%endif

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

%build
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
export CONFIG_RTL8822BU=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_RTL8822BU=m
for flavor in %flavors_to_build; do
	make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
		M=$PWD/obj/$flavor
done

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
openSUSE Build Service is sponsored by