Blame SPECS/kmod-jme.spec

a463fa
%global pkg jme
a463fa
30e6cf
%global kernel_version 4.18.0-315.el8
a463fa
a463fa
%global _use_internal_dependency_generator 0
30e6cf
%global __find_requires /usr/lib/rpm/redhat/find-requires
30e6cf
%global __find_provides /usr/lib/rpm/redhat/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
30e6cf
Release:          2%{?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
30e6cf
BuildRequires:    kernel-rpm-macros
a463fa
BuildRequires:    kmod
a463fa
BuildRequires:    make
a463fa
BuildRequires:    redhat-rpm-config
a463fa
BuildRequires:    xz
a463fa
30e6cf
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
a463fa
BuildRequires:    kernel-devel = %{kernel_version}
a463fa
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
a463fa
30e6cf
Requires:         kernel >= %{kernel_version}
30e6cf
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
30e6cf
Requires:         kernel-modules >= %{kernel_version}
30e6cf
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
a463fa
a463fa
Provides:         installonlypkg(kernel-module)
30e6cf
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
a463fa
30e6cf
Requires(post):   %{_sbindir}/depmod
30e6cf
Requires(postun): %{_sbindir}/depmod
a463fa
30e6cf
Requires(post):   %{_sbindir}/weak-modules
30e6cf
Requires(postun): %{_sbindir}/weak-modules
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
30e6cf
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
a463fa
a463fa
a463fa
%preun
a463fa
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
30e6cf
rpm -ql kmod-%{pkg}-%{?epoch:%{epoch}:}%{version}-%{release}.%{_arch} | grep '/lib/modules/%{kernel_version}.%{_arch}/.*\.ko\.xz$' >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
a463fa
a463fa
a463fa
%postun
30e6cf
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
a463fa
then
30e6cf
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
30e6cf
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
a463fa
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
30e6cf
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
a463fa
fi
a463fa
a463fa
30e6cf
%pretrans -p <lua>
30e6cf
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
30e6cf
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
30e6cf
30e6cf
a463fa
%posttrans
30e6cf
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
a463fa
then
30e6cf
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
30e6cf
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
a463fa
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
30e6cf
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
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
30e6cf
* Tue Sep 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.6-2
30e6cf
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
30e6cf
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