Blame SPECS/kmod-mptspi.spec

246924
%global pkg mptspi
246924
246924
%global driver_version 5.14.0-1.el9
246924
d8f810
%global kernel_version 5.14.0-2.el9
246924
246924
%global _use_internal_dependency_generator 0
246924
%global __find_requires %{nil}
246924
%global __find_provides /usr/lib/rpm/find-provides
246924
246924
%global debug_package %{nil}
246924
246924
%global __spec_install_post \
246924
  %{?__debug_package:%{__debug_install_post}} \
246924
  %{__arch_install_post} \
246924
  %{__os_install_post} \
246924
  %{__mod_compress_install_post}
246924
246924
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
246924
246924
246924
Name:             kmod-%{pkg}
246924
Version:          5.14.0
d8f810
Release:          2%{?dist}
246924
Summary:          Fusion MPT SPI Host (%{pkg}) driver
246924
246924
License:          GPLv2
246924
URL:              https://www.kernel.org/
246924
246924
Source0:          %{pkg}-%{driver_version}.tar.xz
246924
Patch1:           0001-add-deprecated-ids.patch
246924
Patch2:           0002-remove-unsupported-warning.patch
246924
246924
ExclusiveArch:    x86_64 aarch64
246924
246924
BuildRequires:    elfutils-libelf-devel
246924
BuildRequires:    gcc
246924
BuildRequires:    kmod
246924
BuildRequires:    make
246924
BuildRequires:    redhat-rpm-config
246924
BuildRequires:    xz
246924
246924
BuildRequires:    kernel-devel = %{kernel_version}
246924
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
246924
246924
Requires:         kernel-core = %{kernel_version}
246924
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
246924
Requires:         kernel-modules = %{kernel_version}
246924
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
246924
246924
Provides:         installonlypkg(kernel-module)
246924
Provides:         kernel-modules = %{kernel_version}.%{_arch}
246924
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
246924
246924
Requires(post):   /usr/sbin/depmod
246924
Requires(postun): /usr/sbin/depmod
246924
246924
Requires(post):   /usr/bin/dracut
246924
Requires(postun): /usr/bin/dracut
246924
246924
246924
%description
246924
This package provides the Fusion MPT SPI Host (%{pkg}) driver.  Compared to the
246924
in-kernel driver this driver is not restricted to the virtualization use case.
246924
It supports the following adapters:
246924
246924
- 0x1000:0x0030: LSI 53C1020/53C1020A/53C1030
246924
- 0x1000:0x0040: LSI 53C1035
246924
- 0x117C:0x0030: ATTO UL4D
246924
246924
246924
%prep
246924
%autosetup -p1 -n %{pkg}-%{driver_version}
246924
246924
246924
%build
246924
pushd src
246924
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
246924
popd
246924
246924
246924
%install
246924
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/message/fusion src/%{pkg}.ko
246924
246924
# Make .ko objects temporarily executable for automatic stripping
246924
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
246924
246924
246924
%clean
246924
%{__rm} -rf %{buildroot}
246924
246924
246924
%post
246924
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
246924
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
246924
246924
246924
%preun
246924
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
246924
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
246924
246924
246924
%postun
246924
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
246924
then
246924
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
246924
    then
246924
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
246924
    fi
246924
246924
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
246924
    then
246924
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
246924
        then
246924
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
246924
            then
246924
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
246924
            else
246924
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
246924
            fi
246924
        fi
246924
    fi
246924
246924
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
246924
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
246924
fi
246924
246924
246924
%posttrans
246924
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
246924
then
246924
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
246924
    then
246924
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
246924
    fi
246924
246924
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
246924
    then
246924
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
246924
        then
246924
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
246924
            then
246924
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
246924
            else
246924
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
246924
            fi
246924
        fi
246924
    fi
246924
246924
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
246924
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
246924
fi
246924
246924
246924
%files
246924
%defattr(644,root,root,755)
246924
/lib/modules/%{kernel_version}.%{_arch}
246924
%license COPYING
246924
246924
246924
%changelog
d8f810
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-2
d8f810
- Rebuild for 5.14.0-2.el9
d8f810
246924
* Tue Aug 31 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-1
246924
- Initial version