Blame SPECS/kmod-qla4xxx.spec

35007b
%global pkg qla4xxx
35007b
5b6c8b
%global driver_version 4.18.0-147.el8
35007b
8ebf43
%global kernel_version 4.18.0-305.19.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
8ebf43
Release:          305.19.1%{?dist}
35007b
Summary:          QLogic iSCSI HBA (%{pkg}) driver
35007b
35007b
License:          GPLv2
35007b
URL:              https://www.kernel.org/
35007b
5b6c8b
Source0:          %{pkg}-%{driver_version}.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)
3b24b0
Provides:         kernel-modules = %{kernel_version}.%{_arch}
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
5b6c8b
%autosetup -p1 -n %{pkg}-%{driver_version}
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
8ebf43
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.19.1
8ebf43
- Rebuild for 4.18.0-305.19.1.el8_4
8ebf43
8ef103
* Thu Sep  9 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.17.1
8ef103
- Set specific kernel version to use
8ef103
- Rename kernel_version_min to driver_version
8ef103
- Add Provides kernel-modules
8ef103
- Add .%{_arch} to kernel-modules provides version
8ef103
- Rebuild for 4.18.0-305.17.1.el8_4
8ef103
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