Blame SPECS/kmod-jme.spec

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