Blame SPECS/kmod-sky2.spec

8d225d
%global pkg sky2
8d225d
3c17cd
%global kernel_version 4.18.0-348.el8
8d225d
8d225d
%global _use_internal_dependency_generator 0
07d42d
%global __find_requires /usr/lib/rpm/redhat/find-requires
07d42d
%global __find_provides /usr/lib/rpm/redhat/find-provides
8d225d
8d225d
%global debug_package %{nil}
8d225d
8d225d
%global __spec_install_post \
8d225d
  %{?__debug_package:%{__debug_install_post}} \
8d225d
  %{__arch_install_post} \
8d225d
  %{__os_install_post} \
8d225d
  %{__mod_compress_install_post}
8d225d
8d225d
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
8d225d
8d225d
8d225d
Name:             kmod-%{pkg}
8d225d
Version:          5.8
3c17cd
Release:          7%{?dist}
8d225d
Summary:          Marvell Yukon 2 Gigabit Ethernet (%{pkg}) driver
8d225d
8d225d
License:          GPLv2
8d225d
URL:              https://www.kernel.org/
8d225d
8d225d
Source0:          %{pkg}-%{version}.tar.xz
8d225d
8d225d
ExclusiveArch:    x86_64 aarch64
8d225d
8d225d
BuildRequires:    elfutils-libelf-devel
8d225d
BuildRequires:    gcc
07d42d
BuildRequires:    kernel-rpm-macros
8d225d
BuildRequires:    kmod
8d225d
BuildRequires:    make
8d225d
BuildRequires:    redhat-rpm-config
8d225d
BuildRequires:    xz
8d225d
07d42d
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
8d225d
BuildRequires:    kernel-devel = %{kernel_version}
8d225d
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
8d225d
07d42d
Requires:         kernel >= %{kernel_version}
07d42d
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
07d42d
Requires:         kernel-modules >= %{kernel_version}
07d42d
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
8d225d
8d225d
Provides:         installonlypkg(kernel-module)
07d42d
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
8d225d
07d42d
Requires(post):   %{_sbindir}/depmod
07d42d
Requires(postun): %{_sbindir}/depmod
8d225d
07d42d
Requires(post):   %{_sbindir}/weak-modules
07d42d
Requires(postun): %{_sbindir}/weak-modules
8d225d
8d225d
8d225d
%description
8d225d
This driver supports Gigabit Ethernet adapters based on the Marvell Yukon 2
8d225d
chipset:
8d225d
8d225d
- 0x1148:0x9000: SysKonnect SK-9Sxx
8d225d
- 0x1148:0x9E00: SysKonnect SK-9Exx
8d225d
- 0x1148:0x9E01: SysKonnect SK-9E21M
8d225d
- 0x1186:0x4001: D-Link DGE-550SX
8d225d
- 0x1186:0x4B00: D-Link DGE-560T
8d225d
- 0x1186:0x4B02: D-Link DGE-560SX
8d225d
- 0x1186:0x4B03: D-Link DGE-550T
8d225d
- 0x11AB:0x4340: Marvell 88E8021
8d225d
- 0x11AB:0x4341: Marvell 88E8022
8d225d
- 0x11AB:0x4342: Marvell 88E8061
8d225d
- 0x11AB:0x4343: Marvell 88E8062
8d225d
- 0x11AB:0x4344: Marvell 88E8021
8d225d
- 0x11AB:0x4345: Marvell 88E8022
8d225d
- 0x11AB:0x4346: Marvell 88E8061
8d225d
- 0x11AB:0x4347: Marvell 88E8062
8d225d
- 0x11AB:0x4350: Marvell 88E8035
8d225d
- 0x11AB:0x4351: Marvell 88E8036
8d225d
- 0x11AB:0x4352: Marvell 88E8038
8d225d
- 0x11AB:0x4353: Marvell 88E8039
8d225d
- 0x11AB:0x4354: Marvell 88E8040
8d225d
- 0x11AB:0x4355: Marvell 88E8040T
8d225d
- 0x11AB:0x4356: Marvell 88EC033
8d225d
- 0x11AB:0x4357: Marvell 88E8042
8d225d
- 0x11AB:0x435A: Marvell 88E8048
8d225d
- 0x11AB:0x4360: Marvell 88E8052
8d225d
- 0x11AB:0x4361: Marvell 88E8050
8d225d
- 0x11AB:0x4362: Marvell 88E8053
8d225d
- 0x11AB:0x4363: Marvell 88E8055
8d225d
- 0x11AB:0x4364: Marvell 88E8056
8d225d
- 0x11AB:0x4365: Marvell 88E8070
8d225d
- 0x11AB:0x4366: Marvell 88EC036
8d225d
- 0x11AB:0x4367: Marvell 88EC032
8d225d
- 0x11AB:0x4368: Marvell 88EC034
8d225d
- 0x11AB:0x4369: Marvell 88EC042
8d225d
- 0x11AB:0x436A: Marvell 88E8058
8d225d
- 0x11AB:0x436B: Marvell 88E8071
8d225d
- 0x11AB:0x436C: Marvell 88E8072
8d225d
- 0x11AB:0x436D: Marvell 88E8055
8d225d
- 0x11AB:0x4370: Marvell 88E8075
8d225d
- 0x11AB:0x4380: Marvell 88E8057
8d225d
- 0x11AB:0x4381: Marvell 88E8059
8d225d
- 0x11AB:0x4382: Marvell 88E8079
8d225d
8d225d
8d225d
%prep
8d225d
%autosetup -p1 -n %{pkg}-%{version}
8d225d
8d225d
8d225d
%build
8d225d
pushd src
8d225d
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
8d225d
popd
8d225d
8d225d
8d225d
%install
8d225d
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/marvell src/%{pkg}.ko
8d225d
8d225d
# Make .ko objects temporarily executable for automatic stripping
8d225d
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
8d225d
8d225d
8d225d
%clean
8d225d
%{__rm} -rf %{buildroot}
8d225d
8d225d
8d225d
%post
8d225d
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
07d42d
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
8d225d
8d225d
8d225d
%preun
8d225d
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
07d42d
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
8d225d
8d225d
8d225d
%postun
07d42d
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
8d225d
then
07d42d
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
07d42d
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
8d225d
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
07d42d
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
8d225d
fi
8d225d
8d225d
07d42d
%pretrans -p <lua>
07d42d
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
07d42d
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
07d42d
07d42d
8d225d
%posttrans
07d42d
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
8d225d
then
07d42d
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
07d42d
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
8d225d
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
07d42d
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
8d225d
fi
8d225d
8d225d
8d225d
%files
8d225d
%defattr(644,root,root,755)
8d225d
/lib/modules/%{kernel_version}.%{_arch}
8d225d
%license COPYING
8d225d
8d225d
8d225d
%changelog
3c17cd
* Tue Nov 09 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.8-7
3c17cd
- Rebuild for 4.18.0-348.el8
3c17cd
07d42d
* Tue Sep 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.8-6
07d42d
- Convert to kABI tracking kmod package (kernel >= 4.18.0-305.7.1.el8_4)