Problem getting expanded diff: service error: 2025-03-16 18:07:10 ERROR 503: Service Temporarily Unavailable.

File r8168.spec of Package r8168 (Revision 42)

Currently displaying revision 42 , Show latest

137
 
1
#
2
# spec file for package r8168
3
#
4
# Copyright (c) 2019 Packman Team <packman@links2linux.de>
5
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
6
#
7
# All modifications and additions to the file contributed by third parties
8
# remain the property of their copyright owners, unless otherwise agreed
9
# upon. The license for this file, and modifications and additions to the
10
# file, is the same license as for the pristine package itself (unless the
11
# license for the pristine package is not an Open Source License, in which
12
# case the license is the MIT License). An "Open Source License" is a
13
# license that conforms to the Open Source Definition (Version 1.9)
14
# published by the Open Source Initiative.
15
16
# Please submit bugfixes or comments via https://bugs.links2linux.org/
17
#
18
19
#!BuildIgnore: enough-build-resources
20
Name:           r8168
21
Version:        8.053.00
22
Release:        0
23
Summary:        Device driver for RealTek Gigabit Ethernet controllers
24
License:        GPL-2.0-or-later
25
Group:          System/Kernel
26
URL:            https://github.com/mtorromeo/r8168
27
Source0:        https://github.com/mtorromeo/r8168/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
28
Source1:        preamble
29
Source2:        Module.supported
30
Source3:        https://github.com/mtorromeo/r8168/releases/download/%{version}/%{name}-%{version}.tar.gz.asc
31
Source4:        r8168.keyring
32
Patch0:         r8168-kernel_version.patch
33
Patch1:         r8168-configuration.patch
34
Patch2:         r8168-support-linux-5.19.patch
35
Patch3:         r8168-support-ethtool_keee.patch
36
Patch4:         r8168-support-dev0x8136.patch
37
Patch5:         r8168-support-linux-L15.5.patch
38
BuildRequires:  kernel-source
39
BuildRequires:  kernel-syms
40
BuildRequires:  libelf-devel
41
BuildRequires:  module-init-tools
42
%if %{defined kernel_module_package_buildreqs}
43
BuildRequires:  %kernel_module_package_buildreqs
44
%endif
45
Requires:       r8168-kmp
46
ExclusiveArch:  %{ix86} x86_64
47
%if %{defined kernel_module_package}
48
%kernel_module_package -n r8168 -p %_sourcedir/preamble
49
%endif
50
51
%description
52
This is the Linux device driver released for RealTek RTL8168B/8111B,
53
RTL8168C/8111C, RTL8168CP/8111CP, RTL8168D/8111D, RTL8168DP/8111DP,
54
and RTL8168E/8111E Gigabit Ethernet controllers with PCI-Express interface.
55
56
%package blacklist-r8169
57
Summary:        To favour r8168 blacklist the r8169 device driver
58
Group:          Hardware/Wifi
59
BuildArch:      noarch
60
Requires:       %{name}-kmp = %{version}
61
62
%description blacklist-r8169
63
On many Realtek Ethernet controllers the old device driver r8169 does
64
not work reliably.  To solve this the r8169 kernel module has to be
65
blacklisted to enable the system to load the new device driver r8168.
66
67
%prep
68
version=$(readlink /usr/src/linux | sed -r 's/linux-//;s/-.*//;s/\./,/g')
69
[[ "$version" =~ [0-9]+,[0-9]+,[0-9]+ ]] || \
70
version=$(uname -r|sed -r 's/-.*//;s/\./,/g')
71
%setup -q
72
%patch -P 0 -b .p0
73
%patch -P 1 -b .p1
74
%patch -P 2 -p1 -b .p2
75
%patch -P 4 -p1 -b .p4
76
if test -e /usr/src/linux/include/linux/ethtool.h
77
then
78
    argc=$(sed -rn '/\*get_ringparam/,/;$/p' /usr/src/linux/include/linux/ethtool.h | wc -l)
79
    if test -n "$argc" -a "$argc" -eq 4
80
    then
81
%patch -P 5 -b .p5
82
    fi
83
    argc=$(sed -rn '/ethtool_keee/p' /usr/src/linux/include/linux/ethtool.h | wc -l)
84
    if test -n "$argc" -a "$argc" -eq 3
85
    then
86
%patch -P 3 -p1 -b .p3
87
    sed -ri "/KERNEL_VERSION/{s/\(6,9,0\)/(${version})/}" src/r8168_n.c
88
    fi
89
fi
90
if test -e /usr/src/linux/include/net/gso.h
91
then
92
    sed -ri "/KERNEL_VERSION/{s/\(6,4,10\)/(${version})/}" src/r8168_n.c
93
fi
94
cp %{S:1} .
95
cp %{S:2} .
96
97
%build
98
#
99
# SUSE kernel does include some patches/commits which do not increase
100
# the kernel's version, there we test here if the linux/pci-acpi.h exits
101
#
102
if test -e /usr/src/linux/include/linux/pci-aspm.h
103
then
104
    sed -ri '/#define HAS_PCI_ASPM_H/{ s/@ASPM@/1/ }' src/r8168_n.c
105
else
106
    sed -ri '/#define HAS_PCI_ASPM_H/{ s/@ASPM@/0/ }' src/r8168_n.c
107
fi
108
ln -sf $(type -p kmod) modinfo
109
mkdir obj
110
for flavor in %{flavors_to_build}
111
do
112
    rm   -rf obj/$flavor
113
    cp   -rp src obj/$flavor
114
    make V=1 -C %{kernel_source $flavor} M=$PWD/obj/$flavor modules
115
    ./modinfo -F alias $(find $PWD/obj/$flavor/ -name '%{name}.ko')
116
done
117
118
%install
119
export INSTALL_MOD_PATH=%{buildroot}
120
export INSTALL_MOD_DIR=updates
121
for flavor in %{flavors_to_build}
122
do
123
    make -C %{kernel_source $flavor} M=$PWD/obj/$flavor modules_install
124
done
125
mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d/
126
cat > %{buildroot}%{_sysconfdir}/modprobe.d/50-blacklist-r8169.conf<<-'EOF'
127
    # On many Realtek Ethernet controllers the old device driver r8169 does
128
    # not work reliably.  To solve this the r8169 kernel module has to be
129
    # blacklisted to enable the system to load the new device driver r8168.
130
    blacklist r8169
131
    EOF
132
133
%files blacklist-r8169
134
%config %{_sysconfdir}/modprobe.d/50-blacklist-r8169.conf
135
136
%changelog
137