# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: MIT

%global pkg_name level-zero
%global lib_ver 1.13.1
%global openeuler_release 2

Name:		%{pkg_name}
Version:	%{lib_ver}
Release:	%{openeuler_release}%{?dist}
Summary:	Intel oneAPI Level Zero

License:	MIT
URL:		https://github.com/oneapi-src/level-zero
Source0:	%{url}/archive/v%{version}/%{name}-%{version}.tar.gz

BuildRequires:	cmake
BuildRequires:	make
BuildRequires:	gcc
BuildRequires:	gcc-c++

%description
Intel(R) Graphics Compute Runtime for oneAPI Level Zero. Level Zero is the
primary low-level interface for language and runtime libraries. Level Zero
offers fine-grain control over accelerators capabilities, delivering a
simplified and low-latency interface to hardware, and efficiently exposing
hardware capabilities to applications.
.
This package provides the loader for oneAPI Level Zero compute runtimes.

%package	devel
Summary:	Development headers for oneAPI Level Zero.
Requires:	%{name}%{?_isa} = %{version}-%{release}

%description	devel
Intel(R) Graphics Compute Runtime for oneAPI Level Zero. Level Zero is the
primary low-level interface for language and runtime libraries. Level Zero
offers fine-grain control over accelerators capabilities, delivering a
simplified and low-latency interface to hardware, and efficiently exposing
hardware capabilities to applications.

%prep
%autosetup -n %{name}-%{version}

%build
%cmake \
	-B %{__cmake_builddir} \
	-DCMAKE_BUILD_TYPE=Release
%cmake_build

%install
%cmake_install

%files
%defattr(-,root,root)
%license LICENSE
%{_libdir}/libze_loader.so.1
%{_libdir}/libze_loader.so.1.*
%{_libdir}/libze_validation_layer.so.1
%{_libdir}/libze_validation_layer.so.1.*
%{_libdir}/libze_tracing_layer.so.1
%{_libdir}/libze_tracing_layer.so.1.*

%files devel
%defattr(-,root,root)
%{_includedir}/level_zero/*.h
%{_includedir}/level_zero/layers/*.h
%{_includedir}/level_zero/loader/*.h
%{_libdir}/libze_loader.so
%{_libdir}/libze_tracing_layer.so
%{_libdir}/libze_validation_layer.so
%{_libdir}/pkgconfig/libze_loader.pc
%{_libdir}/pkgconfig/level-zero.pc

%doc README.md SECURITY.md

%changelog
* Thu Dec 05 2024 Funda Wang <fundawang@yeah.net> - 1.13.1-2
- adopt to new cmake macro

* Fri Nov 17 2023 Aubrey Li <aubrey.li@linux.intel.com> - 1.13.1-1
- Initial spec file