Blame SPECS/kmod-qla4xxx.spec

fcc96f
%global pkg qla4xxx
fcc96f
Kmods SIG dd9ea2
%global driver_version 4.18.0-358.el8
fcc96f
Kmods SIG dd9ea2
%global kernel_version 4.18.0-358.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}
Kmods SIG dd9ea2
Version:          4.18.0.358
376f1a
Release:          3%{?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
768f67
ExclusiveArch:    x86_64 aarch64 ppc64le
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
376f1a
%if "%{version}" == "4.18.0.358" && "%{release}" == "2%{?dist}"
376f1a
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
376f1a
%endif
376f1a
376f1a
%if "%{version}" == "4.18.0.358" && "%{release}" == "3%{?dist}"
376f1a
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
376f1a
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
376f1a
%endif
376f1a
376f1a
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}
4e7f54
%license LICENSES
d7e03e
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
fcc96f
fcc96f
fcc96f
%changelog
376f1a
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-3
376f1a
- Add obsoletes for update path
376f1a
768f67
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-2
768f67
- Enable ppc64le
768f67
Kmods SIG dd9ea2
* Fri Jan 07 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.358-1
Kmods SIG dd9ea2
- Update to 4.18.0-358.el8
Kmods SIG dd9ea2
990746
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.107-4
990746
- Rebuild for 4.18.0-348.el8
990746
34277d
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.107-3
34277d
- Rebuild for 4.18.0-338.el8
34277d
2645d1
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.107-2
2645d1
- Rebuild for 4.18.0-326.el8
2645d1
3771d3
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.107-1
0c56a4
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
cbf91d
- Build 4.18.0-107.el8 for 4.18.0-315.el8
0c56a4
- Use release number independent of kernel
0c56a4
- Add driver release number to version