2626#
2727#
2828
29- %global MLNX_OFED_VERSION 5.6-1.0.3.3
30- %global BF_VERSION 3.9.0
29+ %global MLNX_OFED_VERSION 24.10-0.7.0.0
3130
3231Summary: Mellanox userland tools and scripts
3332Name: mlnx-tools
34- Version: 5.2.0
35- Release: 2 %{?dist }
36- License: CPL 1.0 or BSD or GPLv2
33+ Version: 24.10
34+ Release: 1 %{?dist }
35+ License: GPLv2 or BSD
3736Vendor: Microsoft Corporation
3837Distribution: Azure Linux
39- Group: System Environment/Programming
38+ Group: Applications/System
4039URL: https://github.com/Mellanox/mlnx-tools
41- Source0: https://linux.mellanox.com/public/repo/bluefield/%{ BF_VERSION }/extras/ mlnx_ofed/%{MLNX_OFED_VERSION }/SOURCES/%{ name }_%{ version }.orig.tar.gz# /%{name}-%{version}.tar.gz
40+ Source0: https://linux.mellanox.com/public/repo/mlnx_ofed/%{MLNX_OFED_VERSION }/SRPMS /%{name }-%{version }.tar.gz
4241Obsoletes: mlnx-ofa_kernel < 5.4
4342Obsoletes: mlnx_en-utils < 5.4
4443
44+ BuildRoot: %{?build_root:%{build_root }}%{! ?build_root:/var/tmp/%{name }}
45+
4546%description
4647Mellanox userland tools and scripts
4748
48- %define debug_package %{ nil }
49- %define __python %{ _bindir }/python3
50- BuildRequires: python3
51- # mlnx_tune is python2 but is not important enough to create a dependency
52- # on python2 in a python3 system:
53- %global __requires_exclude_from mlnx_tune
49+ %global RHEL8 0%{? rhel } >= 8
50+ %global FEDORA3X 0%{? fedora } >= 30
51+ %global SLES15 0%{? suse_version } >= 1500
52+ %global OPENEULER 0%{? openEuler } >= 2
53+ %global PYTHON3 %{ RHEL8 } || %{ FEDORA3X } || %{ SLES15 } || %{ OPENEULER }
54+ %global python_dir %{ _datadir }/%{ name }/python
5455
5556%prep
56- %autosetup -n %{name }-%{version }
57-
58- %build
57+ %setup -n %{name }-%{version }
5958
6059%install
60+ rm -rf %{buildroot }
6161
6262add_env()
6363{
7474}
7575
7676touch mlnx-tools-files
77- mlnx_python_sitelib= %{python_sitelib }
78- if [ "$(echo %{_prefix } | sed -e 's@/@@g')" != "usr" ]; then
79- mlnx_python_sitelib= $(echo %{python_sitelib } | sed -e 's@/usr@%{_prefix }@')
80- fi
8177export PKG_VERSION= "%{version }"
82- %make_install PYTHON= "%__python" PYTHON_SETUP_EXTRA_ARGS= "-O1 --prefix= %{buildroot }%{_prefix } --install-lib= %{buildroot }${mlnx_python_sitelib}"
78+ %make_install
79+ %if %PYTHON3
80+ sed -i -e '1s/python\> /python3/' %{buildroot }/usr/{s,}bin/* \
81+ %{buildroot }%{python_dir }/*.py
82+ %endif
8383
84- if [ "$(echo %{_prefix } | sed -e 's@/@@g') " != "usr" ]; then
84+ % if " %{_prefix }" != "/ usr"
8585 conf_env= /etc/profile.d/mlnx-tools.sh
8686 install -d %{buildroot }/etc/profile.d
87- add_env %{buildroot }$conf_env PYTHONPATH $mlnx_python_sitelib
8887 add_env %{buildroot }$conf_env PATH %{_bindir }
8988 add_env %{buildroot }$conf_env PATH %{_sbindir }
9089 echo $conf_env >> mlnx-tools-files
91- fi
92- find %{buildroot }${mlnx_python_sitelib} -type f -print | sed -e 's@%{buildroot }@@' >> mlnx-tools-files
90+ %endif
91+
92+ %clean
93+ rm -rf %{buildroot }
9394
95+ %if "%{_prefix }" != "/usr"
9496%files -f mlnx-tools-files
97+ %else
98+ %files
99+ %endif
100+ %license LICENSE
95101%doc doc/*
96- %license debian/copyright
97102%defattr(-,root,root,-)
98103/sbin/sysctl_perf_tuning
99104/sbin/mlnx_bf_configure
100- /sbin/mlnx_bf_configure_ct
101105/sbin/mlnx-sf
102106%{_sbindir }/*
103107%{_bindir }/*
104- %{_mandir }/man8/ib2ib_setup.8*
108+ %{_mandir }/man8/* .8*
109+ %{python_dir }/dcbnetlink.py*
110+ %{python_dir }/netlink.py*
111+ %exclude %{python_dir }/__pycache__/* .pyc
105112/lib/udev/mlnx_bf_udev
106113
107114%changelog
115+ * Thu Jan 09 2025 Alberto David Perez Guevara <aperezguevar@microsoft.com> 24.10-1
116+ - Upgrade package to version 24.10
117+
108118* Fri Jul 22 2022 Rachel Menge <rachelmenge@microsoft.com> 5.2.0-2
109119- Initial CBL-Mariner import from NVIDIA (license: GPLv2).
110120- Lint spec to conform to Mariner
@@ -113,5 +123,5 @@ find %{buildroot}${mlnx_python_sitelib} -type f -print | sed -e 's@%{buildroot}@
113123* Wed May 12 2021 Tzafrir Cohen <nvidia@cohens.org.il> - 5.2.0-1
114124- MLNX_OFED branch
115125
116- * Wed Nov 1 2017 Vladimir Sokolovsky <vlad@mellanox.com> - 4.6.0-1
126+ * Wed Nov 01 2017 Vladimir Sokolovsky <vlad@mellanox.com> - 4.6.0-1
117127- Initial packaging
0 commit comments