Blame SPECS/kmod-qla4xxx.spec

fcc96f
%global pkg qla4xxx
fcc96f
fcc96f
%global kernel_version_min 4.18.0-107.el8
fcc96f
fcc96f
# To pick a specific kernel use `--define "kernel_version 4.18.0-315.el8"`
fcc96f
# Otherwise the latest installed kernel-devel version later than
fcc96f
# %%{kernel_version_min} will be used.
fcc96f
fcc96f
%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)
fcc96f
fcc96f
%if "%{kernel_version_latest}" != ""
fcc96f
%{!?kernel_version:%{expand:%%global kernel_version %{kernel_version_latest}}}
fcc96f
%endif
fcc96f
fcc96f
%global _use_internal_dependency_generator 0
fcc96f
fcc96f
%global debug_package %{nil}
fcc96f
fcc96f
%global __spec_install_post \
fcc96f
  %{?__debug_package:%{__debug_install_post}} \
fcc96f
  %{__arch_install_post} \
fcc96f
  %{__os_install_post} \
fcc96f
  %{__mod_compress_install_post}
fcc96f
fcc96f
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
fcc96f
fcc96f
fcc96f
Name:             kmod-%{pkg}
fcc96f
Version:          4.18.0
fcc96f
Release:          107%{?dist}
fcc96f
Summary:          QLogic iSCSI HBA (%{pkg}) driver
fcc96f
fcc96f
License:          GPLv2
fcc96f
URL:              https://www.kernel.org/
fcc96f
fcc96f
Source0:          %{pkg}-%{kernel_version_min}.tar.xz
fcc96f
Patch1:           0001-add-deprecated-ids.patch
fcc96f
fcc96f
ExclusiveArch:    x86_64 aarch64
fcc96f
fcc96f
BuildRequires:    elfutils-libelf-devel
fcc96f
BuildRequires:    gcc
fcc96f
BuildRequires:    kernel-abi-whitelists
fcc96f
BuildRequires:    kernel-rpm-macros
fcc96f
BuildRequires:    kmod
fcc96f
BuildRequires:    make
fcc96f
BuildRequires:    redhat-rpm-config
fcc96f
BuildRequires:    xz
fcc96f
fcc96f
%{!?kernel_version:
fcc96f
BuildRequires:    kernel-devel >= %{kernel_version_min}
fcc96f
}
fcc96f
fcc96f
%{?kernel_version:
fcc96f
BuildRequires:    kernel-devel = %{kernel_version}
fcc96f
fcc96f
Supplements:      kernel = %{kernel_version}
fcc96f
fcc96f
Requires:         (kernel = %{kernel_version} if kernel)
fcc96f
fcc96f
Provides:         kernel-modules = %{kernel_version}.%{_arch}
fcc96f
}
fcc96f
fcc96f
Requires(post):   /usr/sbin/depmod
fcc96f
Requires(postun): /usr/sbin/depmod
fcc96f
fcc96f
Provides:         %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
fcc96f
fcc96f
fcc96f
%description
fcc96f
This package provides the QLogic iSCSI HBA (%{pkg}) driver. Compared to the
fcc96f
in-kernel driver this driver re-enables support for deprecated adapters:
fcc96f
fcc96f
- 0x1077:0x8022: QLogic ISP8022
fcc96f
- 0x1077:0x8032: QLogic ISP8324
fcc96f
- 0x1077:0x8042: QLogic ISP8042
fcc96f
fcc96f
fcc96f
%prep
fcc96f
%autosetup -p1 -n %{pkg}-%{kernel_version_min}
fcc96f
fcc96f
fcc96f
%build
fcc96f
pushd src
fcc96f
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
fcc96f
popd
fcc96f
fcc96f
fcc96f
%install
fcc96f
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
fcc96f
fcc96f
# Make .ko objects temporarily executable for automatic stripping
fcc96f
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
fcc96f
fcc96f
fcc96f
%clean
fcc96f
%{__rm} -rf %{buildroot}
fcc96f
fcc96f
fcc96f
%post
fcc96f
/usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
fcc96f
fcc96f
fcc96f
%postun
fcc96f
/usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
fcc96f
fcc96f
fcc96f
%files
fcc96f
%defattr(644,root,root,755)
fcc96f
/lib/modules/%{kernel_version}.%{_arch}
fcc96f
%license COPYING
fcc96f
fcc96f
fcc96f
%changelog
fcc96f
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-107
fcc96f
- Initial version