Blame SPECS/kmod-be2net.spec

8b0b02
%global pkg be2net
8b0b02
Kmods SIG dc27a1
%global driver_version 5.14.0-89.el9
8b0b02
Kmods SIG dc27a1
%global kernel_version 5.14.0-92.el9
8b0b02
8b0b02
%global debug_package %{nil}
8b0b02
8b0b02
%global __spec_install_post \
8b0b02
  %{?__debug_package:%{__debug_install_post}} \
8b0b02
  %{__arch_install_post} \
8b0b02
  %{__os_install_post} \
8b0b02
  %{__mod_compress_install_post}
8b0b02
8b0b02
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
8b0b02
8b0b02
8b0b02
Name:             kmod-%{pkg}
Kmods SIG dc27a1
Version:          5.14.0.89
Kmods SIG dc27a1
Release:          1%{?dist}
8b0b02
Summary:          Emulex OneConnect NIC (%{pkg}) driver
8b0b02
8b0b02
License:          GPLv2
8b0b02
URL:              https://www.kernel.org/
8b0b02
8b0b02
Source0:          %{pkg}-%{driver_version}.tar.xz
8b0b02
Patch1:           0001-enable-be2-and-be3.patch
8b0b02
8ab13e
ExclusiveArch:    x86_64 ppc64le
8b0b02
8b0b02
BuildRequires:    elfutils-libelf-devel
8b0b02
BuildRequires:    gcc
56da38
BuildRequires:    kernel-rpm-macros
8b0b02
BuildRequires:    kmod
8b0b02
BuildRequires:    make
8b0b02
BuildRequires:    redhat-rpm-config
8b0b02
BuildRequires:    xz
8b0b02
56da38
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
8b0b02
BuildRequires:    kernel-devel = %{kernel_version}
8b0b02
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
8b0b02
56da38
Requires:         kernel >= %{kernel_version}
56da38
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
56da38
Requires:         kernel-modules >= %{kernel_version}
56da38
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
8b0b02
8b0b02
Provides:         installonlypkg(kernel-module)
56da38
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
8b0b02
56da38
Requires(post):   %{_sbindir}/depmod
56da38
Requires(postun): %{_sbindir}/depmod
8b0b02
56da38
Requires(post):   %{_sbindir}/weak-modules
56da38
Requires(postun): %{_sbindir}/weak-modules
8b0b02
8b0b02
d47d69
%if "%{version}" == "5.14.0.1" && "%{release}" == "10%{?dist}"
d47d69
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-9%{?dist}
d47d69
%endif
d47d69
d47d69
8b0b02
%description
8b0b02
This package provides the %{pkg} driver. Compared to the in-kernel driver this
8b0b02
driver re-enables support for deprecated BladeEngine 2 and 3 adapters.
8b0b02
8b0b02
BladeEngine 2 (BE2) devices:
8b0b02
- 0x19A2:0x0211: Emulex BladeEngine 2 Network Adapter
8b0b02
- 0x19A2:0x0700: Emulex OneConnect Tigershark NIC
8b0b02
8b0b02
BladeEngine 3 (BE3) devices:
8b0b02
- 0x19A2:0x0221: Emulex BladeEngine3 Network Adapter
8b0b02
- 0x19A2:0x0710: Emulex OneConnect Tomcat NIC
8b0b02
8b0b02
8b0b02
%prep
8b0b02
%autosetup -p1 -n %{pkg}-%{driver_version}
8b0b02
8b0b02
8b0b02
%build
8b0b02
pushd src
8b0b02
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
8b0b02
popd
8b0b02
8b0b02
8b0b02
%install
8b0b02
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/emulex/benet src/%{pkg}.ko
8b0b02
8b0b02
# Make .ko objects temporarily executable for automatic stripping
8b0b02
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
8b0b02
56da38
# Generate depmod.conf
56da38
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
56da38
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
56da38
do
56da38
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
56da38
done
56da38
8b0b02
8b0b02
%clean
8b0b02
%{__rm} -rf %{buildroot}
8b0b02
8b0b02
8b0b02
%post
8b0b02
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
56da38
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/emulex/benet/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
8b0b02
8b0b02
8b0b02
%preun
8b0b02
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
56da38
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
8b0b02
8b0b02
8b0b02
%postun
56da38
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
8b0b02
then
56da38
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
56da38
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
8b0b02
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
56da38
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
8b0b02
fi
8b0b02
8b0b02
56da38
%pretrans -p <lua>
56da38
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
56da38
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
56da38
56da38
8b0b02
%posttrans
56da38
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
8b0b02
then
56da38
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
56da38
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
8b0b02
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
56da38
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
8b0b02
fi
8b0b02
8b0b02
8b0b02
%files
8b0b02
%defattr(644,root,root,755)
8b0b02
/lib/modules/%{kernel_version}.%{_arch}
b62603
%license LICENSES
56da38
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
8b0b02
8b0b02
8b0b02
%changelog
Kmods SIG dc27a1
* Fri May 27 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.89-1
Kmods SIG dc27a1
- Update to 5.14.0-89.el9
Kmods SIG dc27a1
Kmods SIG 9e41e6
* Fri May 27 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.79-4
Kmods SIG 9e41e6
- Rebuild for 5.14.0-86.el9
Kmods SIG 9e41e6
Kmods SIG 73d972
* Fri May 27 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.79-3
Kmods SIG 73d972
- Rebuild for 5.14.0-85.el9
Kmods SIG 73d972
Kmods SIG ea42c0
* Thu May 26 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.79-2
Kmods SIG ea42c0
- Rebuild for 5.14.0-83.el9
Kmods SIG ea42c0
Kmods SIG d1726b
* Fri Apr 22 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.79-1
Kmods SIG d1726b
- Update to 5.14.0-79.el9
Kmods SIG d1726b
Kmods SIG dcad67
* Tue Apr 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.77-1
Kmods SIG dcad67
- Update to 5.14.0-77.el9
Kmods SIG dcad67
Kmods SIG 56469c
* Mon Mar 28 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-23
Kmods SIG 56469c
- Rebuild for 5.14.0-75.el9
Kmods SIG 56469c
Kmods SIG ed48c1
* Tue Mar 22 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-22
Kmods SIG ed48c1
- Rebuild for 5.14.0-73.el9
Kmods SIG ed48c1
Kmods SIG 22dbb3
* Sun Feb 20 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-21
Kmods SIG 22dbb3
- Rebuild for 5.14.0-62.el9
Kmods SIG 22dbb3
Kmods SIG 7c53e1
* Fri Feb 18 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-20
Kmods SIG 7c53e1
- Rebuild for 5.14.0-60.el9
Kmods SIG 7c53e1
Kmods SIG 575892
* Tue Feb 15 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-19
Kmods SIG 575892
- Rebuild for 5.14.0-58.el9
Kmods SIG 575892
Kmods SIG b2c8cb
* Sat Feb 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-18
Kmods SIG b2c8cb
- Rebuild for 5.14.0-57.el9
Kmods SIG b2c8cb
Kmods SIG e6522f
* Thu Feb 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-17
Kmods SIG e6522f
- Rebuild for 5.14.0-56.el9
Kmods SIG e6522f
Kmods SIG a62531
* Mon Feb 07 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-16
Kmods SIG a62531
- Rebuild for 5.14.0-55.el9
Kmods SIG a62531
Kmods SIG c9e612
* Wed Feb 02 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-15
Kmods SIG c9e612
- Rebuild for 5.14.0-51.el9
Kmods SIG c9e612
Kmods SIG 55f7f5
* Tue Feb 01 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-14
Kmods SIG 55f7f5
- Rebuild for 5.14.0-50.el9
Kmods SIG 55f7f5
Kmods SIG 1352c2
* Sat Jan 29 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-13
Kmods SIG 1352c2
- Rebuild for 5.14.0-49.el9
Kmods SIG 1352c2
Kmods SIG 922405
* Thu Jan 27 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-12
Kmods SIG 922405
- Rebuild for 5.14.0-48.el9
Kmods SIG 922405
Kmods SIG 0e1ff7
* Tue Jan 25 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-11
Kmods SIG 0e1ff7
- Rebuild for 5.14.0-47.el9
Kmods SIG 0e1ff7
8ab13e
* Wed Jan 19 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0.1-10
8ab13e
- Enable ppc64le
8ab13e
Kmods SIG f97550
* Wed Jan 19 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-9
Kmods SIG f97550
- Rebuild for 5.14.0-44.el9
Kmods SIG f97550
Kmods SIG 83d2ca
* Tue Jan 18 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-8
Kmods SIG 83d2ca
- Rebuild for 5.14.0-43.el9
Kmods SIG 83d2ca
Kmods SIG f5a789
* Mon Jan 17 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-7
Kmods SIG f5a789
- Rebuild for 5.14.0-42.el9
Kmods SIG f5a789
Kmods SIG 22e68d
* Fri Jan 14 2022 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-6
Kmods SIG 22e68d
- Rebuild for 5.14.0-41.el9
Kmods SIG 22e68d
d6b705
* Sat Dec 25 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-5
d6b705
- Rebuild for 5.14.0-39.el9
d6b705
- Skip unreleased kernel -38
Kmods SIG 0b8f89
Kmods SIG 40a375
* Thu Dec 23 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-4
Kmods SIG 40a375
- Rebuild for 5.14.0-37.el9
Kmods SIG 40a375
Kmods SIG c071c4
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-3
Kmods SIG c071c4
- Rebuild for 5.14.0-36.el9
Kmods SIG c071c4
ae7e4a
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-2
ae7e4a
- Rebuild for 5.14.0-34.el9
ae7e4a
- Skip unreleased kernel -32 and -33
Kmods SIG b4a2a1
56da38
* Thu Dec 16 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0.1-1
56da38
- Convert to kABI tracking kmod package (kernel >= 5.14.0-31.el9)