%define oname YafaRay # Please update the version and rebuild this package if blender is updated: %define blender_addons %{_datadir}/blender/2.79/scripts/addons/ %define addon_name %{name}_v3 # (akien) Disable bytecompile for now as it triggers a false positive: # Compiling /home/akien/Mageia/Checkout/yafaray/BUILDROOT/yafaray-3.3.0-7.mga6.x86_64/usr/share/blender/2.79/scripts/addons/yafaray/ot/yafaray_presets.py ... # File "/usr/share/blender/2.79/scripts/addons/yafaray/ot/yafaray_presets.py", line 341 # class Yafaray_Menu(StructRNA, _GenericUI, metaclass=RNAMeta): # Yafaray's own Preset Menu drawing: search method for files changed # ^ # SyntaxError: invalid syntax %define _python_bytecompile_build 0 %define __provides_exclude_from ^%{python3_sitearch}/.*\\.so|%{_libdir}/%{name}-plugins/.*\\.so Name: yafaray Version: 3.3.0 %define subrel 2 Release: %mkrel 1 Summary: A free open-source raytracing render engine Group: Graphics/3D License: LGPLv2+ URL: http://www.yafaray.org Source0: https://github.com/YafaRay/Core/archive/v%{version}/Core-%{version}.tar.gz Source1: https://github.com/YafaRay/Blender-Exporter/archive/v%{version}/Blender-Exporter-%{version}.tar.gz Source2: %{name}-blender.metainfo.xml BuildRequires: boost-devel BuildRequires: cmake BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(opencv) BuildRequires: pkgconfig(OpenEXR) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(zlib) BuildRequires: qt4-devel BuildRequires: swig # Name was changed in 2014 Provides: yafray = %{version} # libyafarayqt.so moved from Blender subpackage to main package Conflicts: yafaray-blender < 3.3.0-1 %description YafaRay is a free open-source raytracing render engine. Raytracing is a rendering technique for generating realistic images by tracing the path of light through a 3D scene. A render engine consists of a "faceless" computer program that interacts with a host 3D application to provide very specific raytracing capabilities "on demand". Blender 3D is the host application of YafaRay. %package blender Summary: Blender integration scripts Group: Graphics/3D License: GPLv2+ Requires: %{name} >= %{version}-%{release} Requires: blender %description blender YafRay uses a python-coded settings interface to set lighting and rendering parameters. This settings interface is launched by an entry automatically added to the Blender Render menu. %prep %autosetup -a 1 -n Core-%{version} # Fix for python 3.6+ sed -i 's|3.5|%{python3_version}|' CMakeModules/FindYafPythonLibs.cmake src/bindings/CMakeLists.txt # TODO: Patch to use LIB_SUFFIX and PR upstream sed -i -e 's|set(YAF_LIB_DIR lib)|set(YAF_LIB_DIR %{_lib})|g' CMakeLists.txt sed -i -e 's|set(YAF_TARGET_TYPE ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RUNTIME)|\ set(YAF_TARGET_TYPE ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/%{_lib} RUNTIME)|g' CMakeLists.txt mv Blender-Exporter-%{version} %{addon_name} # Fix setup for standalone + Blender install sed -i -e "s|PLUGIN_PATH =.*|PLUGIN_PATH = os.path.join('%{_prefix}', '%{_lib}', '%{name}-plugins')|" %{addon_name}/__init__.py sed -i -e "s|@YAFARAY_BLENDER_EXPORTER_VERSION@|%{version}|g" %{addon_name}/__init__.py %build %cmake \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DUSER_RELEASE_OPTIMIZATION_FLAGS="%{optflags} -std=c++11 -O3 -ffast-math" \ -DWITH_QT=ON \ -DYAF_BINDINGS_PY_DIR=%{python3_sitearch} \ -DYAF_PY_VERSION=%{python3_version} %make_build %install %make_install -C build install -d %{buildroot}%{blender_addons} mv %{addon_name}/tests %{addon_name}_tests cp -pr %{addon_name} %{buildroot}%{blender_addons} # FIXME workaround for: https://github.com/K-3D/k3d/issues/15 ln -s %{_bindir}/%{name}-xml %{buildroot}%{_bindir}/yafray install -D -m644 %{_sourcedir}/%{name}-blender.metainfo.xml \ %{buildroot}%{_datadir}/metainfo/%{name}-blender.metainfo.xml # Let RPM pick docs in the file section rm -rf %{buildroot}%{_docdir}/%{name} # We don't ship those for now, it doesn't seem built to be used # as a shared library. rm -fr %{buildroot}%{_includedir}/%{name} %files %license LICENSES %doc AUTHORS CHANGELOG README %doc tests/* %{_bindir}/yafray %{_bindir}/%{name}-xml %{_datadir}/%{name}/ %{_libdir}/%{name}-plugins/ %{_libdir}/libyafaray_v3_core.so %{_libdir}/libyafaray_v3_plugin.so %{_libdir}/libyafarayqt.so %files blender %doc %{addon_name}_tests/* %{blender_addons}/%{addon_name}/ %{_datadir}/metainfo/%{name}-blender.metainfo.xml %{python3_sitearch}/_yaf*.so %{python3_sitearch}/yaf*.py* %changelog * Mon Jul 23 2018 akien <akien> 3.3.0-1.2.mga6 (not released yet) + Revision: 1244974 - Fix conflicts version copied from cauldron - Fix incorrect installation of Blender plugin - Blender plugin is GPLv2+, not LGPLv2+ - Move Qt library to main package, it's not related to Blender plugin - Package test scenes in doc folders - Add metainfo file from Fedora + daviddavid <daviddavid> - new version: 3.3.0 - update Source URL - switch to cmake and python3 - fix blender addons path - honor user OPTIMIZATION_FLAGS thus fixing empty debugsourcefiles.list * Sat Feb 06 2016 umeabot <umeabot> 0.1.1-7.mga6 + Revision: 941820 - Mageia 6 Mass Rebuild * Wed Oct 15 2014 umeabot <umeabot> 0.1.1-6.mga5 + Revision: 748613 - Second Mageia 5 Mass Rebuild * Sun Sep 28 2014 alexl <alexl> 0.1.1-5.mga5 + Revision: 731445 - added symlink /usr/bin/yafray * Tue Sep 16 2014 umeabot <umeabot> 0.1.1-4.mga5 + Revision: 690815 - Mageia 5 Mass Rebuild * Sun Aug 24 2014 luigiwalser <luigiwalser> 0.1.1-3.mga5 + Revision: 667002 - rebuild for ilmbase and OpenEXR * Thu May 01 2014 luigiwalser <luigiwalser> 0.1.1-2.mga5 + Revision: 619157 - rebuild for ilmbase * Wed Apr 16 2014 alexl <alexl> 0.1.1-1.mga5 + Revision: 615318 - version 0.1.1 with blender integration - rename yafray in yafaray - rename yafray in yafaray * Tue Apr 15 2014 alexl <alexl> 0.0.9-1.mga5 + Revision: 615152 - imported package yafray