Blame SPECS/kmod-lpfc.spec

56c216
%global pkg lpfc
56c216
Kmods SIG 3fa3a5
%global driver_version 4.18.0-358.el8
56c216
Kmods SIG 3fa3a5
%global kernel_version 4.18.0-358.el8
56c216
56c216
%global _use_internal_dependency_generator 0
85a966
%global __find_requires /usr/lib/rpm/redhat/find-requires
85a966
%global __find_provides /usr/lib/rpm/redhat/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}
Kmods SIG 3fa3a5
Version:          4.18.0.358
842248
Release:          3%{?dist}
56c216
Summary:          Emulex LightPulse Fibre Channel SCSI (%{pkg}) driver
56c216
56c216
License:          GPLv2
56c216
URL:              https://www.kernel.org/
56c216
fc363f
Source0:          %{pkg}-%{driver_version}.tar.xz
56c216
Patch1:           0001-add-deprecated-ids.patch
56c216
7bbc5c
ExclusiveArch:    x86_64 aarch64 ppc64le
56c216
56c216
BuildRequires:    elfutils-libelf-devel
56c216
BuildRequires:    gcc
85a966
BuildRequires:    kernel-rpm-macros
56c216
BuildRequires:    kmod
56c216
BuildRequires:    make
56c216
BuildRequires:    redhat-rpm-config
56c216
BuildRequires:    xz
56c216
85a966
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
56c216
BuildRequires:    kernel-devel = %{kernel_version}
97ffa4
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
56c216
85a966
Requires:         kernel >= %{kernel_version}
85a966
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
85a966
Requires:         kernel-modules >= %{kernel_version}
85a966
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
56c216
c7df24
Provides:         installonlypkg(kernel-module)
85a966
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
56c216
85a966
Requires(post):   %{_sbindir}/depmod
85a966
Requires(postun): %{_sbindir}/depmod
56c216
85a966
Requires(post):   %{_sbindir}/weak-modules
85a966
Requires(postun): %{_sbindir}/weak-modules
69cd07
56c216
842248
%if "%{version}" == "4.18.0.358" && "%{release}" == "2%{?dist}"
842248
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
842248
%endif
842248
842248
%if "%{version}" == "4.18.0.358" && "%{release}" == "3%{?dist}"
842248
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
842248
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
842248
%endif
842248
842248
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
fc363f
%autosetup -p1 -n %{pkg}-%{driver_version}
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
85a966
# Generate depmod.conf
85a966
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
85a966
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
85a966
do
85a966
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
85a966
done
85a966
56c216
56c216
%clean
56c216
%{__rm} -rf %{buildroot}
56c216
56c216
56c216
%post
a12049
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
85a966
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
a12049
a12049
a12049
%preun
a12049
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
85a966
rpm -ql kmod-%{pkg}-%{?epoch:%{epoch}:}%{version}-%{release}.%{_arch} | grep '/lib/modules/%{kernel_version}.%{_arch}/.*\.ko\.xz$' >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
56c216
56c216
56c216
%postun
85a966
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
a12049
then
85a966
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
85a966
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
a12049
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
85a966
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
a12049
fi
a12049
a12049
85a966
%pretrans -p <lua>
85a966
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
85a966
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
85a966
85a966
a12049
%posttrans
85a966
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
a12049
then
85a966
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
85a966
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
a12049
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
85a966
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
a12049
fi
56c216
56c216
56c216
%files
56c216
%defattr(644,root,root,755)
56c216
/lib/modules/%{kernel_version}.%{_arch}
192999
%license LICENSES
85a966
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
56c216
56c216
56c216
%changelog
842248
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-3
842248
- Add obsoletes for update path
842248
7bbc5c
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-2
7bbc5c
- Enable ppc64le
7bbc5c
Kmods SIG 3fa3a5
* Fri Jan 07 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.358-1
Kmods SIG 3fa3a5
- Update to 4.18.0-358.el8
Kmods SIG 062371
- Update 0001-add-deprecated-ids.patch
Kmods SIG 3fa3a5
258bb1
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.348-1
258bb1
- Update to 4.18.0-348.el8
258bb1
b562e6
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.331-2
b562e6
- Rebuild for 4.18.0-338.el8
b562e6
f1dd14
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.331-1
f1dd14
- Update to 4.18.0-331.el8
f1dd14
2ab417
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.310-2
2ab417
- Rebuild for 4.18.0-326.el8
2ab417
c4361b
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.310-1
63c0ec
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
b5a623
- Build 4.18.0-310.el8 for 4.18.0-315.el8
63c0ec
- Use release number independent of kernel
63c0ec
- Add driver release number to version