Blame SPECS/kmod-skge.spec

9e111f
%global pkg skge
9e111f
9e111f
%global kernel_version_min 4.18.0-240.el8
9e111f
9e111f
# To pick a specific kernel use `--define "kernel_version 4.18.0-315.el8"`
9e111f
# Otherwise the latest installed kernel-devel version later than
9e111f
# %%{kernel_version_min} will be used.
9e111f
9e111f
%global kernel_version_latest %({ echo %{kernel_version_min}; rpm --query kernel-devel --queryformat '%%{VERSION}-%%{RELEASE}\\\n' | grep -v "package kernel-devel is not installed"; } | sort -V | sed -e '0,/^%{kernel_version_min}$/d' | tail -n 1)
9e111f
9e111f
%if "%{kernel_version_latest}" != ""
9e111f
%{!?kernel_version:%{expand:%%global kernel_version %{kernel_version_latest}}}
9e111f
%endif
9e111f
9e111f
%global _use_internal_dependency_generator 0
f5ceb8
%global __find_requires %{nil}
816715
%global __find_provides /usr/lib/rpm/find-provides
9e111f
9e111f
%global debug_package %{nil}
9e111f
9e111f
%global __spec_install_post \
9e111f
  %{?__debug_package:%{__debug_install_post}} \
9e111f
  %{__arch_install_post} \
9e111f
  %{__os_install_post} \
9e111f
  %{__mod_compress_install_post}
9e111f
9e111f
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
9e111f
9e111f
9e111f
Name:             kmod-%{pkg}
9e111f
Version:          5.7
07cc35
Release:          2%{?dist}
9e111f
Summary:          SysKonnect/Marvell Yukon Gigabit Ethernet (%{pkg}) driver
9e111f
9e111f
License:          GPLv2
9e111f
URL:              https://www.kernel.org/
9e111f
9e111f
Source0:          %{pkg}-%{version}.tar.xz
9e111f
9e111f
ExclusiveArch:    x86_64 aarch64
9e111f
9e111f
BuildRequires:    elfutils-libelf-devel
9e111f
BuildRequires:    gcc
9e111f
BuildRequires:    kmod
9e111f
BuildRequires:    make
9e111f
BuildRequires:    redhat-rpm-config
9e111f
BuildRequires:    xz
9e111f
9e111f
%{!?kernel_version:
9e111f
BuildRequires:    kernel-devel >= %{kernel_version_min}
9e111f
}
9e111f
9e111f
%{?kernel_version:
9e111f
BuildRequires:    kernel-devel = %{kernel_version}
9e111f
65e3ee
Requires:         kernel-core = %{kernel_version}
9e953a
Requires:         kernel-modules = %{kernel_version}
9e111f
9e111f
Provides:         kernel-modules = %{kernel_version}.%{_arch}
9e111f
}
9e111f
9e111f
Requires(post):   /usr/sbin/depmod
9e111f
Requires(postun): /usr/sbin/depmod
9e111f
9e111f
9e111f
%description
9e111f
This driver supports Gigabit Ethernet adapters based on the Marvell Yukon
9e111f
chipset:
9e111f
9e111f
- 0x10B7:0x1700: 3Com 3C940
9e111f
- 0x10B7:0x80EB: 3Com 3C940B
9e111f
- 0x1148:0x4300: SysKonnect SK-9xx
9e111f
- 0x1148:0x4320: SysKonnect SK-98xx V2.0
9e111f
- 0x1186:0x4302: D-Link DGE-530T Rev C1
9e111f
- 0x1186:0x4B01: D-Link DGE-530T Rev B
9e111f
- 0x1186:0x4C00: D-Link DGE-530T
9e111f
- 0x11AB:0x4320: Marvell Yukon 88E8001/8003/8010
9e111f
- 0x11AB:0x5005: Belkin
9e111f
- 0x1371:0x434E: CNet PowerG-2000
9e111f
- 0x1737:0x1032:*:0x0015: Linksys EG1032 v2
9e111f
- 0x1737:0x1064: Linksys EG1064 v2
9e111f
9e111f
9e111f
%prep
9e111f
%autosetup -p1 -n %{pkg}-%{version}
9e111f
9e111f
9e111f
%build
9e111f
pushd src
9e111f
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
9e111f
popd
9e111f
9e111f
9e111f
%install
9e111f
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/marvell src/%{pkg}.ko
9e111f
9e111f
# Make .ko objects temporarily executable for automatic stripping
9e111f
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
9e111f
9e111f
9e111f
%clean
9e111f
%{__rm} -rf %{buildroot}
9e111f
9e111f
9e111f
%post
3ee8b1
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
3ee8b1
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
3ee8b1
3ee8b1
3ee8b1
%preun
3ee8b1
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
3ee8b1
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
9e111f
9e111f
9e111f
%postun
3ee8b1
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
3ee8b1
then
3ee8b1
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
3ee8b1
    then
3ee8b1
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
3ee8b1
    fi
3ee8b1
3ee8b1
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
3ee8b1
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
3ee8b1
fi
3ee8b1
3ee8b1
3ee8b1
%posttrans
3ee8b1
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
3ee8b1
then
3ee8b1
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
3ee8b1
    then
3ee8b1
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
3ee8b1
    fi
3ee8b1
3ee8b1
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
3ee8b1
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
3ee8b1
fi
9e111f
9e111f
9e111f
%files
9e111f
%defattr(644,root,root,755)
9e111f
/lib/modules/%{kernel_version}.%{_arch}
9e111f
%license COPYING
9e111f
9e111f
9e111f
%changelog
07cc35
* Thu Jul 29 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.7-2
07cc35
- Rebuild for 4.18.0-326.el8
07cc35
9e111f
* Thu Jul 22 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.7-1
9e111f
- Initial version