Blame SPECS/kmod-lpfc.spec

56c216
%global pkg lpfc
56c216
b5a623
%global driver_version 4.18.0-310.el8
56c216
b5a623
%global kernel_version 4.18.0-315.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}
56c216
Version:          4.18.0
b5a623
Release:          350%{?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
56c216
ExclusiveArch:    x86_64 aarch64
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
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}
56c216
%license COPYING
85a966
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
56c216
56c216
56c216
%changelog
b5a623
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-350
b5a623
- Use release number independent of kernel
b5a623
- Build 4.18.0-310.el8 for 4.18.0-315.el8
b5a623
85a966
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-348
85a966
- Convert to kABI tracking kmod package (kernel >= 4.18.0-348.el8)
85a966
- Update to 4.18.0-348.el8
85a966
b7d7a2
* Mon Aug 30 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-338
b7d7a2
- Set specific kernel version to use
b7d7a2
- Rename kernel_version_min to driver_version
b7d7a2
- Add Provides kernel-modules
b7d7a2
- Rebuild for 4.18.0-338.el8
b7d7a2
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