Blame SPECS/kmod-be2iscsi.spec

f30a82
%global pkg be2iscsi
f30a82
3920f4
%global driver_version 4.18.0-257.el8
f30a82
117351
%global kernel_version 4.18.0-331.el8
f30a82
f30a82
%global _use_internal_dependency_generator 0
51121b
%global __find_requires %{nil}
3fec98
%global __find_provides /usr/lib/rpm/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
6fc5cf
Release:          331%{?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
f30a82
BuildRequires:    kmod
f30a82
BuildRequires:    make
f30a82
BuildRequires:    redhat-rpm-config
f30a82
BuildRequires:    xz
f30a82
f30a82
BuildRequires:    kernel-devel = %{kernel_version}
b6feb1
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
f30a82
ce488d
Requires:         kernel-core = %{kernel_version}
b6feb1
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
244acd
Requires:         kernel-modules = %{kernel_version}
b6feb1
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
f30a82
ec4502
Provides:         installonlypkg(kernel-module)
0391fd
Provides:         kernel-modules = %{kernel_version}
e55092
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
f30a82
f30a82
Requires(post):   /usr/sbin/depmod
f30a82
Requires(postun): /usr/sbin/depmod
f30a82
cffd0f
Requires(post):   /usr/bin/dracut
cffd0f
Requires(postun): /usr/bin/dracut
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
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
cffd0f
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
cffd0f
    then
cffd0f
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
cffd0f
        then
cffd0f
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
cffd0f
            then
cffd0f
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
cffd0f
            else
cffd0f
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
cffd0f
            fi
cffd0f
        fi
cffd0f
    fi
cffd0f
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
cffd0f
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
cffd0f
    then
cffd0f
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
cffd0f
        then
cffd0f
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
cffd0f
            then
cffd0f
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
cffd0f
            else
cffd0f
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
cffd0f
            fi
cffd0f
        fi
cffd0f
    fi
cffd0f
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
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