Blob Blame History Raw
%global __remake_config 1

%global forgeurl https://github.com/Mellanox/mstflint
%global commit 2b022989e5f22875284f3fbaccf67361ef5a848d
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%forgemeta

Name:		mstflint
Summary:	Mellanox firmware burning tool
Version:	4.19.0
Release:	0.2%{?dist}
License:	GPLv2+ or BSD
Group:		Applications/System
Source: 	%{forgesource}
Patch4: 	add-default-link-flags-for-shared-libraries.patch
Patch6: 	replace-mlxfwreset-with-mstfwreset-in-mstflint-message.patch
Url:		%{forgeurl}
BuildRequires: make
BuildRequires:	libstdc++-devel, zlib-devel, libibmad-devel, gcc-c++, gcc
BuildRequires:  libcurl-devel, boost-devel, libxml2-devel, openssl-devel
%if %{__remake_config}
BuildRequires:  libtool, autoconf, automake
%endif
Obsoletes:	openib-mstflint <= 1.4 openib-tvflash <= 0.9.2 tvflash <= 0.9.0
ExcludeArch:	s390 s390x %{arm}
Requires:	python3

%description
This package contains firmware update tool, vpd dump and register dump tools
for network adapters based on Mellanox Technologies chips.

%prep
%forgeautosetup -p1
find . -type f -iname '*.[ch]' -exec chmod a-x '{}' ';'
find . -type f -iname '*.cpp' -exec chmod a-x '{}' ';'

%build
%if %{__remake_config}
# gitversion.sh called from autogen.sh will fail. Just do its work here:
printf '#define TOOLS_GIT_SHA "%s"\n' %{shortcommit} > common/gitversion.h
./autogen.sh
%endif
%configure TOOLS_GIT_SHA=%{shortcommit} --enable-fw-mgr
%make_build

%install
%make_install
# Remove the devel files that we don't ship
rm -fr %{buildroot}%{_includedir}
find %{buildroot} -type f -name '*.la' -delete
find %{buildroot} -type f -name '*.a' -delete

%files
%doc README
%_bindir/*
%{_sysconfdir}/mstflint
%{_libdir}/mstflint

%{_datadir}/mstflint
%{_mandir}/man1/*

%changelog
%autochangelog