Blame SPECS/kmod-be2net.spec

c1876c
%global pkg be2net
c1876c
a1b4d5
%global driver_version 4.18.0-240.el8
c1876c
d26036
%global kernel_version 4.18.0-305.19.1.el8_4
c1876c
c1876c
%global _use_internal_dependency_generator 0
c1876c
%global __find_requires %{nil}
c1876c
%global __find_provides /usr/lib/rpm/find-provides
c1876c
c1876c
%global debug_package %{nil}
c1876c
c1876c
%global __spec_install_post \
c1876c
  %{?__debug_package:%{__debug_install_post}} \
c1876c
  %{__arch_install_post} \
c1876c
  %{__os_install_post} \
c1876c
  %{__mod_compress_install_post}
c1876c
c1876c
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
c1876c
c1876c
c1876c
Name:             kmod-%{pkg}
c1876c
Version:          4.18.0
d26036
Release:          305.19.1%{?dist}
c1876c
Summary:          Emulex OneConnect NIC (%{pkg}) driver
c1876c
c1876c
License:          GPLv2
c1876c
URL:              https://www.kernel.org/
c1876c
a1b4d5
Source0:          %{pkg}-%{driver_version}.tar.xz
c1876c
Patch1:           0001-enable-be2-and-be3.patch
c1876c
c1876c
ExclusiveArch:    x86_64
c1876c
c1876c
BuildRequires:    elfutils-libelf-devel
c1876c
BuildRequires:    gcc
c1876c
BuildRequires:    kmod
c1876c
BuildRequires:    make
c1876c
BuildRequires:    redhat-rpm-config
c1876c
BuildRequires:    xz
c1876c
c1876c
BuildRequires:    kernel-devel = %{kernel_version}
c1876c
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
c1876c
c1876c
Requires:         kernel-core = %{kernel_version}
c1876c
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
c1876c
Requires:         kernel-modules = %{kernel_version}
c1876c
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
c1876c
c1876c
Provides:         installonlypkg(kernel-module)
a3254c
Provides:         kernel-modules = %{kernel_version}.%{_arch}
c1876c
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
c1876c
c1876c
Requires(post):   /usr/sbin/depmod
c1876c
Requires(postun): /usr/sbin/depmod
c1876c
c1876c
Requires(post):   /usr/bin/dracut
c1876c
Requires(postun): /usr/bin/dracut
c1876c
c1876c
c1876c
%description
c1876c
This package provides the %{pkg} driver. Compared to the in-kernel driver this
c1876c
driver re-enables support for deprecated BladeEngine 2 and 3 adapters.
c1876c
c1876c
BladeEngine 2 (BE2) devices:
c1876c
- 0x19A2:0x0211: Emulex BladeEngine 2 Network Adapter
c1876c
- 0x19A2:0x0700: Emulex OneConnect Tigershark NIC
c1876c
c1876c
BladeEngine 3 (BE3) devices:
c1876c
- 0x19A2:0x0221: Emulex BladeEngine3 Network Adapter
c1876c
- 0x19A2:0x0710: Emulex OneConnect Tomcat NIC
c1876c
c1876c
c1876c
%prep
a1b4d5
%autosetup -p1 -n %{pkg}-%{driver_version}
c1876c
c1876c
c1876c
%build
c1876c
pushd src
c1876c
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
c1876c
popd
c1876c
c1876c
c1876c
%install
c1876c
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/emulex/benet src/%{pkg}.ko
c1876c
c1876c
# Make .ko objects temporarily executable for automatic stripping
c1876c
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
c1876c
c1876c
c1876c
%clean
c1876c
%{__rm} -rf %{buildroot}
c1876c
c1876c
c1876c
%post
c1876c
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
c1876c
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
c1876c
c1876c
c1876c
%preun
c1876c
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
c1876c
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
c1876c
c1876c
c1876c
%postun
c1876c
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
c1876c
then
c1876c
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
c1876c
    then
c1876c
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
c1876c
    fi
c1876c
c1876c
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
c1876c
    then
c1876c
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
c1876c
        then
c1876c
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
c1876c
            then
c1876c
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
c1876c
            else
c1876c
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
c1876c
            fi
c1876c
        fi
c1876c
    fi
c1876c
c1876c
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
c1876c
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
c1876c
fi
c1876c
c1876c
c1876c
%posttrans
c1876c
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
c1876c
then
c1876c
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
c1876c
    then
c1876c
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
c1876c
    fi
c1876c
c1876c
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
c1876c
    then
c1876c
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
c1876c
        then
c1876c
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
c1876c
            then
c1876c
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
c1876c
            else
c1876c
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
c1876c
            fi
c1876c
        fi
c1876c
    fi
c1876c
c1876c
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
c1876c
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
c1876c
fi
c1876c
c1876c
c1876c
%files
c1876c
%defattr(644,root,root,755)
c1876c
/lib/modules/%{kernel_version}.%{_arch}
c1876c
%license COPYING
c1876c
c1876c
c1876c
%changelog
d26036
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.19.1
d26036
- Rebuild for 4.18.0-305.19.1.el8_4
d26036
13a90b
* Thu Sep  9 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.17.1
13a90b
- Set specific kernel version to use
13a90b
- Rename kernel_version_min to driver_version
13a90b
- Add Provides kernel-modules
13a90b
- Add .%{_arch} to kernel-modules provides version
13a90b
- Rebuild for 4.18.0-305.17.1.el8_4
13a90b
b86b2a
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.12.1
b86b2a
- Rebuild for 4.18.0-305.12.1.el8_4
b86b2a
c1876c
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305
c1876c
- Initial version