Blame SPECS/kmod-qla2xxx.spec

a2ca9b
%global pkg qla2xxx
a2ca9b
Kmods SIG cfb6a0
%global driver_version 4.18.0-358.el8
a2ca9b
Kmods SIG cfb6a0
%global kernel_version 4.18.0-358.el8
a2ca9b
a2ca9b
%global _use_internal_dependency_generator 0
ba5469
%global __find_requires /usr/lib/rpm/redhat/find-requires
ba5469
%global __find_provides /usr/lib/rpm/redhat/find-provides
a2ca9b
a2ca9b
%global debug_package %{nil}
a2ca9b
a2ca9b
%global __spec_install_post \
a2ca9b
  %{?__debug_package:%{__debug_install_post}} \
a2ca9b
  %{__arch_install_post} \
a2ca9b
  %{__os_install_post} \
a2ca9b
  %{__mod_compress_install_post}
a2ca9b
a2ca9b
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
a2ca9b
a2ca9b
a2ca9b
Name:             kmod-%{pkg}
Kmods SIG cfb6a0
Version:          4.18.0.358
34fea4
Release:          1%{?dist}
a2ca9b
Summary:          QLogic Fibre Channel HBA (%{pkg}) driver
a2ca9b
c2c419
License:          GPLv2 and GPLv2+
a2ca9b
URL:              https://www.kernel.org/
a2ca9b
73ad01
Source0:          %{pkg}-%{driver_version}.tar.xz
a2ca9b
Patch1:           0001-add-deprecated-ids.patch
a2ca9b
a2ca9b
ExclusiveArch:    x86_64 aarch64
a2ca9b
a2ca9b
BuildRequires:    elfutils-libelf-devel
a2ca9b
BuildRequires:    gcc
ba5469
BuildRequires:    kernel-rpm-macros
a2ca9b
BuildRequires:    kmod
a2ca9b
BuildRequires:    make
a2ca9b
BuildRequires:    redhat-rpm-config
a2ca9b
BuildRequires:    xz
a2ca9b
ba5469
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
a2ca9b
BuildRequires:    kernel-devel = %{kernel_version}
d9abaf
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
a2ca9b
ba5469
Requires:         kernel >= %{kernel_version}
ba5469
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
ba5469
Requires:         kernel-modules >= %{kernel_version}
ba5469
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
a2ca9b
ee666f
Provides:         installonlypkg(kernel-module)
ba5469
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
a2ca9b
ba5469
Requires(post):   %{_sbindir}/depmod
ba5469
Requires(postun): %{_sbindir}/depmod
a2ca9b
ba5469
Requires(post):   %{_sbindir}/weak-modules
ba5469
Requires(postun): %{_sbindir}/weak-modules
0a6a21
a2ca9b
a2ca9b
%description
a2ca9b
This package provides the QLogic Fibre Channel HBA (%{pkg}) driver. Compared to
a2ca9b
the in-kernel driver this driver re-enables support for deprecated adapters:
a2ca9b
a2ca9b
- 0x1077:0x2100: QLogic ISP2100
a2ca9b
- 0x1077:0x2200: QLogic ISP2200
a2ca9b
- 0x1077:0x2300: QLogic ISP2300
a2ca9b
- 0x1077:0x2312: QLogic ISP2312
a2ca9b
- 0x1077:0x2322: QLogic ISP2322
a2ca9b
- 0x1077:0x2422: QLogic ISP2422
a2ca9b
- 0x1077:0x2432: QLogic ISP2432
a2ca9b
- 0x1077:0x5422: QLogic ISP5422
a2ca9b
- 0x1077:0x5432: QLogic ISP5432 / QLE220
a2ca9b
- 0x1077:0x6312: QLogic ISP6312
a2ca9b
- 0x1077:0x6322: QLogic ISP6322
a2ca9b
- 0x1077:0x8001: QLogic ISP8001 / QLE81xx
a2ca9b
- 0x1077:0x8021: QLogic ISP8021 / QLE82xx
a2ca9b
- 0x1077:0x8044: QLogic ISP8044 / QLE84xx
a2ca9b
- 0x1077:0x8432: QLogic ISP8432 / QLE8000
a2ca9b
- 0x1077:0xF001: QLogic ISPF001 / QLE10000
a2ca9b
a2ca9b
a2ca9b
%prep
73ad01
%autosetup -p1 -n %{pkg}-%{driver_version}
a2ca9b
a2ca9b
a2ca9b
%build
a2ca9b
pushd src
a2ca9b
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
a2ca9b
popd
a2ca9b
a2ca9b
a2ca9b
%install
a2ca9b
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
a2ca9b
a2ca9b
# Make .ko objects temporarily executable for automatic stripping
a2ca9b
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
a2ca9b
ba5469
# Generate depmod.conf
ba5469
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
ba5469
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
ba5469
do
ba5469
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
ba5469
done
ba5469
a2ca9b
a2ca9b
%clean
a2ca9b
%{__rm} -rf %{buildroot}
a2ca9b
a2ca9b
a2ca9b
%post
66b402
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
ba5469
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
66b402
66b402
66b402
%preun
66b402
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
ba5469
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
a2ca9b
a2ca9b
a2ca9b
%postun
ba5469
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
66b402
then
ba5469
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
ba5469
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
66b402
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
ba5469
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
66b402
fi
66b402
66b402
ba5469
%pretrans -p <lua>
ba5469
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
ba5469
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
ba5469
ba5469
66b402
%posttrans
ba5469
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
66b402
then
ba5469
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
ba5469
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
66b402
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
ba5469
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
66b402
fi
a2ca9b
a2ca9b
a2ca9b
%files
a2ca9b
%defattr(644,root,root,755)
a2ca9b
/lib/modules/%{kernel_version}.%{_arch}
760446
%license LICENSES
ba5469
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
a2ca9b
a2ca9b
a2ca9b
%changelog
Kmods SIG cfb6a0
* Fri Jan 07 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.358-1
Kmods SIG cfb6a0
- Update to 4.18.0-358.el8
Kmods SIG cfb6a0
34fea4
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.348-1
34fea4
- Update to 4.18.0-348.el8
34fea4
b4a6bd
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.331-2
b4a6bd
- Rebuild for 4.18.0-338.el8
b4a6bd
4b06c4
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.331-1
4b06c4
- Update to 4.18.0-331.el8
4b06c4
60f757
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.315-2
60f757
- Rebuild for 4.18.0-326.el8
60f757
db669f
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.315-1
113815
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
327df6
- Build 4.18.0-315.el8 for 4.18.0-315.el8
113815
- Use release number independent of kernel
113815
- Add driver release number to version