Blame SPECS/kmod-qla2xxx.spec

590fb8
%global pkg qla2xxx
590fb8
590fb8
%global driver_version 5.14.0-1.el9
590fb8
bafb25
%global kernel_version 5.14.0-39.el9
590fb8
590fb8
%global debug_package %{nil}
590fb8
590fb8
%global __spec_install_post \
590fb8
  %{?__debug_package:%{__debug_install_post}} \
590fb8
  %{__arch_install_post} \
590fb8
  %{__os_install_post} \
590fb8
  %{__mod_compress_install_post}
590fb8
590fb8
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
590fb8
590fb8
590fb8
Name:             kmod-%{pkg}
87f674
Version:          5.14.0.1
Kmods SIG 992afb
Release:          5%{?dist}
590fb8
Summary:          QLogic Fibre Channel HBA (%{pkg}) driver
590fb8
590fb8
License:          GPLv2
590fb8
URL:              https://www.kernel.org/
590fb8
590fb8
Source0:          %{pkg}-%{driver_version}.tar.xz
590fb8
Patch1:           0001-add-deprecated-ids.patch
590fb8
590fb8
ExclusiveArch:    x86_64 aarch64
590fb8
590fb8
BuildRequires:    elfutils-libelf-devel
590fb8
BuildRequires:    gcc
87f674
BuildRequires:    kernel-rpm-macros
590fb8
BuildRequires:    kmod
590fb8
BuildRequires:    make
590fb8
BuildRequires:    redhat-rpm-config
590fb8
BuildRequires:    xz
590fb8
87f674
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
590fb8
BuildRequires:    kernel-devel = %{kernel_version}
590fb8
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
590fb8
87f674
Requires:         kernel >= %{kernel_version}
87f674
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
87f674
Requires:         kernel-modules >= %{kernel_version}
87f674
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
590fb8
590fb8
Provides:         installonlypkg(kernel-module)
87f674
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
590fb8
87f674
Requires(post):   %{_sbindir}/depmod
87f674
Requires(postun): %{_sbindir}/depmod
590fb8
87f674
Requires(post):   %{_sbindir}/weak-modules
87f674
Requires(postun): %{_sbindir}/weak-modules
590fb8
590fb8
590fb8
%description
590fb8
This package provides the QLogic Fibre Channel HBA (%{pkg}) driver. Compared to
590fb8
the in-kernel driver this driver re-enables support for deprecated adapters:
590fb8
590fb8
- 0x1077:0x2100: QLogic ISP2100
590fb8
- 0x1077:0x2200: QLogic ISP2200
590fb8
- 0x1077:0x2300: QLogic ISP2300
590fb8
- 0x1077:0x2312: QLogic ISP2312
590fb8
- 0x1077:0x2322: QLogic ISP2322
590fb8
- 0x1077:0x2422: QLogic ISP2422
590fb8
- 0x1077:0x2432: QLogic ISP2432
590fb8
- 0x1077:0x5422: QLogic ISP5422
590fb8
- 0x1077:0x5432: QLogic ISP5432 / QLE220
590fb8
- 0x1077:0x6312: QLogic ISP6312
590fb8
- 0x1077:0x6322: QLogic ISP6322
590fb8
- 0x1077:0x8001: QLogic ISP8001 / QLE81xx
590fb8
- 0x1077:0x8021: QLogic ISP8021 / QLE82xx
590fb8
- 0x1077:0x8044: QLogic ISP8044 / QLE84xx
590fb8
- 0x1077:0x8432: QLogic ISP8432 / QLE8000
590fb8
- 0x1077:0xF001: QLogic ISPF001 / QLE10000
590fb8
590fb8
590fb8
%prep
590fb8
%autosetup -p1 -n %{pkg}-%{driver_version}
590fb8
590fb8
590fb8
%build
590fb8
pushd src
590fb8
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
590fb8
popd
590fb8
590fb8
590fb8
%install
590fb8
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
590fb8
590fb8
# Make .ko objects temporarily executable for automatic stripping
590fb8
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
590fb8
87f674
# Generate depmod.conf
87f674
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
87f674
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
87f674
do
87f674
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
87f674
done
87f674
590fb8
590fb8
%clean
590fb8
%{__rm} -rf %{buildroot}
590fb8
590fb8
590fb8
%post
590fb8
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
87f674
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
590fb8
590fb8
590fb8
%preun
590fb8
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
87f674
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
590fb8
590fb8
590fb8
%postun
87f674
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
590fb8
then
87f674
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
87f674
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
590fb8
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
87f674
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
590fb8
fi
590fb8
590fb8
87f674
%pretrans -p <lua>
87f674
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
87f674
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
87f674
87f674
590fb8
%posttrans
87f674
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
590fb8
then
87f674
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
87f674
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
590fb8
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
87f674
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
590fb8
fi
590fb8
590fb8
590fb8
%files
590fb8
%defattr(644,root,root,755)
590fb8
/lib/modules/%{kernel_version}.%{_arch}
590fb8
%license COPYING
87f674
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
590fb8
590fb8
590fb8
%changelog
bafb25
* Sat Dec 25 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-5
bafb25
- Rebuild for 5.14.0-39.el9
bafb25
- Skip unreleased kernel -38
Kmods SIG 992afb
Kmods SIG 80ba9a
* Thu Dec 23 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-4
Kmods SIG 80ba9a
- Rebuild for 5.14.0-37.el9
Kmods SIG 80ba9a
Kmods SIG cb92a5
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-3
Kmods SIG cb92a5
- Rebuild for 5.14.0-36.el9
Kmods SIG cb92a5
637c63
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-2
637c63
- Rebuild for 5.14.0-34.el9
637c63
- Skip unreleased kernel -32 and -33
Kmods SIG 19b079
87f674
* Thu Dec 16 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0.1-1
87f674
- Convert to kABI tracking kmod package (kernel >= 5.14.0-31.el9)