Blame SPECS/kmod-qla2xxx.spec

7dabf7
%global pkg qla2xxx
7dabf7
0d5f7a
%global driver_version 4.18.0-348.el8
7dabf7
0d5f7a
%global kernel_version 4.18.0-348.el8
7dabf7
7dabf7
%global _use_internal_dependency_generator 0
aa41df
%global __find_requires /usr/lib/rpm/redhat/find-requires
aa41df
%global __find_provides /usr/lib/rpm/redhat/find-provides
7dabf7
7dabf7
%global debug_package %{nil}
7dabf7
7dabf7
%global __spec_install_post \
7dabf7
  %{?__debug_package:%{__debug_install_post}} \
7dabf7
  %{__arch_install_post} \
7dabf7
  %{__os_install_post} \
7dabf7
  %{__mod_compress_install_post}
7dabf7
7dabf7
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
7dabf7
7dabf7
7dabf7
Name:             kmod-%{pkg}
0d5f7a
Version:          4.18.0.348
aa41df
Release:          1%{?dist}
7dabf7
Summary:          QLogic Fibre Channel HBA (%{pkg}) driver
7dabf7
7dabf7
License:          GPLv2
7dabf7
URL:              https://www.kernel.org/
7dabf7
6860c1
Source0:          %{pkg}-%{driver_version}.tar.xz
7dabf7
Patch1:           0001-add-deprecated-ids.patch
7dabf7
7dabf7
ExclusiveArch:    x86_64 aarch64
7dabf7
7dabf7
BuildRequires:    elfutils-libelf-devel
7dabf7
BuildRequires:    gcc
aa41df
BuildRequires:    kernel-rpm-macros
7dabf7
BuildRequires:    kmod
7dabf7
BuildRequires:    make
7dabf7
BuildRequires:    redhat-rpm-config
7dabf7
BuildRequires:    xz
7dabf7
aa41df
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
7dabf7
BuildRequires:    kernel-devel = %{kernel_version}
7dabf7
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
7dabf7
aa41df
Requires:         kernel >= %{kernel_version}
aa41df
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
aa41df
Requires:         kernel-modules >= %{kernel_version}
aa41df
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
7dabf7
7dabf7
Provides:         installonlypkg(kernel-module)
aa41df
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
7dabf7
aa41df
Requires(post):   %{_sbindir}/depmod
aa41df
Requires(postun): %{_sbindir}/depmod
7dabf7
aa41df
Requires(post):   %{_sbindir}/weak-modules
aa41df
Requires(postun): %{_sbindir}/weak-modules
7dabf7
7dabf7
7dabf7
%description
7dabf7
This package provides the QLogic Fibre Channel HBA (%{pkg}) driver. Compared to
7dabf7
the in-kernel driver this driver re-enables support for deprecated adapters:
7dabf7
7dabf7
- 0x1077:0x2100: QLogic ISP2100
7dabf7
- 0x1077:0x2200: QLogic ISP2200
7dabf7
- 0x1077:0x2300: QLogic ISP2300
7dabf7
- 0x1077:0x2312: QLogic ISP2312
7dabf7
- 0x1077:0x2322: QLogic ISP2322
7dabf7
- 0x1077:0x2422: QLogic ISP2422
7dabf7
- 0x1077:0x2432: QLogic ISP2432
7dabf7
- 0x1077:0x5422: QLogic ISP5422
7dabf7
- 0x1077:0x5432: QLogic ISP5432 / QLE220
7dabf7
- 0x1077:0x6312: QLogic ISP6312
7dabf7
- 0x1077:0x6322: QLogic ISP6322
7dabf7
- 0x1077:0x8001: QLogic ISP8001 / QLE81xx
7dabf7
- 0x1077:0x8021: QLogic ISP8021 / QLE82xx
7dabf7
- 0x1077:0x8044: QLogic ISP8044 / QLE84xx
7dabf7
- 0x1077:0x8432: QLogic ISP8432 / QLE8000
7dabf7
- 0x1077:0xF001: QLogic ISPF001 / QLE10000
7dabf7
7dabf7
7dabf7
%prep
6860c1
%autosetup -p1 -n %{pkg}-%{driver_version}
7dabf7
7dabf7
7dabf7
%build
7dabf7
pushd src
7dabf7
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
7dabf7
popd
7dabf7
7dabf7
7dabf7
%install
7dabf7
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
7dabf7
7dabf7
# Make .ko objects temporarily executable for automatic stripping
7dabf7
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
7dabf7
aa41df
# Generate depmod.conf
aa41df
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
aa41df
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
aa41df
do
aa41df
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
aa41df
done
aa41df
7dabf7
7dabf7
%clean
7dabf7
%{__rm} -rf %{buildroot}
7dabf7
7dabf7
7dabf7
%post
7dabf7
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
aa41df
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
7dabf7
7dabf7
7dabf7
%preun
7dabf7
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
aa41df
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
7dabf7
7dabf7
7dabf7
%postun
aa41df
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
7dabf7
then
aa41df
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
aa41df
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
7dabf7
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
aa41df
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
7dabf7
fi
7dabf7
7dabf7
aa41df
%pretrans -p <lua>
aa41df
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
aa41df
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
aa41df
aa41df
7dabf7
%posttrans
aa41df
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
7dabf7
then
aa41df
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
aa41df
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
7dabf7
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
aa41df
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
7dabf7
fi
7dabf7
7dabf7
7dabf7
%files
7dabf7
%defattr(644,root,root,755)
7dabf7
/lib/modules/%{kernel_version}.%{_arch}
7dabf7
%license COPYING
aa41df
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
7dabf7
7dabf7
7dabf7
%changelog
0d5f7a
* Tue Nov 09 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.348-1
0d5f7a
- Update to 4.18.0-348.el8
0d5f7a
df4fde
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305.17.1-1
df4fde
- Update to 4.18.0-305.17.1.el8_4
df4fde
aa41df
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-1
33b90b
- Convert to kABI tracking kmod package (kernel >= 4.18.0-305.7.1.el8)
33b90b
- Build 4.18.0-305.el8 for 4.18.0-305.7.1.el8_4
aa41df
- Use release number independent of kernel
aa41df
- Add driver release number to version
aa41df
eebcb4
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.19.1
eebcb4
- Rebuild for 4.18.0-305.19.1.el8_4
eebcb4
d2f33e
* Thu Sep  9 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.17.1
d2f33e
- Set specific kernel version to use
d2f33e
- Rename kernel_version_min to driver_version
d2f33e
- Add Provides kernel-modules
d2f33e
- Add .%{_arch} to kernel-modules provides version
d2f33e
- Update to 4.18.0-305.17.1.el8_4
d2f33e
41a6a1
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305.12.1
41a6a1
- Rebuild for 4.18.0-305.12.1.el8_4
41a6a1
7dabf7
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305
7dabf7
- Initial version