%bcond openimageio 1 %bcond python 0 Name: materialx Version: 1.38.8 Release: %autorelease Summary: open standard for the exchange of rich material and look-development content across applications and renderers. License: Apache-2.0 URL: https://materialx.org/ Source0: https://github.com/AcademySoftwareFoundation/MaterialX/releases/download/v%{version}/MaterialX-%{version}.tar.gz BuildRequires: chrpath BuildRequires: cmake(pybind11) BuildRequires: gcc-c++ BuildRequires: pkgconfig(gl) %if %{with openimageio} BuildRequires: pkgconfig(OpenImageIO) %endif BuildRequires: pkgconfig(oslcomp) %if %{with python} BuildRequires: pkgconfig(python3) >= 3.7 BuildRequires: pkgconfig(pybind11) %endif BuildRequires: pkgconfig(xt) BuildRequires: python3dist(setuptools) %package devel Summary: Development files for %{name} License: Apache-2.0 Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %description MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers. %prep %autosetup -n MaterialX-%{version} # Fix path #sed -i 's|CMAKE_INSTALL_PREFIX|CMAKE_BINARY_DIR|g' python/CMakeLists.txt sed -i 's|"DESTINATION ."|"DESTINATION %{_datadir}/%{name}"|g' CMakeLists.txt sed -i 's|"resources"|%{_datadir}/%{name}/resources|g' resources/CMakeLists.txt %build %cmake \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_SKIP_RPATH=ON \ %if %{with python} -DMATERIALX_BUILD_PYTHON=ON \ %endif -DMATERIALX_BUILD_TESTS=OFF \ -DMATERIALX_BUILD_SHARED_LIBS=ON \ %if %{with openimageio} -DMATERIALX_BUILD_OIIO=%{oiio}} \ %endif -DMATERIALX_INSTALL_INCLUDE_PATH=%{_includedir} \ -DMATERIALX_INSTALL_LIB_PATH=%{_libdir} \ -DMATERIALX_INSTALL_STDLIB_PATH=%{_datadir}/%{name} %cmake_build %install %cmake_install # Relocate resources folder cp -pr %{buildroot}%{_prefix}/resources %{buildroot}%{_datadir}/%{name}/ rm -rf %{buildroot}%{_prefix}/resources # Fix location of licenses mkdir -p %{buildroot}%{_datadir}/{doc,licenses}/%{name}/ mv %{buildroot}%{_prefix}/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/ # Relocate changelog mv %{buildroot}%{_prefix}/{CHANGELOG,README}.md %{buildroot}%{_docdir}/%{name}/ rm %{buildroot}%{_prefix}/THIRD-PARTY.md %files %license LICENSE %doc CHANGELOG.md README.md SECURITY.md %{_datadir}/%{name} %{_libdir}/*.so.{1,%{version}} %files devel %{_includedir}/MaterialX{Core,Format}/ %{_includedir}/MaterialXGen{Glsl,Mdl,Msl,Osl,Shader}/ %{_includedir}/MaterialXRender{,Glsl,Hw,Osl} %{_libdir}/*.so %{_libdir}/cmake/MaterialX/*.cmake %changelog %autochangelog