Blame SPECS/kmod-pata_via.spec

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