Blame SPECS/kmod-mptspi.spec

246924
%global pkg mptspi
246924
246924
%global driver_version 5.14.0-1.el9
246924
Kmods SIG e3eb45
%global kernel_version 5.14.0-36.el9
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}
a01306
Version:          5.14.0.1
Kmods SIG e3eb45
Release:          3%{?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
a01306
BuildRequires:    kernel-rpm-macros
246924
BuildRequires:    kmod
246924
BuildRequires:    make
246924
BuildRequires:    redhat-rpm-config
246924
BuildRequires:    xz
246924
a01306
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
246924
BuildRequires:    kernel-devel = %{kernel_version}
246924
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
246924
a01306
Requires:         kernel >= %{kernel_version}
a01306
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
a01306
Requires:         kernel-modules >= %{kernel_version}
a01306
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
246924
246924
Provides:         installonlypkg(kernel-module)
a01306
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
246924
a01306
Requires(post):   %{_sbindir}/depmod
a01306
Requires(postun): %{_sbindir}/depmod
246924
a01306
Requires(post):   %{_sbindir}/weak-modules
a01306
Requires(postun): %{_sbindir}/weak-modules
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
a01306
# Generate depmod.conf
a01306
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
a01306
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
a01306
do
a01306
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
a01306
done
a01306
246924
246924
%clean
246924
%{__rm} -rf %{buildroot}
246924
246924
246924
%post
246924
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
a01306
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/message/fusion/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
246924
246924
246924
%preun
246924
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
a01306
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
246924
246924
246924
%postun
a01306
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
246924
then
a01306
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
a01306
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
246924
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
a01306
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
246924
fi
246924
246924
a01306
%pretrans -p <lua>
a01306
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
a01306
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
a01306
a01306
246924
%posttrans
a01306
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
246924
then
a01306
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
a01306
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
246924
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
a01306
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
246924
fi
246924
246924
246924
%files
246924
%defattr(644,root,root,755)
246924
/lib/modules/%{kernel_version}.%{_arch}
246924
%license COPYING
a01306
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
246924
246924
246924
%changelog
Kmods SIG e3eb45
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-3
Kmods SIG e3eb45
- Rebuild for 5.14.0-36.el9
Kmods SIG e3eb45
a54ce2
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-2
a54ce2
- Rebuild for 5.14.0-34.el9
a54ce2
- Skip unreleased kernel -32 and -33
Kmods SIG 3f1f74
a01306
* Thu Dec 16 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0.1-1
a01306
- Convert to kABI tracking kmod package (kernel >= 5.14.0-31.el9)