Blame SPECS/kmod-lpfc.spec

2e2de4
%global pkg lpfc
2e2de4
b9b577
%global driver_version 4.18.0-348.el8
2e2de4
b9b577
%global kernel_version 4.18.0-348.el8
2e2de4
2e2de4
%global _use_internal_dependency_generator 0
f78e4c
%global __find_requires /usr/lib/rpm/redhat/find-requires
f78e4c
%global __find_provides /usr/lib/rpm/redhat/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}
b9b577
Version:          4.18.0.348
f35d82
Release:          2%{?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
f35d82
ExclusiveArch:    x86_64 aarch64 ppc64le
2e2de4
2e2de4
BuildRequires:    elfutils-libelf-devel
2e2de4
BuildRequires:    gcc
f78e4c
BuildRequires:    kernel-rpm-macros
2e2de4
BuildRequires:    kmod
2e2de4
BuildRequires:    make
2e2de4
BuildRequires:    redhat-rpm-config
2e2de4
BuildRequires:    xz
2e2de4
f78e4c
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
2e2de4
BuildRequires:    kernel-devel = %{kernel_version}
2e2de4
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
2e2de4
f78e4c
Requires:         kernel >= %{kernel_version}
f78e4c
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
f78e4c
Requires:         kernel-modules >= %{kernel_version}
f78e4c
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
2e2de4
2e2de4
Provides:         installonlypkg(kernel-module)
f78e4c
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
2e2de4
f78e4c
Requires(post):   %{_sbindir}/depmod
f78e4c
Requires(postun): %{_sbindir}/depmod
2e2de4
f78e4c
Requires(post):   %{_sbindir}/weak-modules
f78e4c
Requires(postun): %{_sbindir}/weak-modules
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
f78e4c
# Generate depmod.conf
f78e4c
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
f78e4c
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
f78e4c
do
f78e4c
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
f78e4c
done
f78e4c
2e2de4
2e2de4
%clean
2e2de4
%{__rm} -rf %{buildroot}
2e2de4
2e2de4
2e2de4
%post
2e2de4
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f78e4c
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
2e2de4
2e2de4
2e2de4
%preun
2e2de4
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f78e4c
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
2e2de4
2e2de4
2e2de4
%postun
f78e4c
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
2e2de4
then
f78e4c
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
f78e4c
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
2e2de4
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f78e4c
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
2e2de4
fi
2e2de4
2e2de4
f78e4c
%pretrans -p <lua>
f78e4c
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
f78e4c
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
f78e4c
f78e4c
2e2de4
%posttrans
f78e4c
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
2e2de4
then
f78e4c
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
f78e4c
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
2e2de4
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f78e4c
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
2e2de4
fi
2e2de4
2e2de4
2e2de4
%files
2e2de4
%defattr(644,root,root,755)
2e2de4
/lib/modules/%{kernel_version}.%{_arch}
c162e3
%license LICENSES
f78e4c
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
2e2de4
2e2de4
2e2de4
%changelog
f35d82
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.348-2
f35d82
- Enable ppc64le
f35d82
b9b577
* Tue Nov 09 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.348-1
b9b577
- Update to 4.18.0-348.el8
b9b577
2d2a1c
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305.17.1-1
2d2a1c
- Update to 4.18.0-305.17.1.el8_4
2d2a1c
f78e4c
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-1
3fc5f9
- Convert to kABI tracking kmod package (kernel >= 4.18.0-305.7.1.el8)
3fc5f9
- Build 4.18.0-305.el8 for 4.18.0-305.7.1.el8_4
f78e4c
- Use release number independent of kernel
f78e4c
- Add driver release number to version