Blame SPECS/kmod-qla4xxx.spec

35007b
%global pkg qla4xxx
35007b
5b6c8b
%global driver_version 4.18.0-147.el8
35007b
201192
%global kernel_version 4.18.0-305.7.1.el8_4
35007b
35007b
%global _use_internal_dependency_generator 0
a23452
%global __find_requires /usr/lib/rpm/redhat/find-requires
a23452
%global __find_provides /usr/lib/rpm/redhat/find-provides
35007b
35007b
%global debug_package %{nil}
35007b
35007b
%global __spec_install_post \
35007b
  %{?__debug_package:%{__debug_install_post}} \
35007b
  %{__arch_install_post} \
35007b
  %{__os_install_post} \
35007b
  %{__mod_compress_install_post}
35007b
35007b
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
35007b
35007b
35007b
Name:             kmod-%{pkg}
a23452
Version:          4.18.0.147
a23452
Release:          1%{?dist}
35007b
Summary:          QLogic iSCSI HBA (%{pkg}) driver
35007b
35007b
License:          GPLv2
35007b
URL:              https://www.kernel.org/
35007b
5b6c8b
Source0:          %{pkg}-%{driver_version}.tar.xz
35007b
Patch1:           0001-add-deprecated-ids.patch
35007b
35007b
ExclusiveArch:    x86_64 aarch64
35007b
35007b
BuildRequires:    elfutils-libelf-devel
35007b
BuildRequires:    gcc
a23452
BuildRequires:    kernel-rpm-macros
35007b
BuildRequires:    kmod
35007b
BuildRequires:    make
35007b
BuildRequires:    redhat-rpm-config
35007b
BuildRequires:    xz
35007b
a23452
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
35007b
BuildRequires:    kernel-devel = %{kernel_version}
35007b
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
35007b
a23452
Requires:         kernel >= %{kernel_version}
a23452
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
a23452
Requires:         kernel-modules >= %{kernel_version}
a23452
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
35007b
35007b
Provides:         installonlypkg(kernel-module)
a23452
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
35007b
a23452
Requires(post):   %{_sbindir}/depmod
a23452
Requires(postun): %{_sbindir}/depmod
35007b
a23452
Requires(post):   %{_sbindir}/weak-modules
a23452
Requires(postun): %{_sbindir}/weak-modules
35007b
35007b
35007b
%description
35007b
This package provides the QLogic iSCSI HBA (%{pkg}) driver. Compared to the
35007b
in-kernel driver this driver re-enables support for deprecated adapters:
35007b
35007b
- 0x1077:0x8022: QLogic ISP8022
35007b
- 0x1077:0x8032: QLogic ISP8324
35007b
- 0x1077:0x8042: QLogic ISP8042
35007b
35007b
35007b
%prep
5b6c8b
%autosetup -p1 -n %{pkg}-%{driver_version}
35007b
35007b
35007b
%build
35007b
pushd src
35007b
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
35007b
popd
35007b
35007b
35007b
%install
35007b
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
35007b
35007b
# Make .ko objects temporarily executable for automatic stripping
35007b
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
35007b
a23452
# Generate depmod.conf
a23452
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
a23452
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
a23452
do
a23452
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
a23452
done
a23452
35007b
35007b
%clean
35007b
%{__rm} -rf %{buildroot}
35007b
35007b
35007b
%post
35007b
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
a23452
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
35007b
35007b
35007b
%preun
35007b
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
a23452
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
35007b
35007b
35007b
%postun
a23452
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
35007b
then
a23452
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
a23452
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
35007b
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
a23452
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
35007b
fi
35007b
35007b
a23452
%pretrans -p <lua>
a23452
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
a23452
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
a23452
a23452
35007b
%posttrans
a23452
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
35007b
then
a23452
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
a23452
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
35007b
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
a23452
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
35007b
fi
35007b
35007b
35007b
%files
35007b
%defattr(644,root,root,755)
35007b
/lib/modules/%{kernel_version}.%{_arch}
35007b
%license COPYING
a23452
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
35007b
35007b
35007b
%changelog
a23452
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-1
201192
- Convert to kABI tracking kmod package (kernel >= 4.18.0-305.7.1.el8)
201192
- Build 4.18.0-147.el8 for 4.18.0-305.7.1.el8_4
a23452
- Use release number independent of kernel
a23452
- Add driver release number to version
a23452
8ebf43
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.19.1
8ebf43
- Rebuild for 4.18.0-305.19.1.el8_4
8ebf43
8ef103
* Thu Sep  9 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.17.1
8ef103
- Set specific kernel version to use
8ef103
- Rename kernel_version_min to driver_version
8ef103
- Add Provides kernel-modules
8ef103
- Add .%{_arch} to kernel-modules provides version
8ef103
- Rebuild for 4.18.0-305.17.1.el8_4
8ef103
bc3d02
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.12.1
bc3d02
- Rebuild for 4.18.0-305.12.1.el8_4
bc3d02
35007b
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305
35007b
- Initial version