-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmlnx-tools.spec
80 lines (66 loc) · 2.4 KB
/
mlnx-tools.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Summary: Mellanox userland tools and scripts
Name: mlnx-tools
Version: 1.5.4
Release: 0%{?dist}
License: GPLv2
Url: https://github.com/aron-silverton/mlnx-tools
Group: Applications/System
Source: https://github.com/aron-silverton/mlnx-tools/releases/download/v%{version}/%{name}-%{version}.tgz
BuildRoot: %{?build_root:%{build_root}}%{!?build_root:/var/tmp/%{name}}
Vendor: Mellanox Technologies
Requires: perl
Requires: python
BuildRequires: python2
%description
Mellanox userland tools and scripts
%prep
%setup -n %{name}-%{version}
%install
add_env()
{
efile=$1
evar=$2
epath=$3
cat >> $efile << EOF
if ! echo \$${evar} | grep -q $epath ; then
export $evar=$epath:\$$evar
fi
EOF
}
touch mlnx-tools-files
cd ofed_scripts/utils
mlnx_python_sitelib=%{python_sitelib}
if [ "$(echo %{_prefix} | sed -e 's@/@@g')" != "usr" ]; then
mlnx_python_sitelib=$(echo %{python_sitelib} | sed -e 's@/usr@%{_prefix}@')
fi
python setup.py install -O1 --prefix=%{buildroot}%{_prefix} --install-lib=%{buildroot}${mlnx_python_sitelib}
cd -
install -D -m 0755 ofed_scripts/cma_roce_mode %{buildroot}%{_sbindir}/cma_roce_mode
install -D -m 0755 ofed_scripts/ibdev2netdev %{buildroot}%{_bindir}/ibdev2netdev
install -D -m 0755 ofed_scripts/show_gids %{buildroot}%{_sbindir}/show_gids
install -D -m 0755 roce_config.sh %{buildroot}%{_bindir}/roce_config
install -D -m 0755 roce_config_persistent.sh %{buildroot}%{_bindir}/roce_config_persistent
if [ "$(echo %{_prefix} | sed -e 's@/@@g')" != "usr" ]; then
conf_env=/etc/profile.d/mlnx-tools.sh
install -d %{buildroot}/etc/profile.d
add_env %{buildroot}$conf_env PYTHONPATH $mlnx_python_sitelib
add_env %{buildroot}$conf_env PATH %{_bindir}
add_env %{buildroot}$conf_env PATH %{_sbindir}
echo $conf_env >> mlnx-tools-files
fi
find %{buildroot}${mlnx_python_sitelib} -type f -print | sed -e 's@%{buildroot}@@' >> mlnx-tools-files
%clean
rm -rf %{buildroot}
%files -f mlnx-tools-files
%defattr(-,root,root,-)
%{_sbindir}/*
%{_bindir}/*
%changelog
* Tue Dec 19 2017 Aron Silverton <aron.silverton@mellanox.com> - 1.5.4-0
- [Orabug: 27284449] Add Oracle copyright and remove Mellanox copyright
- [Orabug: 27284461] Remove obsolete installation script
- [Orabug: 27290597] Add OS distribution to generated package name
- [Orabug: 27290626] Add Python build dependency
- [Orabug: 27290690] Include roce_config_persistent in the RPM
* Wed Nov 1 2017 Vladimir Sokolovsky <vlad@mellanox.com>
- Initial packaging