Blame SPECS/kmod-qla2xxx.spec

a2ca9b
%global pkg qla2xxx
a2ca9b
a2ca9b
%global kernel_version_min 4.18.0-315.el8
a2ca9b
a2ca9b
# To pick a specific kernel use `--define "kernel_version 4.18.0-315.el8"`
a2ca9b
# Otherwise the latest installed kernel-devel version later than
a2ca9b
# %%{kernel_version_min} will be used.
a2ca9b
a2ca9b
%global kernel_version_latest %({ echo %{kernel_version_min}; rpm --query kernel-devel --queryformat '%%{VERSION}-%%{RELEASE}\\\n' | grep -v "package kernel-devel is not installed"; } | sort -V | sed -e '0,/^%{kernel_version_min}$/d' | tail -n 1)
a2ca9b
a2ca9b
%if "%{kernel_version_latest}" != ""
a2ca9b
%{!?kernel_version:%{expand:%%global kernel_version %{kernel_version_latest}}}
a2ca9b
%endif
a2ca9b
a2ca9b
%global _use_internal_dependency_generator 0
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
921504
Release:          326%{?dist}
a2ca9b
Summary:          QLogic Fibre Channel HBA (%{pkg}) driver
a2ca9b
a2ca9b
License:          GPLv2
a2ca9b
URL:              https://www.kernel.org/
a2ca9b
a2ca9b
Source0:          %{pkg}-%{kernel_version_min}.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:    kernel-abi-whitelists
a2ca9b
BuildRequires:    kernel-rpm-macros
a2ca9b
BuildRequires:    kmod
a2ca9b
BuildRequires:    make
a2ca9b
BuildRequires:    redhat-rpm-config
a2ca9b
BuildRequires:    xz
a2ca9b
a2ca9b
%{!?kernel_version:
a2ca9b
BuildRequires:    kernel-devel >= %{kernel_version_min}
a2ca9b
}
a2ca9b
a2ca9b
%{?kernel_version:
a2ca9b
BuildRequires:    kernel-devel = %{kernel_version}
a2ca9b
a2ca9b
Supplements:      kernel = %{kernel_version}
a2ca9b
a2ca9b
Requires:         (kernel = %{kernel_version} if kernel)
a2ca9b
a2ca9b
Provides:         kernel-modules = %{kernel_version}.%{_arch}
a2ca9b
}
a2ca9b
a2ca9b
Requires(post):   /usr/sbin/depmod
a2ca9b
Requires(postun): /usr/sbin/depmod
a2ca9b
a2ca9b
Provides:         %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
a2ca9b
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
a2ca9b
%autosetup -p1 -n %{pkg}-%{kernel_version_min}
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
a2ca9b
/usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
a2ca9b
a2ca9b
a2ca9b
%postun
a2ca9b
/usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
a2ca9b
a2ca9b
a2ca9b
%files
a2ca9b
%defattr(644,root,root,755)
a2ca9b
/lib/modules/%{kernel_version}.%{_arch}
a2ca9b
%license COPYING
a2ca9b
a2ca9b
a2ca9b
%changelog
921504
* Thu Jul 29 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
921504
- Rebuild for 4.18.0-326.el8
921504
a2ca9b
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-315
a2ca9b
- Initial version