Blame SPECS/kmod-mvsas.spec

b53785
%global pkg mvsas
b53785
Kmods SIG ea320e
%global driver_version 4.18.0-80.el8
Kmods SIG ea320e
Kmods SIG e7ae2a
%global kernel_version 4.18.0-372.9.1.el8
b53785
b53785
%global _use_internal_dependency_generator 0
46e7e9
%global __find_requires /usr/lib/rpm/redhat/find-requires
46e7e9
%global __find_provides /usr/lib/rpm/redhat/find-provides
b53785
b53785
%global debug_package %{nil}
b53785
b53785
%global __spec_install_post \
b53785
  %{?__debug_package:%{__debug_install_post}} \
b53785
  %{__arch_install_post} \
b53785
  %{__os_install_post} \
b53785
  %{__mod_compress_install_post}
b53785
b53785
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
b53785
b53785
b53785
Name:             kmod-%{pkg}
Kmods SIG ea320e
Version:          4.18.0.80
Kmods SIG e7ae2a
Release:          5%{?dist}
b53785
Summary:          Marvell 88SE64XX/88SE94XX SAS/SATA Controller (%{pkg}) driver
b53785
b53785
License:          GPLv2
b53785
URL:              https://www.kernel.org/
b53785
Kmods SIG ea320e
Source0:          %{pkg}-%{driver_version}.tar.xz
Kmods SIG ea320e
Patch9999:        9999-enable-mvsas.patch
b53785
3ecd10
ExclusiveArch:    x86_64 aarch64 ppc64le
b53785
b53785
BuildRequires:    elfutils-libelf-devel
b53785
BuildRequires:    gcc
46e7e9
BuildRequires:    kernel-rpm-macros
b53785
BuildRequires:    kmod
b53785
BuildRequires:    make
b53785
BuildRequires:    redhat-rpm-config
b53785
BuildRequires:    xz
b53785
46e7e9
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
b53785
BuildRequires:    kernel-devel = %{kernel_version}
b53785
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
b53785
46e7e9
Requires:         kernel >= %{kernel_version}
46e7e9
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
46e7e9
Requires:         kernel-modules >= %{kernel_version}
46e7e9
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
b53785
b53785
Provides:         installonlypkg(kernel-module)
46e7e9
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
b53785
46e7e9
Requires(post):   %{_sbindir}/depmod
46e7e9
Requires(postun): %{_sbindir}/depmod
b53785
46e7e9
Requires(post):   %{_sbindir}/weak-modules
46e7e9
Requires(postun): %{_sbindir}/weak-modules
b53785
b53785
d86b68
%if "%{version}" == "4.18.0.80" && "%{release}" == "2%{?dist}"
d86b68
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
d86b68
%endif
d86b68
d86b68
%if "%{version}" == "4.18.0.80" && "%{release}" == "3%{?dist}"
d86b68
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
d86b68
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
d86b68
%endif
d86b68
d86b68
%if "%{version}" == "4.18.0.80" && "%{release}" == "4%{?dist}"
d86b68
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
d86b68
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
d86b68
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-3%{?dist}
d86b68
%endif
d86b68
d86b68
b53785
%description
b53785
This driver supports Marvell's SAS/SATA 3Gb/s 88SE64XX and 6Gb/s 88SE94XX
b53785
chip based PCI-E host adapters.
b53785
b53785
b53785
%prep
Kmods SIG ea320e
%autosetup -p1 -n %{pkg}-%{driver_version}
b53785
b53785
b53785
%build
b53785
pushd src
b53785
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
b53785
popd
b53785
b53785
b53785
%install
b53785
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
b53785
b53785
# Make .ko objects temporarily executable for automatic stripping
b53785
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
b53785
b53785
b53785
%clean
b53785
%{__rm} -rf %{buildroot}
b53785
b53785
b53785
%post
b53785
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
46e7e9
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
b53785
b53785
b53785
%preun
b53785
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
46e7e9
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
b53785
b53785
b53785
%postun
46e7e9
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
b53785
then
46e7e9
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
46e7e9
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
b53785
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
46e7e9
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
b53785
fi
b53785
b53785
46e7e9
%pretrans -p <lua>
46e7e9
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
46e7e9
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
46e7e9
46e7e9
b53785
%posttrans
46e7e9
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
b53785
then
46e7e9
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
46e7e9
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
b53785
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
46e7e9
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
b53785
fi
b53785
b53785
b53785
%files
b53785
%defattr(644,root,root,755)
b53785
/lib/modules/%{kernel_version}.%{_arch}
8483cd
%license LICENSES
b53785
b53785
b53785
%changelog
Kmods SIG e7ae2a
* Tue May 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.80-5
Kmods SIG e7ae2a
- Rebuild for 4.18.0-372.9.1.el8
Kmods SIG e7ae2a
d86b68
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.80-4
d86b68
- Add obsoletes for update path
d86b68
6f94f9
* Wed Jan 26 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.80-3
6f94f9
- Drop dracut conf
6f94f9
3ecd10
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.80-2
3ecd10
- Enable ppc64le
3ecd10
Kmods SIG ea320e
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.80-1
Kmods SIG ea320e
- Switch to EL kernel source and versioning
Kmods SIG ea320e
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)