Blame SPECS/kmod-mptsas.spec

3e045e
%global pkg mptsas
3e045e
e2d70e
%global driver_version 4.18.0-326.el8
3e045e
c08094
%global kernel_version 4.18.0-331.el8
3e045e
3e045e
%global _use_internal_dependency_generator 0
93c6f2
%global __find_requires %{nil}
5337fd
%global __find_provides /usr/lib/rpm/find-provides
3e045e
3e045e
%global debug_package %{nil}
3e045e
3e045e
%global __spec_install_post \
3e045e
  %{?__debug_package:%{__debug_install_post}} \
3e045e
  %{__arch_install_post} \
3e045e
  %{__os_install_post} \
3e045e
  %{__mod_compress_install_post}
3e045e
3e045e
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
3e045e
3e045e
3e045e
Name:             kmod-%{pkg}
3e045e
Version:          4.18.0
dbff9c
Release:          331%{?dist}
3e045e
Summary:          Fusion MPT SAS Host (%{pkg}) driver
3e045e
3e045e
License:          GPLv2
3e045e
URL:              https://www.kernel.org/
3e045e
e2d70e
Source0:          %{pkg}-%{driver_version}.tar.xz
3e045e
Patch1:           0001-add-deprecated-ids.patch
3e045e
3e045e
ExclusiveArch:    x86_64 aarch64
3e045e
3e045e
BuildRequires:    elfutils-libelf-devel
3e045e
BuildRequires:    gcc
3e045e
BuildRequires:    kmod
3e045e
BuildRequires:    make
3e045e
BuildRequires:    redhat-rpm-config
3e045e
BuildRequires:    xz
3e045e
3e045e
BuildRequires:    kernel-devel = %{kernel_version}
a2e156
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
3e045e
29a974
Requires:         kernel-core = %{kernel_version}
a2e156
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
ef7c7f
Requires:         kernel-modules = %{kernel_version}
a2e156
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
3e045e
5161fe
Provides:         installonlypkg(kernel-module)
781cce
Provides:         kernel-modules = %{kernel_version}
72d95b
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
3e045e
3e045e
Requires(post):   /usr/sbin/depmod
3e045e
Requires(postun): /usr/sbin/depmod
3e045e
d9732c
Requires(post):   /usr/bin/dracut
d9732c
Requires(postun): /usr/bin/dracut
d9732c
3e045e
3e045e
%description
3e045e
This package provides the Fusion MPT SAS Host (%{pkg}) driver.  Compared to the
3e045e
in-kernel driver this driver is not restricted to the virtualization use case.
3e045e
It supports the following adapters:
3e045e
3e045e
- 0x1000:0x0050: LSI SAS1064
3e045e
- 0x1000:0x0054: LSI SAS1068
3e045e
- 0x1000:0x0056: LSI SAS1064E
3e045e
- 0x1000:0x0058: LSI SAS1068E
3e045e
- 0x1000:0x0059: LSI SAS1068_820XELP
3e045e
- 0x1000:0x0062: LSI SAS1078
3e045e
3e045e
3e045e
%prep
e2d70e
%autosetup -p1 -n %{pkg}-%{driver_version}
3e045e
3e045e
3e045e
%build
3e045e
pushd src
3e045e
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
3e045e
popd
3e045e
3e045e
3e045e
%install
3e045e
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/message/fusion src/%{pkg}.ko
3e045e
3e045e
# Make .ko objects temporarily executable for automatic stripping
3e045e
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
3e045e
3e045e
3e045e
%clean
3e045e
%{__rm} -rf %{buildroot}
3e045e
3e045e
3e045e
%post
4f866f
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
4f866f
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
4f866f
4f866f
4f866f
%preun
4f866f
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
4f866f
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
3e045e
3e045e
3e045e
%postun
4f866f
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
4f866f
then
4f866f
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
4f866f
    then
4f866f
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
4f866f
    fi
4f866f
d9732c
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
d9732c
    then
d9732c
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
d9732c
        then
d9732c
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
d9732c
            then
d9732c
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
d9732c
            else
d9732c
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
d9732c
            fi
d9732c
        fi
d9732c
    fi
d9732c
4f866f
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
4f866f
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
4f866f
fi
4f866f
4f866f
4f866f
%posttrans
4f866f
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
4f866f
then
4f866f
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
4f866f
    then
4f866f
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
4f866f
    fi
4f866f
d9732c
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
d9732c
    then
d9732c
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
d9732c
        then
d9732c
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
d9732c
            then
d9732c
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
d9732c
            else
d9732c
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
d9732c
            fi
d9732c
        fi
d9732c
    fi
d9732c
4f866f
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
4f866f
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
4f866f
fi
3e045e
3e045e
3e045e
%files
3e045e
%defattr(644,root,root,755)
3e045e
/lib/modules/%{kernel_version}.%{_arch}
3e045e
%license COPYING
3e045e
3e045e
3e045e
%changelog
dbff9c
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-331
dbff9c
- Rebuild for 4.18.0-331.el8
dbff9c
8bbef9
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
5ef591
- Update to 4.18.0-326.el8
8bbef9
- Fix provides/requires
8bbef9
- Fix kernel dependencies
8bbef9
- Add convenient provides kmod-aacraid-`uname -r`
8bbef9
- Fix installonlypkg detection
8bbef9
- Recreate source tarballs
8bbef9
- Rebuild for dist = .el8s
8bbef9
8bbef9
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-293
3e045e
- Initial version