Blame SPECS/kmod-sata_nv.spec

a308b0
%global pkg sata_nv
a308b0
Kmods SIG 832f68
%global driver_version 4.18.0-358.el8
Kmods SIG 0bc477
Kmods SIG 8253f3
%global kernel_version 4.18.0-394.el8
a308b0
a308b0
%global _use_internal_dependency_generator 0
8144c0
%global __find_requires /usr/lib/rpm/redhat/find-requires
8144c0
%global __find_provides /usr/lib/rpm/redhat/find-provides
a308b0
a308b0
%global debug_package %{nil}
a308b0
a308b0
%global __spec_install_post \
a308b0
  %{?__debug_package:%{__debug_install_post}} \
a308b0
  %{__arch_install_post} \
a308b0
  %{__os_install_post} \
a308b0
  %{__mod_compress_install_post}
a308b0
a308b0
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
a308b0
a308b0
a308b0
Name:             kmod-%{pkg}
Kmods SIG 832f68
Version:          4.18.0.358
Kmods SIG 8253f3
Release:          5%{?dist}
a308b0
Summary:          nVidia SATA Controller (%{pkg}) driver
a308b0
7fcdb4
License:          GPLv2 and GPLv2+
a308b0
URL:              https://www.kernel.org/
a308b0
Kmods SIG 0bc477
Source0:          %{pkg}-%{driver_version}.tar.xz
a308b0
dfa352
ExclusiveArch:    x86_64 ppc64le
a308b0
a308b0
BuildRequires:    elfutils-libelf-devel
a308b0
BuildRequires:    gcc
8144c0
BuildRequires:    kernel-rpm-macros
a308b0
BuildRequires:    kmod
a308b0
BuildRequires:    make
a308b0
BuildRequires:    redhat-rpm-config
a308b0
BuildRequires:    xz
a308b0
8144c0
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
a308b0
BuildRequires:    kernel-devel = %{kernel_version}
a308b0
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
a308b0
8144c0
Requires:         kernel >= %{kernel_version}
8144c0
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
8144c0
Requires:         kernel-modules >= %{kernel_version}
8144c0
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
a308b0
a308b0
Provides:         installonlypkg(kernel-module)
8144c0
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
a308b0
8144c0
Requires(post):   %{_sbindir}/depmod
8144c0
Requires(postun): %{_sbindir}/depmod
a308b0
8144c0
Requires(post):   %{_sbindir}/weak-modules
8144c0
Requires(postun): %{_sbindir}/weak-modules
a308b0
a308b0
5c91c8
%if "%{version}" == "4.18.0.358" && "%{release}" == "2%{?dist}"
5c91c8
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
5c91c8
%endif
5c91c8
5c91c8
%if "%{version}" == "4.18.0.358" && "%{release}" == "3%{?dist}"
5c91c8
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
5c91c8
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
5c91c8
%endif
5c91c8
5c91c8
%if "%{version}" == "4.18.0.358" && "%{release}" == "4%{?dist}"
5c91c8
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
5c91c8
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
5c91c8
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-3%{?dist}
5c91c8
%endif
5c91c8
5c91c8
a308b0
%description
a308b0
This driver supports nVidia SATA controllers.
a308b0
a308b0
a308b0
%prep
Kmods SIG 0bc477
%autosetup -p1 -n %{pkg}-%{driver_version}
a308b0
a308b0
a308b0
%build
a308b0
pushd src
a308b0
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
a308b0
popd
a308b0
a308b0
a308b0
%install
a308b0
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/ata src/%{pkg}.ko
a308b0
a308b0
# Make .ko objects temporarily executable for automatic stripping
a308b0
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
a308b0
a308b0
a308b0
%clean
a308b0
%{__rm} -rf %{buildroot}
a308b0
a308b0
a308b0
%post
a308b0
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
8144c0
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/ata/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
a308b0
a308b0
a308b0
%preun
a308b0
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
8144c0
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
a308b0
a308b0
a308b0
%postun
8144c0
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
a308b0
then
8144c0
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
8144c0
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
a308b0
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
8144c0
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
a308b0
fi
a308b0
a308b0
8144c0
%pretrans -p <lua>
8144c0
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
8144c0
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
8144c0
8144c0
a308b0
%posttrans
8144c0
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
a308b0
then
8144c0
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
8144c0
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
a308b0
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
8144c0
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
a308b0
fi
a308b0
a308b0
a308b0
%files
a308b0
%defattr(644,root,root,755)
a308b0
/lib/modules/%{kernel_version}.%{_arch}
4bb96d
%license LICENSES
a308b0
a308b0
a308b0
%changelog
Kmods SIG 8253f3
* Fri Jun 03 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.358-5
Kmods SIG 8253f3
- Rebuild for 4.18.0-394.el8
Kmods SIG 8253f3
5c91c8
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-4
5c91c8
- Add obsoletes for update path
5c91c8
4927cb
* Wed Jan 26 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-3
4927cb
- Drop dracut conf
4927cb
dfa352
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-2
dfa352
- Enable ppc64le
dfa352
Kmods SIG 832f68
* Mon Jan 17 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.358-1
Kmods SIG 832f68
- Update to 4.18.0-358.el8
Kmods SIG 832f68
Kmods SIG 0bc477
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.80-1
Kmods SIG 0bc477
- Switch to EL kernel source and versioning
Kmods SIG 0bc477
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)