File rtl8192eu.spec of Package rtl8192eu

#
# spec file for package rtl8192eu
#
# Copyright (c) 2024 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 https://bugs.opensuse.org/
#
# norootforbuild
# needssslcertforbuild

Name:           rtl8192eu
Version:        5.11.2.1.git20250812
Release:        0
Summary:        RTL8192eu Linux Driver
License:        GPL-2.0-only
Group:          System/Kernel
URL:            https://github.com/clnhub/rtl8192eu-linux
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}.preamble
Patch1:         kernel517.patch
Patch2:         Makefile.patch
Patch3:         leap155.patch
Patch4:         kernel68.patch
#Patch5:         leap160.patch

BuildRequires:  %{kernel_module_package_buildreqs}
BuildRequires:  bc
BuildRequires:  pesign-obs-integration
%kernel_module_package -n rtl8192eu -x debug -x trace -c %{_sourcedir}/_projectcert.crt -p %{_sourcedir}/preamble
%if 0%{?sle_version} > 150600
BuildRequires:  suse-module-tools-scriptlets
%endif

%description
This package contains the rtl8192eu Driver for Linux
Its an Implacemant for some chips of the rtl8xxxu driver.
The driver will be called "8192eu.ko"

%package		KMP
Summary:        RTL8182eu Linux Driver
Group:          System/Kernel
Requires:       %{name}-blacklist-rtl8xxxu

%description KMP
This package contains the rtl8192eu Driver for Linux
Its an Implacemant for some chips of the rtl8xxxu driver.
The driver will be called "8192eu.ko"

You need also the blacklist rpm.

%package blacklist-rtl8xxxu
Summary:        To favour rtl8192eu blacklist the rtl8xxxu device driver
Group:          Hardware/Wifi
##BuildArch:      noarch
Requires:       %{name}-kmp = %{version}

%description blacklist-rtl8xxxu
On many Realtek Ethernet controllers the old device driver rtl8xxxu does
not work reliably.  To solve this the rtl8xxxu kernel module has to be
blacklisted to enable the system to load the new device driver rtl8192eu.

%prep
echo %{flavors_to_build}
%setup -q

%patch -P 1 -p1
%patch -P 2 -p1
%if 0%{?sle_version} == 150500
%patch -P 3 -p1
%endif
%patch -P 4 -p1
#%if 0%{?suse_version} >= 1500
#%patch -P 5 -p1
#%endif

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

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

%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
export CONFIG_RTL8192EU=m
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



mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d/
cat > %{buildroot}%{_sysconfdir}/modprobe.d/50-blacklist-rtl8xxxu.conf<<-'EOF'
	#On many Realtek Ethernet controllers the old device driver rtl8xxxu does
	#not work reliably.  To solve this the rtl8xxxu kernel module has to be
	#blacklisted to enable the system to load the new device driver rtl8192eu.
	blacklist rtl8xxxu
	EOF

%files blacklist-rtl8xxxu
%config %{_sysconfdir}/modprobe.d/50-blacklist-rtl8xxxu.conf

%changelog
openSUSE Build Service is sponsored by