Blame SPECS/kmod-be2iscsi.spec

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