Blame SPECS/kmod-lpfc.spec

56c216
%global pkg lpfc
56c216
56c216
%global kernel_version_min 4.18.0-310.el8
56c216
56c216
# To pick a specific kernel use `--define "kernel_version 4.18.0-315.el8"`
56c216
# Otherwise the latest installed kernel-devel version later than
56c216
# %%{kernel_version_min} will be used.
56c216
56c216
%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)
56c216
56c216
%if "%{kernel_version_latest}" != ""
56c216
%{!?kernel_version:%{expand:%%global kernel_version %{kernel_version_latest}}}
56c216
%endif
56c216
56c216
%global _use_internal_dependency_generator 0
56c216
56c216
%global debug_package %{nil}
56c216
56c216
%global __spec_install_post \
56c216
  %{?__debug_package:%{__debug_install_post}} \
56c216
  %{__arch_install_post} \
56c216
  %{__os_install_post} \
56c216
  %{__mod_compress_install_post}
56c216
56c216
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
56c216
56c216
56c216
Name:             kmod-%{pkg}
56c216
Version:          4.18.0
0431b5
Release:          326%{?dist}
56c216
Summary:          Emulex LightPulse Fibre Channel SCSI (%{pkg}) driver
56c216
56c216
License:          GPLv2
56c216
URL:              https://www.kernel.org/
56c216
56c216
Source0:          %{pkg}-%{kernel_version_min}.tar.xz
56c216
Patch1:           0001-add-deprecated-ids.patch
56c216
56c216
ExclusiveArch:    x86_64 aarch64
56c216
56c216
BuildRequires:    elfutils-libelf-devel
56c216
BuildRequires:    gcc
56c216
BuildRequires:    kernel-abi-whitelists
56c216
BuildRequires:    kernel-rpm-macros
56c216
BuildRequires:    kmod
56c216
BuildRequires:    make
56c216
BuildRequires:    redhat-rpm-config
56c216
BuildRequires:    xz
56c216
56c216
%{!?kernel_version:
56c216
BuildRequires:    kernel-devel >= %{kernel_version_min}
56c216
}
56c216
56c216
%{?kernel_version:
56c216
BuildRequires:    kernel-devel = %{kernel_version}
56c216
56c216
Supplements:      kernel = %{kernel_version}
56c216
88f521
Requires:         kernel-core = %{kernel_version}
2f2b5f
Requires:         kernel-modules = %{kernel_version}
56c216
56c216
Provides:         kernel-modules = %{kernel_version}.%{_arch}
56c216
}
56c216
56c216
Requires(post):   /usr/sbin/depmod
56c216
Requires(postun): /usr/sbin/depmod
56c216
56c216
Provides:         %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
56c216
56c216
56c216
%description
56c216
This package provides the Emulex LightPulse Fibre Channel SCSI (%{pkg}) driver.
56c216
Compared to the in-kernel driver this driver re-enables support for some
56c216
deprecated adapters.
56c216
56c216
BladeEngine 2 (BE2) devices:
56c216
- 0x19A2:0x0704: Emulex OneConnect Tigershark FCoE
56c216
56c216
BladeEngine 3 (BE3) devices:
56c216
- 0x19A2:0x0714: Emulex OneConnect Tomcat FCoE
56c216
56c216
Fibre Channel (FC) devices:
56c216
- 0x10DF:0x1AE5: FIREFLY 
56c216
- 0x10DF:0xE100: PROTEUS VF
56c216
- 0x10DF:0xE131: BALIUS
56c216
- 0x10DF:0xE180: PROTEUS PF
56c216
- 0x10DF:0xF095: RFLY
56c216
- 0x10DF:0xF098: PFLY
56c216
- 0x10DF:0xF0A1: LP101
56c216
- 0x10DF:0xF0A5: TFLY
56c216
- 0x10DF:0xF0D1: BSMB
56c216
- 0x10DF:0xF0F5: NEPTUNE
56c216
- 0x10DF:0xF0F6: NEPTUNE SCSP
56c216
- 0x10DF:0xF0F7: NEPTUNE DCSP
56c216
- 0x10DF:0xF700: SUPERFLY
56c216
- 0x10DF:0xF800: DRAGONFLY
56c216
- 0x10DF:0xF900: CENTAUR
56c216
- 0x10DF:0xF980: PEGASUS
56c216
- 0x10DF:0xFA00: THOR
56c216
- 0x10DF:0xFB00: VIPER
56c216
- 0x10DF:0xFC00: LP10000S
56c216
- 0x10DF:0xFC10: LP11000S
56c216
- 0x10DF:0xFC20: LPE11000S
56c216
- 0x10DF:0xFC50: PROTEUS S
56c216
- 0x10DF:0xFD00: HELIOS
56c216
- 0x10DF:0xFD11: HELIOS SCSP
56c216
- 0x10DF:0xFD12: HELIOS DCSP
56c216
- 0x10DF:0xFE05: HORNET
56c216
56c216
Lancer FCoE CNA devices:
56c216
- 0x10DF:0xE208: LANCER_FC_VF
56c216
- 0x10DF:0xE260: Emulex OneConnect OCe15102-FM/OCe15104-FM/OCm15108-F-P
56c216
- 0x10DF:0xE268: LANCER_FCOE_VF
56c216
56c216
56c216
%prep
56c216
%autosetup -p1 -n %{pkg}-%{kernel_version_min}
56c216
56c216
56c216
%build
56c216
pushd src
56c216
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
56c216
popd
56c216
56c216
56c216
%install
56c216
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
56c216
56c216
# Make .ko objects temporarily executable for automatic stripping
56c216
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
56c216
56c216
56c216
%clean
56c216
%{__rm} -rf %{buildroot}
56c216
56c216
56c216
%post
a12049
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
a12049
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
a12049
a12049
a12049
%preun
a12049
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
a12049
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
56c216
56c216
56c216
%postun
a12049
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
a12049
then
a12049
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
a12049
    then
a12049
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
a12049
    fi
a12049
a12049
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
a12049
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
a12049
fi
a12049
a12049
a12049
%posttrans
a12049
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
a12049
then
a12049
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
a12049
    then
a12049
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
a12049
    fi
a12049
a12049
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
a12049
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
a12049
fi
56c216
56c216
56c216
%files
56c216
%defattr(644,root,root,755)
56c216
/lib/modules/%{kernel_version}.%{_arch}
56c216
%license COPYING
56c216
56c216
56c216
%changelog
0431b5
* Thu Jul 29 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
0431b5
- Rebuild for 4.18.0-326.el8
0431b5
56c216
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-310
56c216
- Initial version