Blame SPECS/kmod-sata_nv.spec

a308b0
%global pkg sata_nv
a308b0
Kmods SIG b392b9
%global kernel_version 4.18.0-358.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}
a308b0
Version:          5.4
Kmods SIG b392b9
Release:          6%{?dist}
a308b0
Summary:          nVidia SATA Controller (%{pkg}) driver
a308b0
a308b0
License:          GPLv2
a308b0
URL:              https://www.kernel.org/
a308b0
a308b0
Source0:          %{pkg}-%{version}.tar.xz
a308b0
a308b0
ExclusiveArch:    x86_64
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
a308b0
%description
a308b0
This driver supports nVidia SATA controllers.
a308b0
a308b0
a308b0
%prep
a308b0
%autosetup -p1 -n %{pkg}-%{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
%{__install} -d %{buildroot}/%{_sysconfdir}/dracut.conf.d/
a308b0
echo "add_drivers+=\" %{pkg} \"" > %{buildroot}/%{_sysconfdir}/dracut.conf.d/%{pkg}.conf
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}
a308b0
%license COPYING
a308b0
%config(noreplace) %{_sysconfdir}/dracut.conf.d/%{pkg}.conf
a308b0
a308b0
a308b0
%changelog
Kmods SIG b392b9
* Mon Jan 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.4-6
Kmods SIG b392b9
- Rebuild for 4.18.0-358.el8
Kmods SIG b392b9
8144c0
* Tue Sep 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.4-5
8144c0
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)