Blame SPECS/kmod-skge.spec

459d90
%global pkg skge
459d90
Kmods SIG 6d774e
%global driver_version 4.18.0-372.9.1.el8
Kmods SIG 6638e4
Kmods SIG 6d774e
%global kernel_version 4.18.0-372.9.1.el8
459d90
459d90
%global _use_internal_dependency_generator 0
b46994
%global __find_requires /usr/lib/rpm/redhat/find-requires
b46994
%global __find_provides /usr/lib/rpm/redhat/find-provides
459d90
459d90
%global debug_package %{nil}
459d90
459d90
%global __spec_install_post \
459d90
  %{?__debug_package:%{__debug_install_post}} \
459d90
  %{__arch_install_post} \
459d90
  %{__os_install_post} \
459d90
  %{__mod_compress_install_post}
459d90
459d90
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
459d90
459d90
459d90
Name:             kmod-%{pkg}
Kmods SIG 6d774e
Version:          4.18.0.372.9.1
Kmods SIG 6d774e
Release:          1%{?dist}
459d90
Summary:          SysKonnect/Marvell Yukon Gigabit Ethernet (%{pkg}) driver
459d90
459d90
License:          GPLv2
459d90
URL:              https://www.kernel.org/
459d90
Kmods SIG 6638e4
Source0:          %{pkg}-%{driver_version}.tar.xz
Kmods SIG 6638e4
Patch1:           0001-skge-potential-memory-corruption-in-skge_get_regs.patch
Kmods SIG 6638e4
Patch2:           0002-skge-fix-checksum-byte-order.patch
459d90
3cc0c9
ExclusiveArch:    x86_64 aarch64 ppc64le
459d90
459d90
BuildRequires:    elfutils-libelf-devel
459d90
BuildRequires:    gcc
b46994
BuildRequires:    kernel-rpm-macros
459d90
BuildRequires:    kmod
459d90
BuildRequires:    make
459d90
BuildRequires:    redhat-rpm-config
459d90
BuildRequires:    xz
459d90
b46994
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
459d90
BuildRequires:    kernel-devel = %{kernel_version}
459d90
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
459d90
b46994
Requires:         kernel >= %{kernel_version}
b46994
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
b46994
Requires:         kernel-modules >= %{kernel_version}
b46994
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
459d90
459d90
Provides:         installonlypkg(kernel-module)
b46994
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
459d90
b46994
Requires(post):   %{_sbindir}/depmod
b46994
Requires(postun): %{_sbindir}/depmod
459d90
b46994
Requires(post):   %{_sbindir}/weak-modules
b46994
Requires(postun): %{_sbindir}/weak-modules
459d90
459d90
fb9514
%if "%{version}" == "4.18.0.240" && "%{release}" == "2%{?dist}"
fb9514
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
fb9514
%endif
fb9514
fb9514
%if "%{version}" == "4.18.0.240" && "%{release}" == "3%{?dist}"
fb9514
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
fb9514
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
fb9514
%endif
fb9514
fb9514
459d90
%description
459d90
This driver supports Gigabit Ethernet adapters based on the Marvell Yukon
459d90
chipset:
459d90
459d90
- 0x10B7:0x1700: 3Com 3C940
459d90
- 0x10B7:0x80EB: 3Com 3C940B
459d90
- 0x1148:0x4300: SysKonnect SK-9xx
459d90
- 0x1148:0x4320: SysKonnect SK-98xx V2.0
459d90
- 0x1186:0x4302: D-Link DGE-530T Rev C1
459d90
- 0x1186:0x4B01: D-Link DGE-530T Rev B
459d90
- 0x1186:0x4C00: D-Link DGE-530T
459d90
- 0x11AB:0x4320: Marvell Yukon 88E8001/8003/8010
459d90
- 0x11AB:0x5005: Belkin
459d90
- 0x1371:0x434E: CNet PowerG-2000
459d90
- 0x1737:0x1032:*:0x0015: Linksys EG1032 v2
459d90
- 0x1737:0x1064: Linksys EG1064 v2
459d90
459d90
459d90
%prep
Kmods SIG 6638e4
%autosetup -p1 -n %{pkg}-%{driver_version}
459d90
459d90
459d90
%build
459d90
pushd src
459d90
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
459d90
popd
459d90
459d90
459d90
%install
459d90
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/marvell src/%{pkg}.ko
459d90
459d90
# Make .ko objects temporarily executable for automatic stripping
459d90
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
459d90
459d90
459d90
%clean
459d90
%{__rm} -rf %{buildroot}
459d90
459d90
459d90
%post
459d90
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
b46994
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/marvell/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
459d90
459d90
459d90
%preun
459d90
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
b46994
rpm -ql kmod-%{pkg}-%{?epoch:%{epoch}:}%{version}-%{release}.%{_arch} | grep '/lib/modules/%{kernel_version}.%{_arch}/.*\.ko\.xz$' >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
459d90
459d90
459d90
%postun
b46994
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
459d90
then
b46994
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
b46994
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
459d90
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
b46994
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
459d90
fi
459d90
459d90
b46994
%pretrans -p <lua>
b46994
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
b46994
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
b46994
b46994
459d90
%posttrans
b46994
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
459d90
then
b46994
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
b46994
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
459d90
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
b46994
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
459d90
fi
459d90
459d90
459d90
%files
459d90
%defattr(644,root,root,755)
459d90
/lib/modules/%{kernel_version}.%{_arch}
dab3dd
%license LICENSES
459d90
459d90
459d90
%changelog
Kmods SIG 6d774e
* Tue May 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.372.9.1-1
Kmods SIG 6d774e
- Update to 4.18.0-372.9.1.el8
Kmods SIG 6d774e
fb9514
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.240-3
fb9514
- Add obsoletes for update path
fb9514
3cc0c9
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.240-2
3cc0c9
- Enable ppc64le
3cc0c9
Kmods SIG 6638e4
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.240-1
Kmods SIG 6638e4
- Switch to EL kernel source and versioning
Kmods SIG 6638e4
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)