Blame SPECS/kmod-be2iscsi.spec

f30a82
%global pkg be2iscsi
f30a82
3920f4
%global driver_version 4.18.0-257.el8
f30a82
f2b23e
%global kernel_version 4.18.0-326.el8
f30a82
f30a82
%global _use_internal_dependency_generator 0
f2b23e
%global __find_requires /usr/lib/rpm/redhat/find-requires
f2b23e
%global __find_provides /usr/lib/rpm/redhat/find-provides
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
f2b23e
Release:          348%{?dist}
f30a82
Summary:          Emulex OneConnectOpen-iSCSI (%{pkg}) driver
f30a82
f30a82
License:          GPLv2
f30a82
URL:              https://www.kernel.org/
f30a82
3920f4
Source0:          %{pkg}-%{driver_version}.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
f2b23e
BuildRequires:    kernel-rpm-macros
f30a82
BuildRequires:    kmod
f30a82
BuildRequires:    make
f30a82
BuildRequires:    redhat-rpm-config
f30a82
BuildRequires:    xz
f30a82
f2b23e
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
f30a82
BuildRequires:    kernel-devel = %{kernel_version}
b6feb1
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
f30a82
f2b23e
Requires:         kernel >= %{kernel_version}
f2b23e
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
f2b23e
Requires:         kernel-modules >= %{kernel_version}
f2b23e
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
f30a82
ec4502
Provides:         installonlypkg(kernel-module)
f2b23e
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
f30a82
f2b23e
Requires(post):   %{_sbindir}/depmod
f2b23e
Requires(postun): %{_sbindir}/depmod
f30a82
f2b23e
Requires(post):   %{_sbindir}/weak-modules
f2b23e
Requires(postun): %{_sbindir}/weak-modules
cffd0f
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
3920f4
%autosetup -p1 -n %{pkg}-%{driver_version}
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
f2b23e
# Generate depmod.conf
f2b23e
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
f2b23e
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
f2b23e
do
f2b23e
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
f2b23e
done
f2b23e
f30a82
f30a82
%clean
f30a82
%{__rm} -rf %{buildroot}
f30a82
f30a82
f30a82
%post
94dffa
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f2b23e
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
94dffa
94dffa
94dffa
%preun
94dffa
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f2b23e
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
f30a82
f30a82
f30a82
%postun
f2b23e
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
94dffa
then
f2b23e
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
f2b23e
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
94dffa
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f2b23e
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
94dffa
fi
94dffa
94dffa
f2b23e
%pretrans -p <lua>
f2b23e
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
f2b23e
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
f2b23e
f2b23e
94dffa
%posttrans
f2b23e
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
94dffa
then
f2b23e
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
f2b23e
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
94dffa
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f2b23e
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
94dffa
fi
f30a82
f30a82
f30a82
%files
f30a82
%defattr(644,root,root,755)
f30a82
/lib/modules/%{kernel_version}.%{_arch}
f30a82
%license COPYING
f2b23e
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
f30a82
f30a82
f30a82
%changelog
f2b23e
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-348
f2b23e
- Convert to kABI tracking kmod package (kernel >= 4.18.0-326.el8)
f2b23e
51a653
* Mon Aug 30 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-338
51a653
- Set specific kernel version to use
51a653
- Rename kernel_version_min to driver_version
51a653
- Add Provides kernel-modules
51a653
- Rebuild for 4.18.0-338.el8
51a653
6fc5cf
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-331
6fc5cf
- Rebuild for 4.18.0-331.el8
6fc5cf
17b902
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
56eec4
- Rebuild for 4.18.0-326.el8
17b902
- Fix provides/requires
17b902
- Fix kernel dependencies
17b902
- Add convenient provides kmod-aacraid-`uname -r`
17b902
- Fix installonlypkg detection
17b902
- Recreate source tarballs
17b902
- Rebuild for dist = .el8s
17b902
17b902
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-257
f30a82
- Initial version