File hsa-runtime.spec of Package hsa-runtime

#
# spec file for package hsa-runtime
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define _libname libhsa-runtime64-1
Name:           hsa-runtime
Version:        2.2.0
Release:        0
Summary:        Radeon Open Compute Runtime
License:        NCSA
Group:          System/Libraries
URL:            https://github.com/RadeonOpenCompute/ROCR-Runtime
Source:         https://github.com/RadeonOpenCompute/ROCR-Runtime/archive/roc-%{version}.tar.gz
# https://github.com/RadeonOpenCompute/ROCR-Runtime/pull/51/
Patch0:         respect-fhs.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  libhsakmt-devel = %{version}
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libelf)

%description
This repository contains AMD Radeon Open Compute run-time.  It also
contains a slightly hacky patch to invoke offline compiler binary
called hof in order to finalize BRIG into GCN ISA.

%package -n %{_libname}
Summary:        Radeon Open Compute Runtime
Group:          System/Libraries

%description -n %{_libname}
This repository contains Radeon Open Compute Runtime library from AMD

%package devel
Summary:        Development files of Radeon Open Compute Runtime
Group:          Development/Libraries/C and C++
Requires:       %{_libname} = %{version}

%description devel
This repository contains Radeon Open Compute Runtime library development
files

%prep
%setup -q -n ROCR-Runtime-roc-%{version}/src
%patch0 -p1

%build
# hsakmt should be found using .pc file
# respect optflags
%cmake \
    -DHSAKMT_INC_PATH=%{_includedir}/hsakmt \
    -DEXTRA_CFLAGS="%{optflags}"
%cmake_build

%install
%cmake_install

%post -n %{_libname} -p /sbin/ldconfig
%postun -n %{_libname} -p /sbin/ldconfig

%files -n %{_libname}
%license ../LICENSE.txt
%doc ../README.md
%{_libdir}/libhsa-runtime64.so.*

%files devel
%dir %{_includedir}/hsa
%{_includedir}/hsa/*.h
%{_libdir}/libhsa-runtime64.so

%changelog