File embree.spec of Package embree

#
# spec file for package embree
#
# Copyright (c) 2021 SUSE LLC
#
# 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  soname 3
%define  lname  lib%{name}3_%{soname}
Name:           embree
Version:        @SERVICE@
Release:        0
Summary:        Collection of high-performance ray tracing kernels
License:        Apache-2.0
Group:          Development/Libraries/C and C++
URL:            https://github.com/embree/embree
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake
BuildRequires:  cmake(TBB)
BuildRequires:  gcc-c++
BuildRequires:  ispc
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(glfw3)
BuildRequires:  pkgconfig(glut)
BuildRequires:  pkgconfig(xmu)
# SSE2 is required: https://github.com/embree/embree#supported-platforms
ExclusiveArch:  x86_64 aarch64

%description
Intel Embree is a collection of ray tracing kernels originally developed
at Intel. The target users of Intel Embree are graphics application engineers
who want to improve the performance of their photo-realistic rendering
application by leveraging Embree's ray tracing kernels.

%package -n %{lname}
Summary:        Libraries for %{name}
Group:          System/Libraries

%description -n %{lname}
Development libraries for %{name}

%package devel
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{lname} = %{version}
Provides:       %{name}-devel = %{version}

%description devel
This package contains the C++ header files and libraries for %{name}.

%prep
%autosetup

%build
# we need fat lto objects here
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export CXXFLAGS="%{optflags}"
%cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DEMBREE_TASKING_SYSTEM=INTERNAL \
    -DEMBREE_LIB_INSTALL_DIR=%{_libdir} \
    -DEMBREE_ISPC_SUPPORT=ON \
    -DEMBREE_RAY_MASK=ON \
    -DEMBREE_FILTER_FUNCTION=ON \
    -DEMBREE_BACKFACE_CULLING=OFF \
%ifarch x86_64
    -DEMBREE_MAX_ISA=AVX2 \
%endif
    -DEMBREE_TUTORIALS=OFF

%cmake_build

%install
%cmake_install
rm -rf %{buildroot}%{_mandir}
rm -rf %{buildroot}%{_datadir}/doc

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

%files -n %{lname}
%{_libdir}/lib%{name}3.so.*

%files devel
%doc CHANGELOG.md README.md
%{_includedir}/embree3
%{_libdir}/cmake/embree-*
%{_libdir}/lib%{name}3.so
%license LICENSE.txt

%changelog
openSUSE Build Service is sponsored by