%global commit fd277f36c0539cc63876166fea71a7cef2204c72 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: rocminfo Version: 0.0.1 Release: 0.2.20180220git%{shortcommit}%{?dist} Summary: ROCm system info utility License: NCSA URL: https://github.com/RadeonOpenCompute/rocminfo Source0: https://github.com/RadeonOpenCompute/rocminfo/archive/%{commit}/%{name}-%{shortcommit}.tar.gz Patch0: 0001-Fix-rocm-runtime-libdir.patch Patch1: 0001-Use-CXXFLAGS-defined-in-the-environment.patch BuildRequires: cmake BuildRequires: rocm-runtime-devel %{!?enable_llvmtoolset7: %define enable_llvmtoolset7 %{nil}} %if 0%{?epel} == 7 # We still the original cmake package on epel, because it provides the # %%cmake macro. BuildRequires: cmake3 %global __cmake %{_bindir}/cmake3 %endif %if !0%{?epel} && 0%{?rhel} == 7 BuildRequires: llvm-toolset-7-cmake BuildRequires: llvm-toolset-7-runtime %enable_llvmtoolset7 %global __cmake cmake %endif %description ROCm system info utility %prep %autosetup -n %{name}-%{commit} -p1 %build mkdir build cd build %cmake .. -DROCM_DIR=/usr %make_build %install cd build sed -i 's|^#!/usr/bin/python|#!/usr/bin/python2|' rocm_agent_enumerator mkdir -p %{buildroot}%{_bindir} install -m 0755 rocm_agent_enumerator %{buildroot}%{_bindir} install -m 0755 rocminfo %{buildroot}%{_bindir} %files %doc README.md %license License.txt %{_bindir}/rocm_agent_enumerator %{_bindir}/rocminfo %changelog * Mon Mar 05 2018 Tom Stellard - 0.0.1-0.2.20180220gitfd277f3 - Add epel support * Tue Feb 20 2018 Tom Stellard - 0.0.1-0.1.20180220gitfd277f3 - Import snapshot from git