Blame SPECS/kmod-lpfc.spec

56c216
%global pkg lpfc
56c216
d83c70
%global kernel_version_min 4.18.0-331.el8
56c216
5ab8b7
%global kernel_version 4.18.0-331.el8
56c216
56c216
%global _use_internal_dependency_generator 0
b8b87d
%global __find_requires %{nil}
51ea08
%global __find_provides /usr/lib/rpm/find-provides
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
d83c70
Release:          331%{?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:    kmod
56c216
BuildRequires:    make
56c216
BuildRequires:    redhat-rpm-config
56c216
BuildRequires:    xz
56c216
56c216
BuildRequires:    kernel-devel = %{kernel_version}
97ffa4
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
56c216
88f521
Requires:         kernel-core = %{kernel_version}
97ffa4
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
2f2b5f
Requires:         kernel-modules = %{kernel_version}
97ffa4
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
56c216
c7df24
Provides:         installonlypkg(kernel-module)
e4e30e
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
56c216
56c216
Requires(post):   /usr/sbin/depmod
56c216
Requires(postun): /usr/sbin/depmod
56c216
69cd07
Requires(post):   /usr/bin/dracut
69cd07
Requires(postun): /usr/bin/dracut
69cd07
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
69cd07
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
69cd07
    then
69cd07
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
69cd07
        then
69cd07
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
69cd07
            then
69cd07
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
69cd07
            else
69cd07
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
69cd07
            fi
69cd07
        fi
69cd07
    fi
69cd07
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
69cd07
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
69cd07
    then
69cd07
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
69cd07
        then
69cd07
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
69cd07
            then
69cd07
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
69cd07
            else
69cd07
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
69cd07
            fi
69cd07
        fi
69cd07
    fi
69cd07
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
d83c70
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-331
d83c70
- Update to 4.18.0-331.el8
d83c70
7e6eb3
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
0431b5
- Rebuild for 4.18.0-326.el8
7e6eb3
- Fix provides/requires
7e6eb3
- Fix kernel dependencies
7e6eb3
- Add convenient provides kmod-aacraid-`uname -r`
7e6eb3
- Fix installonlypkg detection
7e6eb3
- Recreate source tarballs
7e6eb3
- Rebuild for dist = .el8s
7e6eb3
7e6eb3
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-310
56c216
- Initial version