File r8125.spec of Package r8125
#
# spec file for package r8125.spec
#
# Copyright (c) 2024 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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
Name:           r8125
Version:        9.016.01
Release:        1.2
Summary:        Linux device driver for Realtek Ethernet controllers
License:        GPL-2.0+
Group:          System/Kernel
Url:            https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software
Source0:        %{name}-%{version}.tar.bz2
Source1:        preamble
Conflicts:      r8168-kmp-default
BuildRequires:	%kernel_module_package_buildreqs
BuildRequires:  pesign-obs-integration gcc13
%kernel_module_package -n r8125 -x debug -x trace -c %_sourcedir/_projectcert.crt -p %_sourcedir/preamble
%description
This is the Linux device driver released for RealTek RTL8125 2.5Gigabit
Ethernet controllers with PCI-Express interface.
%package blacklist-r8169
Summary:        To favour r8125 blacklist the r8169 device driver
Group:          Hardware/Wifi
Requires:       %{name}-kmp = %{version}
%description blacklist-r8169
On many Realtek Ethernet controllers the old device driver r8169 does
not work reliably.  To solve this the r8169 kernel module has to be
blacklisted to enable the system to load the new device driver r8125.
%prep
%setup -q
set -- src/*
mkdir source
cp "$@" source/
mkdir obj
%build
export CC=gcc-13
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
export KBUILD_NOPEDANTIC=1
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
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
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}%{_modprobedir}/
cat > %{buildroot}%{_modprobedir}/80-blacklist-r8169.conf<<-'EOF'
	# On many Realtek Ethernet controllers the old device driver r8169 does
	# not work reliably.  To solve this the r8169 kernel module has to be 
	# blacklisted to enable the system to load the new device driver r8125.
	blacklist r8169
	EOF
%clean
%{__rm} -rf %{buildroot}
%files blacklist-r8169
%defattr(-, root, root)
%config %{_modprobedir}/80-blacklist-r8169.conf
	
%changelog