Blame SPECS/kmod-qla4xxx.spec

35007b
%global pkg qla4xxx
35007b
35007b
%global kernel_version_min 4.18.0-147.el8
35007b
c94f17
%global kernel_version 4.18.0-305.12.1.el8_4
35007b
35007b
%global _use_internal_dependency_generator 0
35007b
%global __find_requires %{nil}
35007b
%global __find_provides /usr/lib/rpm/find-provides
35007b
35007b
%global debug_package %{nil}
35007b
35007b
%global __spec_install_post \
35007b
  %{?__debug_package:%{__debug_install_post}} \
35007b
  %{__arch_install_post} \
35007b
  %{__os_install_post} \
35007b
  %{__mod_compress_install_post}
35007b
35007b
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
35007b
35007b
35007b
Name:             kmod-%{pkg}
35007b
Version:          4.18.0
bc3d02
Release:          305.12.1%{?dist}
35007b
Summary:          QLogic iSCSI HBA (%{pkg}) driver
35007b
35007b
License:          GPLv2
35007b
URL:              https://www.kernel.org/
35007b
35007b
Source0:          %{pkg}-%{kernel_version_min}.tar.xz
35007b
Patch1:           0001-add-deprecated-ids.patch
35007b
35007b
ExclusiveArch:    x86_64 aarch64
35007b
35007b
BuildRequires:    elfutils-libelf-devel
35007b
BuildRequires:    gcc
35007b
BuildRequires:    kmod
35007b
BuildRequires:    make
35007b
BuildRequires:    redhat-rpm-config
35007b
BuildRequires:    xz
35007b
35007b
BuildRequires:    kernel-devel = %{kernel_version}
35007b
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
35007b
35007b
Requires:         kernel-core = %{kernel_version}
35007b
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
35007b
Requires:         kernel-modules = %{kernel_version}
35007b
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
35007b
35007b
Provides:         installonlypkg(kernel-module)
35007b
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
35007b
35007b
Requires(post):   /usr/sbin/depmod
35007b
Requires(postun): /usr/sbin/depmod
35007b
35007b
Requires(post):   /usr/bin/dracut
35007b
Requires(postun): /usr/bin/dracut
35007b
35007b
35007b
%description
35007b
This package provides the QLogic iSCSI HBA (%{pkg}) driver. Compared to the
35007b
in-kernel driver this driver re-enables support for deprecated adapters:
35007b
35007b
- 0x1077:0x8022: QLogic ISP8022
35007b
- 0x1077:0x8032: QLogic ISP8324
35007b
- 0x1077:0x8042: QLogic ISP8042
35007b
35007b
35007b
%prep
35007b
%autosetup -p1 -n %{pkg}-%{kernel_version_min}
35007b
35007b
35007b
%build
35007b
pushd src
35007b
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
35007b
popd
35007b
35007b
35007b
%install
35007b
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
35007b
35007b
# Make .ko objects temporarily executable for automatic stripping
35007b
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
35007b
35007b
35007b
%clean
35007b
%{__rm} -rf %{buildroot}
35007b
35007b
35007b
%post
35007b
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
35007b
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
35007b
35007b
35007b
%preun
35007b
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
35007b
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
35007b
35007b
35007b
%postun
35007b
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
35007b
then
35007b
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
35007b
    then
35007b
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
35007b
    fi
35007b
35007b
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
35007b
    then
35007b
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
35007b
        then
35007b
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
35007b
            then
35007b
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
35007b
            else
35007b
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
35007b
            fi
35007b
        fi
35007b
    fi
35007b
35007b
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
35007b
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
35007b
fi
35007b
35007b
35007b
%posttrans
35007b
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
35007b
then
35007b
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
35007b
    then
35007b
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
35007b
    fi
35007b
35007b
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
35007b
    then
35007b
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
35007b
        then
35007b
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
35007b
            then
35007b
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
35007b
            else
35007b
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
35007b
            fi
35007b
        fi
35007b
    fi
35007b
35007b
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
35007b
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
35007b
fi
35007b
35007b
35007b
%files
35007b
%defattr(644,root,root,755)
35007b
/lib/modules/%{kernel_version}.%{_arch}
35007b
%license COPYING
35007b
35007b
35007b
%changelog
bc3d02
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.12.1
bc3d02
- Rebuild for 4.18.0-305.12.1.el8_4
bc3d02
35007b
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305
35007b
- Initial version