Blame SPECS/kmod-jme.spec

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