Blame SPECS/kmod-qla4xxx.spec

fcc96f
%global pkg qla4xxx
fcc96f
a7d039
%global driver_version 4.18.0-107.el8
fcc96f
d7e03e
%global kernel_version 4.18.0-326.el8
fcc96f
fcc96f
%global _use_internal_dependency_generator 0
d7e03e
%global __find_requires /usr/lib/rpm/redhat/find-requires
d7e03e
%global __find_provides /usr/lib/rpm/redhat/find-provides
fcc96f
fcc96f
%global debug_package %{nil}
fcc96f
fcc96f
%global __spec_install_post \
fcc96f
  %{?__debug_package:%{__debug_install_post}} \
fcc96f
  %{__arch_install_post} \
fcc96f
  %{__os_install_post} \
fcc96f
  %{__mod_compress_install_post}
fcc96f
fcc96f
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
fcc96f
fcc96f
fcc96f
Name:             kmod-%{pkg}
fcc96f
Version:          4.18.0
d7e03e
Release:          348%{?dist}
fcc96f
Summary:          QLogic iSCSI HBA (%{pkg}) driver
fcc96f
fcc96f
License:          GPLv2
fcc96f
URL:              https://www.kernel.org/
fcc96f
a7d039
Source0:          %{pkg}-%{driver_version}.tar.xz
fcc96f
Patch1:           0001-add-deprecated-ids.patch
fcc96f
fcc96f
ExclusiveArch:    x86_64 aarch64
fcc96f
fcc96f
BuildRequires:    elfutils-libelf-devel
fcc96f
BuildRequires:    gcc
d7e03e
BuildRequires:    kernel-rpm-macros
fcc96f
BuildRequires:    kmod
fcc96f
BuildRequires:    make
fcc96f
BuildRequires:    redhat-rpm-config
fcc96f
BuildRequires:    xz
fcc96f
d7e03e
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
fcc96f
BuildRequires:    kernel-devel = %{kernel_version}
4994a0
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
fcc96f
d7e03e
Requires:         kernel >= %{kernel_version}
d7e03e
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
d7e03e
Requires:         kernel-modules >= %{kernel_version}
d7e03e
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
fcc96f
349fe5
Provides:         installonlypkg(kernel-module)
d7e03e
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
fcc96f
d7e03e
Requires(post):   %{_sbindir}/depmod
d7e03e
Requires(postun): %{_sbindir}/depmod
fcc96f
d7e03e
Requires(post):   %{_sbindir}/weak-modules
d7e03e
Requires(postun): %{_sbindir}/weak-modules
a742c4
fcc96f
fcc96f
%description
fcc96f
This package provides the QLogic iSCSI HBA (%{pkg}) driver. Compared to the
fcc96f
in-kernel driver this driver re-enables support for deprecated adapters:
fcc96f
fcc96f
- 0x1077:0x8022: QLogic ISP8022
fcc96f
- 0x1077:0x8032: QLogic ISP8324
fcc96f
- 0x1077:0x8042: QLogic ISP8042
fcc96f
fcc96f
fcc96f
%prep
a7d039
%autosetup -p1 -n %{pkg}-%{driver_version}
fcc96f
fcc96f
fcc96f
%build
fcc96f
pushd src
fcc96f
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
fcc96f
popd
fcc96f
fcc96f
fcc96f
%install
fcc96f
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
fcc96f
fcc96f
# Make .ko objects temporarily executable for automatic stripping
fcc96f
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
fcc96f
d7e03e
# Generate depmod.conf
d7e03e
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
d7e03e
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
d7e03e
do
d7e03e
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
d7e03e
done
d7e03e
fcc96f
fcc96f
%clean
fcc96f
%{__rm} -rf %{buildroot}
fcc96f
fcc96f
fcc96f
%post
22cda1
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
d7e03e
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
22cda1
22cda1
22cda1
%preun
22cda1
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
d7e03e
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
fcc96f
fcc96f
fcc96f
%postun
d7e03e
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
22cda1
then
d7e03e
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
d7e03e
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
22cda1
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
d7e03e
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
22cda1
fi
22cda1
22cda1
d7e03e
%pretrans -p <lua>
d7e03e
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
d7e03e
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
d7e03e
d7e03e
22cda1
%posttrans
d7e03e
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
22cda1
then
d7e03e
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
d7e03e
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
22cda1
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
d7e03e
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
22cda1
fi
fcc96f
fcc96f
fcc96f
%files
fcc96f
%defattr(644,root,root,755)
fcc96f
/lib/modules/%{kernel_version}.%{_arch}
fcc96f
%license COPYING
d7e03e
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
fcc96f
fcc96f
fcc96f
%changelog
d7e03e
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-348
d7e03e
- Convert to kABI tracking kmod package (kernel >= 4.18.0-326.el8)
d7e03e
47954a
* Mon Aug 30 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-338
47954a
- Set specific kernel version to use
47954a
- Rename kernel_version_min to driver_version
47954a
- Add Provides kernel-modules
47954a
- Rebuild for 4.18.0-338.el8
47954a
79de29
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-331
79de29
- Rebuild for 4.18.0-331.el8
79de29
8cf90a
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
87bbd3
- Rebuild for 4.18.0-326.el8
8cf90a
- Fix provides/requires
8cf90a
- Fix kernel dependencies
8cf90a
- Add convenient provides kmod-aacraid-`uname -r`
8cf90a
- Fix installonlypkg detection
8cf90a
- Recreate source tarballs
8cf90a
- Rebuild for dist = .el8s
8cf90a
8cf90a
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-107
fcc96f
- Initial version