Blame SPECS/kmod-pata_atiixp.spec

23e78f
%global pkg pata_atiixp
23e78f
cde575
%global kernel_version 4.18.0-338.el8
23e78f
23e78f
%global _use_internal_dependency_generator 0
23e78f
%global __find_requires %{nil}
23e78f
%global __find_provides /usr/lib/rpm/find-provides
23e78f
23e78f
%global debug_package %{nil}
23e78f
23e78f
%global __spec_install_post \
23e78f
  %{?__debug_package:%{__debug_install_post}} \
23e78f
  %{__arch_install_post} \
23e78f
  %{__os_install_post} \
23e78f
  %{__mod_compress_install_post}
23e78f
23e78f
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
23e78f
23e78f
23e78f
Name:             kmod-%{pkg}
23e78f
Version:          5.13
cde575
Release:          4%{?dist}
23e78f
Summary:          ATI PATA Controller (%{pkg}) driver
23e78f
23e78f
License:          GPLv2
23e78f
URL:              https://www.kernel.org/
23e78f
23e78f
Source0:          %{pkg}-%{version}.tar.xz
23e78f
23e78f
ExclusiveArch:    x86_64
23e78f
23e78f
BuildRequires:    elfutils-libelf-devel
23e78f
BuildRequires:    gcc
23e78f
BuildRequires:    kmod
23e78f
BuildRequires:    make
23e78f
BuildRequires:    redhat-rpm-config
23e78f
BuildRequires:    xz
23e78f
23e78f
BuildRequires:    kernel-devel = %{kernel_version}
23e78f
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
23e78f
23e78f
Requires:         kernel-core = %{kernel_version}
23e78f
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
23e78f
Requires:         kernel-modules = %{kernel_version}
23e78f
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
23e78f
23e78f
Provides:         installonlypkg(kernel-module)
4b863a
Provides:         kernel-modules = %{kernel_version}.%{_arch}
23e78f
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
23e78f
23e78f
Requires(post):   /usr/sbin/depmod
23e78f
Requires(postun): /usr/sbin/depmod
23e78f
23e78f
Requires(post):   /usr/bin/dracut
23e78f
Requires(postun): /usr/bin/dracut
23e78f
23e78f
23e78f
%description
23e78f
This driver supports ATI PATA interfaces found on many ATI chipsets.
23e78f
23e78f
23e78f
%prep
23e78f
%autosetup -p1 -n %{pkg}-%{version}
23e78f
23e78f
23e78f
%build
23e78f
pushd src
23e78f
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
23e78f
popd
23e78f
23e78f
23e78f
%install
23e78f
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/ata src/%{pkg}.ko
23e78f
%{__install} -d %{buildroot}/%{_sysconfdir}/dracut.conf.d/
23e78f
echo "add_drivers+=\" %{pkg} \"" > %{buildroot}/%{_sysconfdir}/dracut.conf.d/%{pkg}.conf
23e78f
23e78f
# Make .ko objects temporarily executable for automatic stripping
23e78f
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
23e78f
23e78f
23e78f
%clean
23e78f
%{__rm} -rf %{buildroot}
23e78f
23e78f
23e78f
%post
23e78f
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
23e78f
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
23e78f
23e78f
23e78f
%preun
23e78f
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
23e78f
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
23e78f
23e78f
23e78f
%postun
23e78f
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
23e78f
then
23e78f
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
23e78f
    then
23e78f
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
23e78f
    fi
23e78f
23e78f
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
23e78f
    then
23e78f
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
23e78f
        then
23e78f
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
23e78f
            then
23e78f
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
23e78f
            else
23e78f
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
23e78f
            fi
23e78f
        fi
23e78f
    fi
23e78f
23e78f
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
23e78f
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
23e78f
fi
23e78f
23e78f
23e78f
%posttrans
23e78f
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
23e78f
then
23e78f
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
23e78f
    then
23e78f
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
23e78f
    fi
23e78f
23e78f
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
23e78f
    then
23e78f
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
23e78f
        then
23e78f
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
23e78f
            then
23e78f
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
23e78f
            else
23e78f
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
23e78f
            fi
23e78f
        fi
23e78f
    fi
23e78f
23e78f
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
23e78f
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
23e78f
fi
23e78f
23e78f
23e78f
%files
23e78f
%defattr(644,root,root,755)
23e78f
/lib/modules/%{kernel_version}.%{_arch}
23e78f
%license COPYING
23e78f
%config(noreplace) %{_sysconfdir}/dracut.conf.d/%{pkg}.conf
23e78f
23e78f
23e78f
%changelog
cde575
* Mon Aug 30 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.13-4
cde575
- Set specific kernel version to use
cde575
- Add Provides kernel-modules
cde575
- Add .%{_arch} to kernel-modules provides version
cde575
- Rebuild for 4.18.0-338.el8
cde575
a03ad7
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.13-3
a03ad7
- Rebuild for 4.18.0-331.el8
a03ad7
4fe76f
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.13-2
4fe76f
- Rebuild for 4.18.0-326.el8
4fe76f
23e78f
* Mon Aug  9 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.13-1
23e78f
- Initial version