#%%global commit0 60452c5586772bcf2eccc47ed5fa9b2930c685b8
#%%global commit1 b521835148d1cd77bcad0f64a989ff47934b9ffc
#%%global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7})
#%%global shortcommit1 %%(c=%%{commit1}; echo ${c:0:7})
#%%global date 20170221
%global debug_package %{nil}
%global yname yafaray
%global alphatag beta
# [Fedora] Turn off the brp-python-bytecompile script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
Name: YafaRay
License: LGPLv2+
Summary: A free open-source ray-tracing render engine
Version: 3.3.0
URL: http://www.yafaray.org/
Release: 10%{?date:.%{date}git}%{?dist}
# Comment source release and use git snapshot instead as suggested by upstream
# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/ZQTGNFJFTXHWWPYED44NVK3PLCUTGG6B/
#Source0: https://github.com/%%{name}/Core/archive/v%%{version}-%%{alphatag}/Core-%%{version}-%%{alphatag}.tar.gz
%{?shortcommit0:
Source0: https://github.com/%{name}/Core/archive/%{commit0}.tar.gz#/Core-%{shortcommit0}.tar.gz}
%{!?shortcommit0:
Source0: https://github.com/%{name}/Core/archive/v%{version}.tar.gz#/Core-%{version}.tar.gz}
%{?shortcommit1:
Source1: https://github.com/%{name}/Blender-Exporter/archive/%{commit1}.tar.gz#/Blender-Exporter-%{shortcommit1}.tar.gz}
%{!?shortcommit1:
Source1: https://github.com/%{name}/Blender-Exporter/archive/v%{version}.tar.gz#/Blender-Exporter-%{version}.tar.gz}
Source2: yafaray-blender.metainfo.xml
BuildRequires: blender-rpm-macros
BuildRequires: boost-devel
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: git
BuildRequires: freetype-devel
BuildRequires: libappstream-glib
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
BuildRequires: libxml2-devel
BuildRequires: opencv-devel
BuildRequires: OpenEXR-devel >= 1.2
BuildRequires: python3-devel
BuildRequires: qt-devel
BuildRequires: swig
BuildRequires: zlib-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
# Set exclusive arch
# https://koji.fedoraproject.org/koji/taskinfo?taskID=17920427
ExclusiveArch: %{ix86} x86_64
%description
YafaRay is a free open-source ray-tracing render engine.
Ray-tracing 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 ray-tracing capabilities "on demand".
Blender 3D is the host application of YafaRay.
%package lib
Summary: Libraries for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description lib
The %{name}-devel package contains libraries and header files for
applications that use %{name}.
%package blender
Summary: Blender integration scripts%{name} = %{version}-%{release}
Requires: blender
Obsoletes: %{yname}-blender < 0.1.1-4
Provides: %{yname}-blender = %{version}-%{release}
%description blender
YafaRay 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
%if 0%{?shortcommit0}
%autosetup -D -n Core-%{commit0}
%autosetup -D -T -a 1 -n Core-%{commit0}
#Fix syntax for python 3.5+ declaration
sed -i 's|metaclass=RNAMeta|metaclass.RNAMeta|' Blender-Exporter-%{commit1}/ot/%{yname}_presets.py
%else
%autosetup -D -n Core-%{version}
%autosetup -D -T -a 1 -n Core-%{version}
#Fix syntax for python 3.5+ declaration
sed -i 's|metaclass=RNAMeta|metaclass.RNAMeta|' Blender-Exporter-%{version}/ot/%{yname}_presets.py
%endif
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
# Set proper permission per packaging guideline
find . -name "*.h" -exec chmod 644 {} \;
find . -name "*.c" -exec chmod 644 {} \;
find . -name "*.cc" -exec chmod 644 {} \;
%build
%cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true \
-DCMAKE_SKIP_RPATH:BOOL=true \
-DDEBUG_BUILD=OFF \
-DWITH_QT=ON \
-DUSER_DBGFLAGS="%{optflags} -O3 -ffast-math"
%make_build VERBOSE=1
%install
%make_install VERBOSE=1
# Let RPM pick docs in the file section
rm -fr %{buildroot}%{_docdir}/%{yname}
# Install add-on on Blender directory
mkdir -p %{buildroot}%{blender_addons}/%{yname}
%if 0%{?shortcommit0}
cp -pR Blender-Exporter-%{commit1}/* \
%{buildroot}%{blender_addons}/%{yname}
%else
cp -pR Blender-Exporter-%{version}/* \
%{buildroot}%{blender_addons}/%{yname}
%endif
# AppData
install -p -m 644 -D %{SOURCE2} %{buildroot}%{_datadir}/metainfo/%{yname}-blender.metainfo.xml
%check
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/%{yname}-blender.metainfo.xml
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%license LICENSES
%doc AUTHORS CHANGELOG README
%{_bindir}/%{yname}-xml
%{_datadir}/%{yname}/*
%files lib
%{_includedir}/%{yname}/
%{_libdir}/%{yname}-plugins
#%%{_libdir}/*.py
%{_libdir}/*.so
%{?with_qt:%{_libdir}/libyafarayqt.so}
%files blender
%{_datadir}/metainfo/%{yname}-blender.metainfo.xml
%{blender_addons}/%{yname}/*
%changelog
* Wed Apr 04 2018 Luya Tshimbalanga <luya@fedoraproject.org> - 3.3.0-10
- Actually rebuild for blender 2.78b
* Thu Mar 29 2018 Luya Tshimbalanaga <luya@fedoraproject.org> - 3.3.0-9
- Rebuild for blender-2.79b
* Mon Mar 05 2018 Adam Williamson <awilliam@redhat.com> - 3.3.0-8
- Rebuild for opencv soname bump
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Tue Jan 23 2018 Luya Tshimbalanga <luya@fedoraproject.org> - 3.3.0-6
- Rebuild for embree-3.0.0-beta.0
* Fri Jan 19 2018 Luya Tshimbalanga <luya@fedoraproject.org> - 3.3.0-5
- Rebuilt for embree 2.12.2
* Thu Dec 28 2017 Luya Tshimbalanga <luya@fedoraproject.org> - 3.3.0-4
- Rebuild for OpenCV
* Thu Sep 14 2017 Luya Tshimbalanga <luya@fedoraproject.org> - 3.3.0-3
- bump
* Wed Sep 13 2017 Luya Tshimbalanga <luya@fedoraproject.org> - 3.3.0-2
- Rebuild for Blender 2.79
* Wed Aug 23 2017 Luya Tshimbalanga <releng@fedoraproject.org> - 3.3.0-4
- Update to 3.3.0
- Set enabled blender addon
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Jul 20 2017 Kalev Lember <klember@redhat.com> - 3.2.0-2
- Rebuilt for Boost 1.64
* Fri May 26 2017 Luya Tshimbalanga <luya_tfz@thefinalzone.net> - 3.2.0-1
- Upstream update
* Fri Apr 28 2017 Simone Caronni <negativo17@gmail.com> - 3.2.0-0.7.20170221git
- Rebuild for OpenCV 3.2.0 update.
* Sat Feb 25 2017 Luya Tshimbalanga <luya_tfz@thefinalzone.net> - 3.2.0-0.6.20170221git
- Enable preset
- Change upstream url
* Wed Feb 22 2017 Luya Tshimbalanga <luya_tfz@thefinalzone.net> - 3.2.0-0.5.20170221git
- Latest git snapshot
* Fri Feb 17 2017 Luya Tshimbalanga <luya_tfz@thefinalzone.net> - 3.2.0-0.4.20170217git
- Latest git snapshot
- Fix spelling to adhere US spelling guideine
- Fix license
- Fix mixed use of spaces and tab errors
- Set source files non executables
* Mon Feb 13 2017 Luya Tshimbalanga <luya_tfz@thefinalzone.net> - 3.2.0-0.3.20170212git
- Add conditional statement for release line
- Align description to 80 columns as possible
- Disable rpath per Fedora packaging guideline
- Let RPM pick docs in the file section
- Add missing requirement libappstream-glib
- Temporarily disable preset in yafaray-blender
* Sun Feb 12 2017 Luya Tshimbalanga <luya_tfz@thefinalzone.net> - 3.2.0-0.2.20170212git
- Latest git snapshot
- Add libtiff dependency
- Use versioning from Fedora packaging guideline
- Define sources url
* Wed Feb 08 2017 Luya Tshimbalanga <luya_tfz@thefinalzone.net> - 3.2.0-0.1.20170131git
- Move appdata to its own file
- Latest git snapshot
- Use POSITION_INDEPENDENT_CODE to prevent compilation error
- Fix library path
* Thu Jan 12 2017 Luya Tshimbalanga <luya_tfz@thefinalzone.net> - 3.1.1-0.2.beta
- Fixed changelog by including missing upstream update info
- Fixed url for the sources
- Added requirement for base package
- Fix lib sharing, relic for legacy method
- Further cleaned up spec
* Thu Sep 22 2016 Luya Tshimbalanga <luya@fedoraproject.org> - 3.0.0-0.1.beta
- Update to 3.1.1-beta
* Sat Jul 16 2016 Luya Tshimbalanga <luya@fedoraproject.org> - 3.0.0-0.1.beta
- Update to 3.0.0-beta
- Cleaned up spec file
- Dropped scons as dependency
* Tue Mar 08 2016 Yaakov Selkowitz <yselkowi@redhat.com> - 0.1.1-14
- Fix FTBFS with GCC 6 (#1307303)
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.1-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Nov 27 2013 Rex Dieter <rdieter@fedoraproject.org> - 0.1.1-10
- rebuild (openexr)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sun Mar 10 2013 Rex Dieter <rdieter@fedoraproject.org> - 0.1.1-8
- rebuild (OpenEXR)
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild