Blame SPECS/kmod-lpfc.spec

2e2de4
%global pkg lpfc
2e2de4
b81859
%global driver_version 4.18.0-305.17.1.el8_4
2e2de4
dbdbe1
%global kernel_version 4.18.0-305.19.1.el8_4
2e2de4
2e2de4
%global _use_internal_dependency_generator 0
2e2de4
%global __find_requires %{nil}
2e2de4
%global __find_provides /usr/lib/rpm/find-provides
2e2de4
2e2de4
%global debug_package %{nil}
2e2de4
2e2de4
%global __spec_install_post \
2e2de4
  %{?__debug_package:%{__debug_install_post}} \
2e2de4
  %{__arch_install_post} \
2e2de4
  %{__os_install_post} \
2e2de4
  %{__mod_compress_install_post}
2e2de4
2e2de4
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
2e2de4
2e2de4
2e2de4
Name:             kmod-%{pkg}
2e2de4
Version:          4.18.0
dbdbe1
Release:          305.19.1%{?dist}
2e2de4
Summary:          Emulex LightPulse Fibre Channel SCSI (%{pkg}) driver
2e2de4
2e2de4
License:          GPLv2
2e2de4
URL:              https://www.kernel.org/
2e2de4
cceba4
Source0:          %{pkg}-%{driver_version}.tar.xz
2e2de4
Patch1:           0001-add-deprecated-ids.patch
2e2de4
2e2de4
ExclusiveArch:    x86_64 aarch64
2e2de4
2e2de4
BuildRequires:    elfutils-libelf-devel
2e2de4
BuildRequires:    gcc
2e2de4
BuildRequires:    kmod
2e2de4
BuildRequires:    make
2e2de4
BuildRequires:    redhat-rpm-config
2e2de4
BuildRequires:    xz
2e2de4
2e2de4
BuildRequires:    kernel-devel = %{kernel_version}
2e2de4
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
2e2de4
2e2de4
Requires:         kernel-core = %{kernel_version}
2e2de4
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
2e2de4
Requires:         kernel-modules = %{kernel_version}
2e2de4
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
2e2de4
2e2de4
Provides:         installonlypkg(kernel-module)
7194d1
Provides:         kernel-modules = %{kernel_version}.%{_arch}
2e2de4
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
2e2de4
2e2de4
Requires(post):   /usr/sbin/depmod
2e2de4
Requires(postun): /usr/sbin/depmod
2e2de4
2e2de4
Requires(post):   /usr/bin/dracut
2e2de4
Requires(postun): /usr/bin/dracut
2e2de4
2e2de4
2e2de4
%description
2e2de4
This package provides the Emulex LightPulse Fibre Channel SCSI (%{pkg}) driver.
2e2de4
Compared to the in-kernel driver this driver re-enables support for some
2e2de4
deprecated adapters.
2e2de4
2e2de4
BladeEngine 2 (BE2) devices:
2e2de4
- 0x19A2:0x0704: Emulex OneConnect Tigershark FCoE
2e2de4
2e2de4
BladeEngine 3 (BE3) devices:
2e2de4
- 0x19A2:0x0714: Emulex OneConnect Tomcat FCoE
2e2de4
2e2de4
Fibre Channel (FC) devices:
2e2de4
- 0x10DF:0x1AE5: FIREFLY 
2e2de4
- 0x10DF:0xE100: PROTEUS VF
2e2de4
- 0x10DF:0xE131: BALIUS
2e2de4
- 0x10DF:0xE180: PROTEUS PF
2e2de4
- 0x10DF:0xF095: RFLY
2e2de4
- 0x10DF:0xF098: PFLY
2e2de4
- 0x10DF:0xF0A1: LP101
2e2de4
- 0x10DF:0xF0A5: TFLY
2e2de4
- 0x10DF:0xF0D1: BSMB
2e2de4
- 0x10DF:0xF0F5: NEPTUNE
2e2de4
- 0x10DF:0xF0F6: NEPTUNE SCSP
2e2de4
- 0x10DF:0xF0F7: NEPTUNE DCSP
2e2de4
- 0x10DF:0xF700: SUPERFLY
2e2de4
- 0x10DF:0xF800: DRAGONFLY
2e2de4
- 0x10DF:0xF900: CENTAUR
2e2de4
- 0x10DF:0xF980: PEGASUS
2e2de4
- 0x10DF:0xFA00: THOR
2e2de4
- 0x10DF:0xFB00: VIPER
2e2de4
- 0x10DF:0xFC00: LP10000S
2e2de4
- 0x10DF:0xFC10: LP11000S
2e2de4
- 0x10DF:0xFC20: LPE11000S
2e2de4
- 0x10DF:0xFC50: PROTEUS S
2e2de4
- 0x10DF:0xFD00: HELIOS
2e2de4
- 0x10DF:0xFD11: HELIOS SCSP
2e2de4
- 0x10DF:0xFD12: HELIOS DCSP
2e2de4
- 0x10DF:0xFE05: HORNET
2e2de4
2e2de4
Lancer FCoE CNA devices:
2e2de4
- 0x10DF:0xE208: LANCER_FC_VF
2e2de4
- 0x10DF:0xE260: Emulex OneConnect OCe15102-FM/OCe15104-FM/OCm15108-F-P
2e2de4
- 0x10DF:0xE268: LANCER_FCOE_VF
2e2de4
2e2de4
2e2de4
%prep
cceba4
%autosetup -p1 -n %{pkg}-%{driver_version}
2e2de4
2e2de4
2e2de4
%build
2e2de4
pushd src
2e2de4
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
2e2de4
popd
2e2de4
2e2de4
2e2de4
%install
2e2de4
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
2e2de4
2e2de4
# Make .ko objects temporarily executable for automatic stripping
2e2de4
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
2e2de4
2e2de4
2e2de4
%clean
2e2de4
%{__rm} -rf %{buildroot}
2e2de4
2e2de4
2e2de4
%post
2e2de4
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
2e2de4
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
2e2de4
2e2de4
2e2de4
%preun
2e2de4
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
2e2de4
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
2e2de4
2e2de4
2e2de4
%postun
2e2de4
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
2e2de4
then
2e2de4
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
2e2de4
    then
2e2de4
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
2e2de4
    fi
2e2de4
2e2de4
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
2e2de4
    then
2e2de4
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
2e2de4
        then
2e2de4
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
2e2de4
            then
2e2de4
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
2e2de4
            else
2e2de4
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
2e2de4
            fi
2e2de4
        fi
2e2de4
    fi
2e2de4
2e2de4
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
2e2de4
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
2e2de4
fi
2e2de4
2e2de4
2e2de4
%posttrans
2e2de4
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
2e2de4
then
2e2de4
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
2e2de4
    then
2e2de4
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
2e2de4
    fi
2e2de4
2e2de4
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
2e2de4
    then
2e2de4
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
2e2de4
        then
2e2de4
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
2e2de4
            then
2e2de4
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
2e2de4
            else
2e2de4
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
2e2de4
            fi
2e2de4
        fi
2e2de4
    fi
2e2de4
2e2de4
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
2e2de4
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
2e2de4
fi
2e2de4
2e2de4
2e2de4
%files
2e2de4
%defattr(644,root,root,755)
2e2de4
/lib/modules/%{kernel_version}.%{_arch}
2e2de4
%license COPYING
2e2de4
2e2de4
2e2de4
%changelog
dbdbe1
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.19.1
dbdbe1
- Rebuild for 4.18.0-305.19.1.el8_4
dbdbe1
b81859
* Thu Sep  9 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.17.1
b81859
- Set specific kernel version to use
b81859
- Rename kernel_version_min to driver_version
b81859
- Add Provides kernel-modules
b81859
- Add .%{_arch} to kernel-modules provides version
b81859
- Update to 4.18.0-305.17.1.el8_4
b81859
af2a99
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.12.1
af2a99
- Rebuild for 4.18.0-305.12.1.el8_4
af2a99
2e2de4
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305
2e2de4
- Initial version