Blame SPECS/kmod-sata_uli.spec

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