Blame SPECS/kmod-mptsas.spec

3e045e
%global pkg mptsas
3e045e
Kmods SIG 3f8a25
%global driver_version 4.18.0-373.el8
3e045e
Kmods SIG 3f8a25
%global kernel_version 4.18.0-373.el8
3e045e
3e045e
%global _use_internal_dependency_generator 0
f3cfde
%global __find_requires /usr/lib/rpm/redhat/find-requires
f3cfde
%global __find_provides /usr/lib/rpm/redhat/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}
Kmods SIG 3f8a25
Version:          4.18.0.373
Kmods SIG 3f8a25
Release:          1%{?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
c7528f
ExclusiveArch:    x86_64 aarch64 ppc64le
3e045e
3e045e
BuildRequires:    elfutils-libelf-devel
3e045e
BuildRequires:    gcc
f3cfde
BuildRequires:    kernel-rpm-macros
3e045e
BuildRequires:    kmod
3e045e
BuildRequires:    make
3e045e
BuildRequires:    redhat-rpm-config
3e045e
BuildRequires:    xz
3e045e
f3cfde
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
3e045e
BuildRequires:    kernel-devel = %{kernel_version}
a2e156
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
3e045e
f3cfde
Requires:         kernel >= %{kernel_version}
f3cfde
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
f3cfde
Requires:         kernel-modules >= %{kernel_version}
f3cfde
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
3e045e
5161fe
Provides:         installonlypkg(kernel-module)
f3cfde
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
3e045e
f3cfde
Requires(post):   %{_sbindir}/depmod
f3cfde
Requires(postun): %{_sbindir}/depmod
3e045e
f3cfde
Requires(post):   %{_sbindir}/weak-modules
f3cfde
Requires(postun): %{_sbindir}/weak-modules
d9732c
3e045e
bf5777
%if "%{version}" == "4.18.0.326" && "%{release}" == "3%{?dist}"
bf5777
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
bf5777
%endif
bf5777
bf5777
%if "%{version}" == "4.18.0.326" && "%{release}" == "4%{?dist}"
bf5777
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
bf5777
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-3%{?dist}
bf5777
%endif
bf5777
bf5777
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
f3cfde
# Generate depmod.conf
f3cfde
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
f3cfde
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
f3cfde
do
f3cfde
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
f3cfde
done
f3cfde
3e045e
3e045e
%clean
3e045e
%{__rm} -rf %{buildroot}
3e045e
3e045e
3e045e
%post
4f866f
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f3cfde
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/message/fusion/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
4f866f
4f866f
4f866f
%preun
4f866f
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f3cfde
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
3e045e
3e045e
3e045e
%postun
f3cfde
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
4f866f
then
f3cfde
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
f3cfde
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
4f866f
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f3cfde
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
4f866f
fi
4f866f
4f866f
f3cfde
%pretrans -p <lua>
f3cfde
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
f3cfde
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
f3cfde
f3cfde
4f866f
%posttrans
f3cfde
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
4f866f
then
f3cfde
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
f3cfde
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
4f866f
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f3cfde
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
4f866f
fi
3e045e
3e045e
3e045e
%files
3e045e
%defattr(644,root,root,755)
3e045e
/lib/modules/%{kernel_version}.%{_arch}
a0bd8a
%license LICENSES
f3cfde
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
3e045e
3e045e
3e045e
%changelog
Kmods SIG 3f8a25
* Tue Mar 22 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.373-1
Kmods SIG 3f8a25
- Update to 4.18.0-373.el8
Kmods SIG 3f8a25
bf5777
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.326-4
bf5777
- Add obsoletes for update path
bf5777
c7528f
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.326-3
c7528f
- Enable ppc64le
c7528f
Kmods SIG 8e05aa
* Mon Jan 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.326-2
Kmods SIG 8e05aa
- Rebuild for 4.18.0-358.el8
Kmods SIG 8e05aa
25dd33
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.326-1
25dd33
- Update to 4.18.0-326.el8
25dd33
a808ba
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.80-1
713a15
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
286b41
- Build 4.18.0-80.el8 for 4.18.0-315.el8
713a15
- Use release number independent of kernel
713a15
- Add driver release number to version