Blame SPECS/kmod-e100.spec

Kmods SIG 25e717
%global pkg e100
Kmods SIG 25e717
Kmods SIG 25e717
%global driver_version 4.18.0-221.el8
Kmods SIG 25e717
Kmods SIG 25e717
%global kernel_version 4.18.0-348.el8
Kmods SIG 25e717
Kmods SIG 25e717
%global _use_internal_dependency_generator 0
Kmods SIG 25e717
%global __find_requires /usr/lib/rpm/redhat/find-requires
Kmods SIG 25e717
%global __find_provides /usr/lib/rpm/redhat/find-provides
Kmods SIG 25e717
Kmods SIG 25e717
%global debug_package %{nil}
Kmods SIG 25e717
Kmods SIG 25e717
%global __spec_install_post \
Kmods SIG 25e717
  %{?__debug_package:%{__debug_install_post}} \
Kmods SIG 25e717
  %{__arch_install_post} \
Kmods SIG 25e717
  %{__os_install_post} \
Kmods SIG 25e717
  %{__mod_compress_install_post}
Kmods SIG 25e717
Kmods SIG 25e717
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
Name:             kmod-%{pkg}
Kmods SIG 25e717
Version:          4.18.0.221
500ce7
Release:          3%{?dist}
Kmods SIG 25e717
Summary:          Intel(R) PRO/100 Ethernet (%{pkg}) driver
Kmods SIG 25e717
Kmods SIG 25e717
License:          GPLv2
Kmods SIG 25e717
URL:              https://www.kernel.org/
Kmods SIG 25e717
Kmods SIG 25e717
Source0:          %{pkg}-%{driver_version}.tar.xz
Kmods SIG 25e717
Patch1:           0001-e100-fix-length-calculation-in-e100_get_regs_len.patch
Kmods SIG 25e717
Patch2:           0002-e100-fix-buffer-overrun-in-e100_get_regs.patch
Kmods SIG 25e717
a9b4d8
ExclusiveArch:    x86_64 aarch64 ppc64le
Kmods SIG 25e717
Kmods SIG 25e717
BuildRequires:    elfutils-libelf-devel
Kmods SIG 25e717
BuildRequires:    gcc
Kmods SIG 25e717
BuildRequires:    kernel-rpm-macros
Kmods SIG 25e717
BuildRequires:    kmod
Kmods SIG 25e717
BuildRequires:    make
Kmods SIG 25e717
BuildRequires:    redhat-rpm-config
Kmods SIG 25e717
BuildRequires:    xz
Kmods SIG 25e717
Kmods SIG 25e717
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
Kmods SIG 25e717
BuildRequires:    kernel-devel = %{kernel_version}
Kmods SIG 25e717
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
Kmods SIG 25e717
Kmods SIG 25e717
Requires:         kernel >= %{kernel_version}
Kmods SIG 25e717
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
Kmods SIG 25e717
Requires:         kernel-modules >= %{kernel_version}
Kmods SIG 25e717
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
Kmods SIG 25e717
Kmods SIG 25e717
Provides:         installonlypkg(kernel-module)
Kmods SIG 25e717
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
Kmods SIG 25e717
Kmods SIG 25e717
Requires(post):   %{_sbindir}/depmod
Kmods SIG 25e717
Requires(postun): %{_sbindir}/depmod
Kmods SIG 25e717
Kmods SIG 25e717
Requires(post):   %{_sbindir}/weak-modules
Kmods SIG 25e717
Requires(postun): %{_sbindir}/weak-modules
Kmods SIG 25e717
Kmods SIG 25e717
500ce7
%if "%{version}" == "4.18.0.221" && "%{release}" == "2%{?dist}"
500ce7
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
500ce7
%endif
500ce7
500ce7
%if "%{version}" == "4.18.0.221" && "%{release}" == "3%{?dist}"
500ce7
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
500ce7
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
500ce7
%endif
500ce7
500ce7
Kmods SIG 25e717
%description
Kmods SIG 25e717
This driver supports the Intel(R) PRO/100 family of adapters.
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%prep
Kmods SIG 25e717
%autosetup -p1 -n %{pkg}-%{driver_version}
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%build
Kmods SIG 25e717
pushd src
Kmods SIG 25e717
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
Kmods SIG 25e717
popd
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%install
Kmods SIG 25e717
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/intel src/%{pkg}.ko
Kmods SIG 25e717
Kmods SIG 25e717
# Make .ko objects temporarily executable for automatic stripping
Kmods SIG 25e717
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%clean
Kmods SIG 25e717
%{__rm} -rf %{buildroot}
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%post
Kmods SIG 25e717
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
Kmods SIG 25e717
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/intel/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%preun
Kmods SIG 25e717
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
Kmods SIG 25e717
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
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%postun
Kmods SIG 25e717
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
Kmods SIG 25e717
then
Kmods SIG 25e717
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
Kmods SIG 25e717
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
Kmods SIG 25e717
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
Kmods SIG 25e717
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
Kmods SIG 25e717
fi
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%pretrans -p <lua>
Kmods SIG 25e717
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
Kmods SIG 25e717
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%posttrans
Kmods SIG 25e717
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
Kmods SIG 25e717
then
Kmods SIG 25e717
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
Kmods SIG 25e717
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
Kmods SIG 25e717
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
Kmods SIG 25e717
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
Kmods SIG 25e717
fi
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%files
Kmods SIG 25e717
%defattr(644,root,root,755)
Kmods SIG 25e717
/lib/modules/%{kernel_version}.%{_arch}
c381f0
%license LICENSES
Kmods SIG 25e717
Kmods SIG 25e717
Kmods SIG 25e717
%changelog
500ce7
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.221-3
500ce7
- Add obsoletes for update path
500ce7
a9b4d8
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.221-2
a9b4d8
- Enable aarch64 and ppc64le
a9b4d8
Kmods SIG 25e717
* Tue Jan 18 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.221-1
Kmods SIG 25e717
- Use EL kernel source and versioning
Kmods SIG 25e717
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)