Blame SPECS/kmod-be2iscsi.spec

f30a82
%global pkg be2iscsi
f30a82
f30a82
%global kernel_version_min 4.18.0-257.el8
f30a82
f30a82
# To pick a specific kernel use `--define "kernel_version 4.18.0-315.el8"`
f30a82
# Otherwise the latest installed kernel-devel version later than
f30a82
# %%{kernel_version_min} will be used.
f30a82
f30a82
%global kernel_version_latest %({ echo %{kernel_version_min}; rpm --query kernel-devel --queryformat '%%{VERSION}-%%{RELEASE}\\\n' | grep -v "package kernel-devel is not installed"; } | sort -V | sed -e '0,/^%{kernel_version_min}$/d' | tail -n 1)
f30a82
f30a82
%if "%{kernel_version_latest}" != ""
f30a82
%{!?kernel_version:%{expand:%%global kernel_version %{kernel_version_latest}}}
f30a82
%endif
f30a82
f30a82
%global _use_internal_dependency_generator 0
f30a82
f30a82
%global debug_package %{nil}
f30a82
f30a82
%global __spec_install_post \
f30a82
  %{?__debug_package:%{__debug_install_post}} \
f30a82
  %{__arch_install_post} \
f30a82
  %{__os_install_post} \
f30a82
  %{__mod_compress_install_post}
f30a82
f30a82
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
f30a82
f30a82
f30a82
Name:             kmod-%{pkg}
f30a82
Version:          4.18.0
56eec4
Release:          326%{?dist}
f30a82
Summary:          Emulex OneConnectOpen-iSCSI (%{pkg}) driver
f30a82
f30a82
License:          GPLv2
f30a82
URL:              https://www.kernel.org/
f30a82
f30a82
Source0:          %{pkg}-%{kernel_version_min}.tar.xz
f30a82
Patch1:           0001-add-deprecated-ids-be3.patch
f30a82
Patch2:           0002-add-deprecated-ids-be2.patch
f30a82
f30a82
ExclusiveArch:    x86_64 aarch64
f30a82
f30a82
BuildRequires:    elfutils-libelf-devel
f30a82
BuildRequires:    gcc
f30a82
BuildRequires:    kernel-abi-whitelists
f30a82
BuildRequires:    kernel-rpm-macros
f30a82
BuildRequires:    kmod
f30a82
BuildRequires:    make
f30a82
BuildRequires:    redhat-rpm-config
f30a82
BuildRequires:    xz
f30a82
f30a82
%{!?kernel_version:
f30a82
BuildRequires:    kernel-devel >= %{kernel_version_min}
f30a82
}
f30a82
f30a82
%{?kernel_version:
f30a82
BuildRequires:    kernel-devel = %{kernel_version}
f30a82
f30a82
Supplements:      kernel = %{kernel_version}
f30a82
ce488d
Requires:         kernel-core = %{kernel_version}
244acd
Requires:         kernel-modules = %{kernel_version}
f30a82
f30a82
Provides:         kernel-modules = %{kernel_version}.%{_arch}
f30a82
}
f30a82
f30a82
Requires(post):   /usr/sbin/depmod
f30a82
Requires(postun): /usr/sbin/depmod
f30a82
f30a82
Provides:         %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
f30a82
f30a82
f30a82
%description
f30a82
This package provides the Emulex OneConnectOpen-iSCSI (%{pkg}) driver. Compared
f30a82
to the in-kernel driver this driver re-enables support for deprecated
f30a82
BladeEngine 2 and 3 adapters.
f30a82
f30a82
BladeEngine 2 (BE2) devices:
f30a82
- 0x19A2:0x0212: Emulex BladeEngine 2 10Gb iSCSI Initiator
f30a82
- 0x19A2:0x0702: Emulex OneConnect OCe10101/OCm10101/OCe10102/OCm10102
f30a82
- 0x19A2:0x0703: Emulex OneConnect OCe10100
f30a82
f30a82
BladeEngine 3 (BE3) devices:
f30a82
- 0x19A2:0x0222: Emulex BladeEngine 3 iSCSI
f30a82
- 0x19A2:0x0712: Emulex OneConnect Tomcat iSCSI
f30a82
f30a82
f30a82
%prep
f30a82
%autosetup -p1 -n %{pkg}-%{kernel_version_min}
f30a82
f30a82
f30a82
%build
f30a82
pushd src
f30a82
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
f30a82
popd
f30a82
f30a82
f30a82
%install
f30a82
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
f30a82
f30a82
# Make .ko objects temporarily executable for automatic stripping
f30a82
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
f30a82
f30a82
f30a82
%clean
f30a82
%{__rm} -rf %{buildroot}
f30a82
f30a82
f30a82
%post
94dffa
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
94dffa
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
94dffa
94dffa
94dffa
%preun
94dffa
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
94dffa
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
f30a82
f30a82
f30a82
%postun
94dffa
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
94dffa
then
94dffa
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
94dffa
    then
94dffa
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
94dffa
    fi
94dffa
94dffa
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
94dffa
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
94dffa
fi
94dffa
94dffa
94dffa
%posttrans
94dffa
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
94dffa
then
94dffa
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
94dffa
    then
94dffa
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
94dffa
    fi
94dffa
94dffa
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
94dffa
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
94dffa
fi
f30a82
f30a82
f30a82
%files
f30a82
%defattr(644,root,root,755)
f30a82
/lib/modules/%{kernel_version}.%{_arch}
f30a82
%license COPYING
f30a82
f30a82
f30a82
%changelog
56eec4
* Thu Jul 29 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
56eec4
- Rebuild for 4.18.0-326.el8
56eec4
f30a82
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-257
f30a82
- Initial version