Blame SPECS/kmod-be2iscsi.spec

19d00e
%global pkg be2iscsi
19d00e
19d00e
%global driver_version 5.14.0-1.el9
19d00e
Kmods SIG ccf198
%global kernel_version 5.14.0-32.el9
19d00e
19d00e
%global debug_package %{nil}
19d00e
19d00e
%global __spec_install_post \
19d00e
  %{?__debug_package:%{__debug_install_post}} \
19d00e
  %{__arch_install_post} \
19d00e
  %{__os_install_post} \
19d00e
  %{__mod_compress_install_post}
19d00e
19d00e
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
19d00e
19d00e
19d00e
Name:             kmod-%{pkg}
efcf17
Version:          5.14.0.1
Kmods SIG ccf198
Release:          2%{?dist}
19d00e
Summary:          Emulex OneConnectOpen-iSCSI (%{pkg}) driver
19d00e
19d00e
License:          GPLv2
19d00e
URL:              https://www.kernel.org/
19d00e
19d00e
Source0:          %{pkg}-%{driver_version}.tar.xz
19d00e
Patch1:           0001-add-deprecated-ids.patch
19d00e
19d00e
ExclusiveArch:    x86_64 aarch64
19d00e
19d00e
BuildRequires:    elfutils-libelf-devel
19d00e
BuildRequires:    gcc
efcf17
BuildRequires:    kernel-rpm-macros
19d00e
BuildRequires:    kmod
19d00e
BuildRequires:    make
19d00e
BuildRequires:    redhat-rpm-config
19d00e
BuildRequires:    xz
19d00e
efcf17
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
19d00e
BuildRequires:    kernel-devel = %{kernel_version}
19d00e
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
19d00e
efcf17
Requires:         kernel >= %{kernel_version}
efcf17
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
efcf17
Requires:         kernel-modules >= %{kernel_version}
efcf17
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
19d00e
19d00e
Provides:         installonlypkg(kernel-module)
efcf17
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
19d00e
efcf17
Requires(post):   %{_sbindir}/depmod
efcf17
Requires(postun): %{_sbindir}/depmod
19d00e
efcf17
Requires(post):   %{_sbindir}/weak-modules
efcf17
Requires(postun): %{_sbindir}/weak-modules
19d00e
19d00e
19d00e
%description
19d00e
This package provides the Emulex OneConnectOpen-iSCSI (%{pkg}) driver. Compared
19d00e
to the in-kernel driver this driver re-enables support for deprecated
19d00e
BladeEngine 2 and 3 adapters.
19d00e
19d00e
BladeEngine 2 (BE2) devices:
19d00e
- 0x19A2:0x0212: Emulex BladeEngine 2 10Gb iSCSI Initiator
19d00e
- 0x19A2:0x0702: Emulex OneConnect OCe10101/OCm10101/OCe10102/OCm10102
19d00e
- 0x19A2:0x0703: Emulex OneConnect OCe10100
19d00e
19d00e
BladeEngine 3 (BE3) devices:
19d00e
- 0x19A2:0x0222: Emulex BladeEngine 3 iSCSI
19d00e
- 0x19A2:0x0712: Emulex OneConnect Tomcat iSCSI
19d00e
19d00e
19d00e
%prep
19d00e
%autosetup -p1 -n %{pkg}-%{driver_version}
19d00e
19d00e
19d00e
%build
19d00e
pushd src
19d00e
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
19d00e
popd
19d00e
19d00e
19d00e
%install
19d00e
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
19d00e
19d00e
# Make .ko objects temporarily executable for automatic stripping
19d00e
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
19d00e
efcf17
# Generate depmod.conf
efcf17
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
efcf17
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
efcf17
do
efcf17
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
efcf17
done
efcf17
19d00e
19d00e
%clean
19d00e
%{__rm} -rf %{buildroot}
19d00e
19d00e
19d00e
%post
19d00e
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
efcf17
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
19d00e
19d00e
19d00e
%preun
19d00e
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
efcf17
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
19d00e
19d00e
19d00e
%postun
efcf17
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
19d00e
then
efcf17
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
efcf17
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
19d00e
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
efcf17
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
19d00e
fi
19d00e
19d00e
efcf17
%pretrans -p <lua>
efcf17
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
efcf17
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
efcf17
efcf17
19d00e
%posttrans
efcf17
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
19d00e
then
efcf17
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
efcf17
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
19d00e
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
efcf17
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
19d00e
fi
19d00e
19d00e
19d00e
%files
19d00e
%defattr(644,root,root,755)
19d00e
/lib/modules/%{kernel_version}.%{_arch}
19d00e
%license COPYING
efcf17
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
19d00e
19d00e
19d00e
%changelog
Kmods SIG ccf198
* Thu Dec 16 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-2
Kmods SIG ccf198
- Rebuild for 5.14.0-32.el9
Kmods SIG ccf198
efcf17
* Thu Dec 16 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0.1-1
efcf17
- Convert to kABI tracking kmod package (kernel >= 5.14.0-31.el9)