Petr Šabata 0ef609
%global __remake_config 1
Petr Šabata 0ef609
Petr Šabata 0ef609
Name:		mstflint
Petr Šabata 0ef609
Summary:	Mellanox firmware burning tool
Michel Lind 883d97
Version:	4.30.0
Michel Lind 34c551
Release:	%autorelease
Michel Lind 03a788
# COPYING says the license is your choice of OpenIB.org BSD or GPLv2.
Michel Lind 03a788
# kernel/Makefile has the 3-clause BSD.
Michel Lind 03a788
# ext_libs/{iniParser,json,muparser}/ have MIT.
Michel Lind 03a788
# ext_libs/sqlite/ has the SQLite blessing.
Michel Lind 03a788
License:	(GPL-2.0-only OR Linux-OpenIB) AND BSD-3-Clause AND MIT AND blessing
Michal Schmidt dbbba6
Url:		https://github.com/Mellanox/%{name}
Michal Schmidt dbbba6
Source0: 	https://github.com/Mellanox/%{name}/releases/download/v%{version}-1/%{name}-%{version}-1.tar.gz
Petr Šabata 0ef609
Group:		Applications/System
Michal Schmidt dbbba6
Michel Lind 03a788
Patch1:		0001-Fix-bind-now-test.patch
Michel Lind 03a788
Patch4: 	add-default-link-flags-for-shared-libraries.patch
Michal Schmidt dbbba6
Michal Schmidt dbbba6
BuildRequires:	make
Petr Šabata 0ef609
BuildRequires:	libstdc++-devel, zlib-devel, libibmad-devel, gcc-c++, gcc
Petr Šabata 0ef609
BuildRequires:  libcurl-devel, boost-devel, libxml2-devel, openssl-devel
ac6b57
BuildRequires:  expat-devel
Petr Šabata 0ef609
%if %{__remake_config}
Petr Šabata 0ef609
BuildRequires:  libtool, autoconf, automake
Petr Šabata 0ef609
%endif
Petr Šabata 0ef609
Obsoletes:	openib-mstflint <= 1.4 openib-tvflash <= 0.9.2 tvflash <= 0.9.0
Petr Šabata 0ef609
ExcludeArch:	s390 s390x %{arm}
Petr Šabata 0ef609
Requires:	python3
Petr Šabata 0ef609
Petr Šabata 0ef609
%description
Petr Šabata 0ef609
This package contains firmware update tool, vpd dump and register dump tools
Petr Šabata 0ef609
for network adapters based on Mellanox Technologies chips.
Petr Šabata 0ef609
Petr Šabata 0ef609
%prep
Michal Schmidt dbbba6
%setup -q -n %{name}-%{version}
Michal Schmidt dbbba6
Michel Lind 03a788
%patch -P1 -p1
Michel Lind 03a788
%patch -P4 -p1
Michal Schmidt dbbba6
Petr Šabata 0ef609
find . -type f -iname '*.[ch]' -exec chmod a-x '{}' ';'
Petr Šabata 0ef609
find . -type f -iname '*.cpp' -exec chmod a-x '{}' ';'
Petr Šabata 0ef609
Petr Šabata 0ef609
%build
Petr Šabata 0ef609
%if %{__remake_config}
Petr Šabata 0ef609
./autogen.sh
Petr Šabata 0ef609
%endif
Michel Lind 03a788
%configure --enable-adb-generic-tools --disable-openssl
Petr Šabata 0ef609
%make_build
Petr Šabata 0ef609
Petr Šabata 0ef609
%install
Petr Šabata 0ef609
%make_install
Petr Šabata 0ef609
# Remove the devel files that we don't ship
Petr Šabata 0ef609
rm -fr %{buildroot}%{_includedir}
Petr Šabata 0ef609
find %{buildroot} -type f -name '*.la' -delete
Michel Lind 03a788
find %{buildroot} -type f,l -name '*.a' -delete
Petr Šabata 0ef609
Michal Schmidt e2dcae
# Mark these shared libs executable for find-debuginfo.sh to find them.
Michal Schmidt e2dcae
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Debuginfo/
Michal Schmidt e2dcae
chmod +x %{buildroot}/%{_libdir}/mstflint/python_tools/*.so
Michel Lind 03a788
chmod +x %{buildroot}/%{_libdir}/mstflint/sdk/*.so
Michal Schmidt e2dcae
Petr Šabata 0ef609
%files
Petr Šabata 0ef609
%doc README
Petr Šabata 0ef609
%_bindir/*
Petr Šabata 0ef609
%{_libdir}/mstflint
Petr Šabata 0ef609
Petr Šabata 0ef609
%{_datadir}/mstflint
Petr Šabata 0ef609
%{_mandir}/man1/*
Petr Šabata 0ef609
Petr Šabata 0ef609
%changelog
Michel Lind 34c551
%autochangelog