Blame SPECS/kmod-qla2xxx.spec

a2ca9b
%global pkg qla2xxx
a2ca9b
73ad01
%global driver_version 4.18.0-331.el8
a2ca9b
9717d5
%global kernel_version 4.18.0-338.el8
a2ca9b
a2ca9b
%global _use_internal_dependency_generator 0
5fe154
%global __find_requires %{nil}
22c21e
%global __find_provides /usr/lib/rpm/find-provides
a2ca9b
a2ca9b
%global debug_package %{nil}
a2ca9b
a2ca9b
%global __spec_install_post \
a2ca9b
  %{?__debug_package:%{__debug_install_post}} \
a2ca9b
  %{__arch_install_post} \
a2ca9b
  %{__os_install_post} \
a2ca9b
  %{__mod_compress_install_post}
a2ca9b
a2ca9b
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
a2ca9b
a2ca9b
a2ca9b
Name:             kmod-%{pkg}
a2ca9b
Version:          4.18.0
9717d5
Release:          338%{?dist}
a2ca9b
Summary:          QLogic Fibre Channel HBA (%{pkg}) driver
a2ca9b
a2ca9b
License:          GPLv2
a2ca9b
URL:              https://www.kernel.org/
a2ca9b
73ad01
Source0:          %{pkg}-%{driver_version}.tar.xz
a2ca9b
Patch1:           0001-add-deprecated-ids.patch
a2ca9b
a2ca9b
ExclusiveArch:    x86_64 aarch64
a2ca9b
a2ca9b
BuildRequires:    elfutils-libelf-devel
a2ca9b
BuildRequires:    gcc
a2ca9b
BuildRequires:    kmod
a2ca9b
BuildRequires:    make
a2ca9b
BuildRequires:    redhat-rpm-config
a2ca9b
BuildRequires:    xz
a2ca9b
a2ca9b
BuildRequires:    kernel-devel = %{kernel_version}
d9abaf
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
a2ca9b
5afae5
Requires:         kernel-core = %{kernel_version}
d9abaf
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
ce1db7
Requires:         kernel-modules = %{kernel_version}
d9abaf
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
a2ca9b
ee666f
Provides:         installonlypkg(kernel-module)
bee0f3
Provides:         kernel-modules = %{kernel_version}
eec2e8
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
a2ca9b
a2ca9b
Requires(post):   /usr/sbin/depmod
a2ca9b
Requires(postun): /usr/sbin/depmod
a2ca9b
0a6a21
Requires(post):   /usr/bin/dracut
0a6a21
Requires(postun): /usr/bin/dracut
0a6a21
a2ca9b
a2ca9b
%description
a2ca9b
This package provides the QLogic Fibre Channel HBA (%{pkg}) driver. Compared to
a2ca9b
the in-kernel driver this driver re-enables support for deprecated adapters:
a2ca9b
a2ca9b
- 0x1077:0x2100: QLogic ISP2100
a2ca9b
- 0x1077:0x2200: QLogic ISP2200
a2ca9b
- 0x1077:0x2300: QLogic ISP2300
a2ca9b
- 0x1077:0x2312: QLogic ISP2312
a2ca9b
- 0x1077:0x2322: QLogic ISP2322
a2ca9b
- 0x1077:0x2422: QLogic ISP2422
a2ca9b
- 0x1077:0x2432: QLogic ISP2432
a2ca9b
- 0x1077:0x5422: QLogic ISP5422
a2ca9b
- 0x1077:0x5432: QLogic ISP5432 / QLE220
a2ca9b
- 0x1077:0x6312: QLogic ISP6312
a2ca9b
- 0x1077:0x6322: QLogic ISP6322
a2ca9b
- 0x1077:0x8001: QLogic ISP8001 / QLE81xx
a2ca9b
- 0x1077:0x8021: QLogic ISP8021 / QLE82xx
a2ca9b
- 0x1077:0x8044: QLogic ISP8044 / QLE84xx
a2ca9b
- 0x1077:0x8432: QLogic ISP8432 / QLE8000
a2ca9b
- 0x1077:0xF001: QLogic ISPF001 / QLE10000
a2ca9b
a2ca9b
a2ca9b
%prep
73ad01
%autosetup -p1 -n %{pkg}-%{driver_version}
a2ca9b
a2ca9b
a2ca9b
%build
a2ca9b
pushd src
a2ca9b
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
a2ca9b
popd
a2ca9b
a2ca9b
a2ca9b
%install
a2ca9b
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
a2ca9b
a2ca9b
# Make .ko objects temporarily executable for automatic stripping
a2ca9b
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
a2ca9b
a2ca9b
a2ca9b
%clean
a2ca9b
%{__rm} -rf %{buildroot}
a2ca9b
a2ca9b
a2ca9b
%post
66b402
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
66b402
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
66b402
66b402
66b402
%preun
66b402
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
66b402
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
a2ca9b
a2ca9b
a2ca9b
%postun
66b402
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
66b402
then
66b402
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
66b402
    then
66b402
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
66b402
    fi
66b402
0a6a21
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
0a6a21
    then
0a6a21
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
0a6a21
        then
0a6a21
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
0a6a21
            then
0a6a21
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
0a6a21
            else
0a6a21
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
0a6a21
            fi
0a6a21
        fi
0a6a21
    fi
0a6a21
66b402
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
66b402
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
66b402
fi
66b402
66b402
66b402
%posttrans
66b402
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
66b402
then
66b402
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
66b402
    then
66b402
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
66b402
    fi
66b402
0a6a21
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
0a6a21
    then
0a6a21
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
0a6a21
        then
0a6a21
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
0a6a21
            then
0a6a21
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
0a6a21
            else
0a6a21
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
0a6a21
            fi
0a6a21
        fi
0a6a21
    fi
0a6a21
66b402
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
66b402
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
66b402
fi
a2ca9b
a2ca9b
a2ca9b
%files
a2ca9b
%defattr(644,root,root,755)
a2ca9b
/lib/modules/%{kernel_version}.%{_arch}
a2ca9b
%license COPYING
a2ca9b
a2ca9b
a2ca9b
%changelog
9717d5
* Mon Aug 30 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-338
9717d5
- Set specific kernel version to use
9717d5
- Rename kernel_version_min to driver_version
9717d5
- Add Provides kernel-modules
9717d5
- Rebuild for 4.18.0-338.el8
9717d5
eee71f
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-331
eee71f
- Update to 4.18.0-331.el8
eee71f
003ce7
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
921504
- Rebuild for 4.18.0-326.el8
003ce7
- Fix provides/requires
003ce7
- Fix kernel dependencies
003ce7
- Add convenient provides kmod-aacraid-`uname -r`
003ce7
- Fix installonlypkg detection
003ce7
- Recreate source tarballs
003ce7
- Rebuild for dist = .el8s
003ce7
003ce7
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-315
a2ca9b
- Initial version