Blame SPECS/kmod-be2iscsi.spec

19d00e
%global pkg be2iscsi
19d00e
19d00e
%global driver_version 5.14.0-1.el9
19d00e
43a1a8
%global kernel_version 5.14.0-4.el9
19d00e
19d00e
%global _use_internal_dependency_generator 0
19d00e
%global __find_requires %{nil}
19d00e
%global __find_provides /usr/lib/rpm/find-provides
19d00e
19d00e
%global debug_package %{nil}
19d00e
19d00e
%global __spec_install_post \
19d00e
  %{?__debug_package:%{__debug_install_post}} \
19d00e
  %{__arch_install_post} \
19d00e
  %{__os_install_post} \
19d00e
  %{__mod_compress_install_post}
19d00e
19d00e
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
19d00e
19d00e
19d00e
Name:             kmod-%{pkg}
19d00e
Version:          5.14.0
43a1a8
Release:          4%{?dist}
19d00e
Summary:          Emulex OneConnectOpen-iSCSI (%{pkg}) driver
19d00e
19d00e
License:          GPLv2
19d00e
URL:              https://www.kernel.org/
19d00e
19d00e
Source0:          %{pkg}-%{driver_version}.tar.xz
19d00e
Patch1:           0001-add-deprecated-ids.patch
19d00e
19d00e
ExclusiveArch:    x86_64 aarch64
19d00e
19d00e
BuildRequires:    elfutils-libelf-devel
19d00e
BuildRequires:    gcc
19d00e
BuildRequires:    kmod
19d00e
BuildRequires:    make
19d00e
BuildRequires:    redhat-rpm-config
19d00e
BuildRequires:    xz
19d00e
19d00e
BuildRequires:    kernel-devel = %{kernel_version}
19d00e
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
19d00e
19d00e
Requires:         kernel-core = %{kernel_version}
19d00e
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
19d00e
Requires:         kernel-modules = %{kernel_version}
19d00e
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
19d00e
19d00e
Provides:         installonlypkg(kernel-module)
19d00e
Provides:         kernel-modules = %{kernel_version}.%{_arch}
19d00e
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
19d00e
19d00e
Requires(post):   /usr/sbin/depmod
19d00e
Requires(postun): /usr/sbin/depmod
19d00e
19d00e
Requires(post):   /usr/bin/dracut
19d00e
Requires(postun): /usr/bin/dracut
19d00e
19d00e
19d00e
%description
19d00e
This package provides the Emulex OneConnectOpen-iSCSI (%{pkg}) driver. Compared
19d00e
to the in-kernel driver this driver re-enables support for deprecated
19d00e
BladeEngine 2 and 3 adapters.
19d00e
19d00e
BladeEngine 2 (BE2) devices:
19d00e
- 0x19A2:0x0212: Emulex BladeEngine 2 10Gb iSCSI Initiator
19d00e
- 0x19A2:0x0702: Emulex OneConnect OCe10101/OCm10101/OCe10102/OCm10102
19d00e
- 0x19A2:0x0703: Emulex OneConnect OCe10100
19d00e
19d00e
BladeEngine 3 (BE3) devices:
19d00e
- 0x19A2:0x0222: Emulex BladeEngine 3 iSCSI
19d00e
- 0x19A2:0x0712: Emulex OneConnect Tomcat iSCSI
19d00e
19d00e
19d00e
%prep
19d00e
%autosetup -p1 -n %{pkg}-%{driver_version}
19d00e
19d00e
19d00e
%build
19d00e
pushd src
19d00e
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
19d00e
popd
19d00e
19d00e
19d00e
%install
19d00e
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
19d00e
19d00e
# Make .ko objects temporarily executable for automatic stripping
19d00e
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
19d00e
19d00e
19d00e
%clean
19d00e
%{__rm} -rf %{buildroot}
19d00e
19d00e
19d00e
%post
19d00e
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
19d00e
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
19d00e
19d00e
19d00e
%preun
19d00e
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
19d00e
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
19d00e
19d00e
19d00e
%postun
19d00e
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
19d00e
then
19d00e
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
19d00e
    then
19d00e
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
19d00e
    fi
19d00e
19d00e
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
19d00e
    then
19d00e
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
19d00e
        then
19d00e
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
19d00e
            then
19d00e
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
19d00e
            else
19d00e
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
19d00e
            fi
19d00e
        fi
19d00e
    fi
19d00e
19d00e
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
19d00e
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
19d00e
fi
19d00e
19d00e
19d00e
%posttrans
19d00e
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
19d00e
then
19d00e
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
19d00e
    then
19d00e
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
19d00e
    fi
19d00e
19d00e
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
19d00e
    then
19d00e
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
19d00e
        then
19d00e
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
19d00e
            then
19d00e
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
19d00e
            else
19d00e
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
19d00e
            fi
19d00e
        fi
19d00e
    fi
19d00e
19d00e
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
19d00e
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
19d00e
fi
19d00e
19d00e
19d00e
%files
19d00e
%defattr(644,root,root,755)
19d00e
/lib/modules/%{kernel_version}.%{_arch}
19d00e
%license COPYING
19d00e
19d00e
19d00e
%changelog
43a1a8
* Thu Sep 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-4
43a1a8
- Rebuild for 5.14.0-4.el9
43a1a8
b967d2
* Sun Sep 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-3
b967d2
- Rebuild for 5.14.0-3.el9
b967d2
5c51c6
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-2
5c51c6
- Rebuild for 5.14.0-2.el9
5c51c6
19d00e
* Tue Aug 31 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-1
19d00e
- Initial version