Blame SPECS/kmod-jme.spec

a463fa
%global pkg jme
a463fa
Kmods SIG 09fbde
%global driver_version 4.18.0-358.el8
Kmods SIG da3cb1
Kmods SIG 09fbde
%global kernel_version 4.18.0-358.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}
Kmods SIG 09fbde
Version:          4.18.0.358
023910
Release:          2%{?dist}
a463fa
Summary:          JMicron JMC2x0 PCI-E Gigabit Ethernet (%{pkg}) driver
a463fa
a463fa
License:          GPLv2
a463fa
URL:              https://www.kernel.org/
a463fa
Kmods SIG da3cb1
Source0:          %{pkg}-%{driver_version}.tar.xz
a463fa
023910
ExclusiveArch:    x86_64 aarch64 ppc64le
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
Kmods SIG da3cb1
%autosetup -p1 -n %{pkg}-%{driver_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}
ddc686
%license LICENSES
a463fa
a463fa
a463fa
%changelog
023910
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-2
023910
- Enable ppc64le
023910
Kmods SIG 09fbde
* Mon Jan 17 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.358-1
Kmods SIG 09fbde
- Update to 4.18.0-358.el8
Kmods SIG 09fbde
Kmods SIG da3cb1
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.211-1
Kmods SIG da3cb1
- Switch to EL kernel source and versioning
Kmods SIG da3cb1
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)