Blame SPECS/kmod-pata_atiixp.spec

439b75
%global pkg pata_atiixp
439b75
Kmods SIG e821f1
%global driver_version 4.18.0-80.el8
Kmods SIG e821f1
Kmods SIG e821f1
%global kernel_version 4.18.0-348.el8
439b75
439b75
%global _use_internal_dependency_generator 0
36b1de
%global __find_requires /usr/lib/rpm/redhat/find-requires
36b1de
%global __find_provides /usr/lib/rpm/redhat/find-provides
439b75
439b75
%global debug_package %{nil}
439b75
439b75
%global __spec_install_post \
439b75
  %{?__debug_package:%{__debug_install_post}} \
439b75
  %{__arch_install_post} \
439b75
  %{__os_install_post} \
439b75
  %{__mod_compress_install_post}
439b75
439b75
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
439b75
439b75
439b75
Name:             kmod-%{pkg}
Kmods SIG e821f1
Version:          4.18.0.80
49b8b6
Release:          2%{?dist}
439b75
Summary:          ATI PATA Controller (%{pkg}) driver
439b75
439b75
License:          GPLv2
439b75
URL:              https://www.kernel.org/
439b75
Kmods SIG e821f1
Source0:          %{pkg}-%{driver_version}.tar.xz
439b75
439b75
ExclusiveArch:    x86_64
439b75
439b75
BuildRequires:    elfutils-libelf-devel
439b75
BuildRequires:    gcc
36b1de
BuildRequires:    kernel-rpm-macros
439b75
BuildRequires:    kmod
439b75
BuildRequires:    make
439b75
BuildRequires:    redhat-rpm-config
439b75
BuildRequires:    xz
439b75
36b1de
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
439b75
BuildRequires:    kernel-devel = %{kernel_version}
439b75
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
439b75
36b1de
Requires:         kernel >= %{kernel_version}
36b1de
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
36b1de
Requires:         kernel-modules >= %{kernel_version}
36b1de
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
439b75
439b75
Provides:         installonlypkg(kernel-module)
36b1de
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
439b75
36b1de
Requires(post):   %{_sbindir}/depmod
36b1de
Requires(postun): %{_sbindir}/depmod
439b75
36b1de
Requires(post):   %{_sbindir}/weak-modules
36b1de
Requires(postun): %{_sbindir}/weak-modules
439b75
439b75
439b75
%description
439b75
This driver supports ATI PATA interfaces found on many ATI chipsets.
439b75
439b75
439b75
%prep
Kmods SIG e821f1
%autosetup -p1 -n %{pkg}-%{driver_version}
439b75
439b75
439b75
%build
439b75
pushd src
439b75
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
439b75
popd
439b75
439b75
439b75
%install
439b75
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/ata src/%{pkg}.ko
439b75
439b75
# Make .ko objects temporarily executable for automatic stripping
439b75
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
439b75
439b75
439b75
%clean
439b75
%{__rm} -rf %{buildroot}
439b75
439b75
439b75
%post
439b75
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
36b1de
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/ata/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
439b75
439b75
439b75
%preun
439b75
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
36b1de
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
439b75
439b75
439b75
%postun
36b1de
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
439b75
then
36b1de
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
36b1de
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
439b75
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
36b1de
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
439b75
fi
439b75
439b75
36b1de
%pretrans -p <lua>
36b1de
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
36b1de
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
36b1de
36b1de
439b75
%posttrans
36b1de
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
439b75
then
36b1de
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
36b1de
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
439b75
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
36b1de
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
439b75
fi
439b75
439b75
439b75
%files
439b75
%defattr(644,root,root,755)
439b75
/lib/modules/%{kernel_version}.%{_arch}
3b12a4
%license LICENSES
439b75
439b75
439b75
%changelog
49b8b6
* Wed Jan 26 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.80-2
49b8b6
- Drop dracut conf
49b8b6
Kmods SIG e821f1
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.80-1
Kmods SIG e821f1
- Switch to EL kernel source and versioning
Kmods SIG e821f1
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)