File blender.spec of Package blender
#
# spec file for package blender
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
# norootforbuild
%define collada 1
%define wplayer 1
# Use rpmbuild -D 'DISTRIBUTABLE 0' to build original code.
%define DISTRIBUTABLE 1
BuildRequires: pcre-devel pkg-config readline-devel
BuildRequires: MesaGLw-devel OpenEXR-devel cmake fdupes freealut-devel freetype2-devel ftgl-devel
BuildRequires: boost-devel fftw3-devel gcc-c++ libogg-devel libstdc++-devel libtheora-devel zlib-devel
BuildRequires: libao-devel libdrm-devel libpng-devel libquicktime-devel libtiff-devel libvorbis-devel ruby-devel
BuildRequires: glew-devel libtool openssl-devel update-desktop-files xorg-x11 xorg-x11-devel
BuildRequires: desktop-file-utils libsamplerate-devel libsndfile-devel libxml2-devel shared-mime-info yasm yasm-devel
BuildRequires: epydoc gettext-tools libexpat-devel libjack-devel libopenssl-devel perl-libxml-perl
BuildRequires: doxygen help2man libSDL-devel lzo-devel openal-soft-devel perl-Text-Iconv ruby xz xz-devel
%if 0%{?suse_version} > 1120
BuildRequires: pkgconfig(python3)
%else
BuildRequires: python3 python3-devel
%endif
#BuildRequires: libjpeg-devel
BuildRequires: libjpeg62-devel
%if 0%{?collada} == 1
BuildRequires: openCOLLADA-devel
%endif
BuildRequires: liblcms-devel
%if %DISTRIBUTABLE <= 0
BuildRequires: ffmpeg-devel
%endif
Name: blender
License: GPLv2+
Group: Productivity/Graphics/3D Editors
Summary: A 3D Modelling And Rendering Package
Version: 2.56.34784
Release: 1
Url: http://www.blender.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %{name}-%{version}.tar.xz
Source1: Changes.txt
Source2: geeko.blend
Source3: geeko.README
Source4: blender-sample
Source5: blenderplayer.1
Source6: blender.xpm
Source7: x-blend.desktop
Patch0: blender-2.48-python64.patch
Patch1: blender-2.48-undefine-operation.patch
# Patch submitted upstream - Blender Patches item #19234,
Patch2: blender-2.50-uninit-var.patch
Patch4: blender-2.55-gcc46fix.patch
%if %DISTRIBUTABLE == 1
# Patch3 is needed due to the purging of everything mpeg
Patch3: blender-2.55-blenkernel.patch
%endif
Recommends: blender-doc
%description
Blender is a 3D modelling and rendering package. It is the in-house
software of a high quality animation studio, Blender has proven to
be an extremely fast and versatile design instrument. The software
has a personal touch, offering a unique approach to the world of
Three Dimensions. Use Blender to create TV commercials, to make
technical visualizations, business graphics, to do some morphing,
or design user interfaces. You can easy build and manage complex
environments. The renderer is versatile and extremely fast. All
basic animation principles (curves & keys) are well implemented.It
includes tools for modeling, sculpting, texturing (painting,
node-based shader materials, or UV mapped), UV mapping, rigging and
constraints, weight painting, particle systems, simulation (fluids,
physics, and soft body dynamics and an external crowd simulator),
rendering, node-based compositing, and non linear video editing,
as well as an integrated game engine for real-time interactive 3D
and game creation and playback with cross-platform compatibility.
http://www.blender.org
Authors:
--------
Stichting Blender Foundation
Frederiksstraat 12-2
1054 LC Amsterdam
the Netherlands
foundation(at)blender(dot)org
%package doc
Summary: Documentation for blender
License: GPLv2+
Group: Documentation/HTML
BuildArch: noarch
%description doc
Being the in-house software of a high quality animation studio, Blender
has proven to be an extremely fast and versatile design instrument. The
software has a personal touch, offering a unique approach to the world
of Three Dimensions. Use Blender to create TV commercials, to make
technical visualizations, business graphics, to do some morphing, or
design user interfaces.
This package includes API documentation and example plugin programs.
%package devel
Summary: Include files for blender plugin development
License: GPLv2+
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Recommends: blender-doc
%description devel
This package provides the include files necessary to develop and
build plugins for Blender.
find %1 -name '*.pyc' -exec rm -f {} \\; \
python3 -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %%1 \
%global __python3 /usr/bin/python3
%global py3_abi_kind %(python3-config --abiflags)
%global python3_ver %(python3 -c "import sys; v=sys.version_info[:2]; print('%%d.%%d'%%v)" 2>/dev/null || echo PYTHON-NOT-FOUND)
%global python3_prefix %(python3 -c "import sys; print(sys.prefix)" 2>/dev/null || echo PYTHON-NOT-FOUND)
%global python3_libdir %{python3_prefix}/%{_lib}/python%{python3_ver}%{py3_abi_kind}
%global python3_incdir %{python3_prefix}/include/python%{python3_ver}%{py3_abi_kind}
%global python3_sitedir %{python3_libdir}/site-packages
%global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())" 2>/dev/null || echo PYTHON-NOT-FOUND)
%global python3_compile \
%{-O: \
find %%1 -name '*.pyo' -exec rm -f {} \\; \
python3 -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %%1 \
}
%global python3_requires \
%define minver %python3_ver \
%define maxver %(python3 -c "import sys; a,b=sys.version_info[:2]; print('%%d.%%d'%%(a,b+1))" 2>/dev/null || echo PYTHON-NOT-FOUND) BuildRequires: python3 %{-d:python3-devel} PreReq: python3 >= %minver, python3 < %maxver
%prep
%setup -q
%patch0
%patch1
%patch2
%patch4
%if %DISTRIBUTABLE == 1
%patch3
rm -rf release/scripts/presets/ffmpeg intern/audaspace/ffmpeg
find ./ -name *mpeg* -exec rm -rf {} \;
%endif
%define buildir %{_builddir}/%{name}/%{version}
echo %{buildir}
echo "python3_version = %python3_ver"
echo "python3_prefix = %python3_prefix"
echo "python3_libdir = %python3_libdir"
echo "python3_incdir = %python3_incdir"
echo "python3_sitedir = %python3_sitedir"
echo "python3_sitelib = %python3_sitelib"
echo "python3_requires = %python3_requires"
echo "python3_requires-d = %python3_requires -d"
echo "python_sitelib = %python_sitelib"
%build
export CFLAGS="$RPM_OPT_FLAGS -pipe -fPIC -funsigned-char -fno-strict-aliasing -g -ggdb"
export CXXFLAGS=$CFLAGS
export BF_TIFF_LIB="%{_libdir}/libtiff.so"
export BF_TIFF_INC="%{_includedir}"
export BF_GETTEXT_LIBPATH="%{_libdir}"
#WITH_INTERNATIONAL
mkdir -p Build
pushd Build
# -DPYTHON_LIB=%%{_libdir}/libpython3.1.so \
cmake ../ \
-G"Unix Makefiles" \
-DWITH_FFTW3:BOOL=on \
-DWITH_JACK:BOOL=on \
-DWITH_CODEC_SNDFILE:BOOL=on \
-DWITH_IMAGE_OPENJPEG:BOOL=off \
%if %{collada} == 1
-DWITH_OPENCOLLADA:BOOL=on \
-DOPENCOLLADA=%{_prefix} \
-DOPENCOLLADA_LIBPATH=%{_libdir} \
-DOPENCOLLADA_INC=%{_includedir} \
%else
-DWITH_OPENCOLLADA:BOOL=off \
%endif
-DPYTHON_LIBPATH=%{_libdir} \
-DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_ver}%{py3_abi_kind}.so \
-DPYTHON_INCLUDE_DIRS=%{python3_incdir} \
-DWITH_PYTHON_INSTALL:BOOL=off \
-DWITH_PYTHON:BOOL=on \
-DWITH_IMAGE_OPENJPEG:BOOL=off \
-DWITH_GAMEENGINE:BOOL=on \
%if %DISTRIBUTABLE == 1
-DWITH_CODEC_FFMPEG:BOOL=off \
%else
-DWITH_CODEC_FFMPEG:BOOL=on \
%endif
-DWITH_CXX_GUARDEDALLOC:BOOL=on \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=on \
%if %wplayer == 1
-DWITH_PLAYER:BOOL=on \
%else
-DWITH_PLAYER:BOOL=off \
%endif
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix}
%__make %{?jobs:-j%{jobs}}
popd
# -e 'CFLAGS="$CFLAGS `python3-config --includes` CXXFLAGS=$CFLAGS'
%install
# Get the current release version for blender needed while building svn.
# It works even though rpmbuild complains
%define rlversion %(python %{buildir}/release/getversion.py)
echo %{rlversion}
pushd Build
make DESTDIR=%{?buildroot} install
popd
echo %{rlversion}
# Factory is now of the opinion that every /usr/bin file needs a man page,
%if %wplayer == 1
# Generate man page with help2man
pushd %{buildroot}%{_mandir}/man1
#cp -v %%{buildroot}%%{_bindir}/blenderplayer ./
#help2man \
# --version-string="%%{version}" \
# --help-option="-h" -n "a utility for previewing .blend files" \
# -s 1 -m "User Commands" -S "Stichting Blender Foundation" -N -o blenderplayer.1 ./'blenderplayer -h ""'
#rm blenderplayer
popd
cp -v %{S:5} %{buildroot}%{_mandir}/man1
%endif
# Fix any .py files with shebangs and wrong permissions.
if test -z `find %{buildroot} -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \
then break;
else chmod -f 0755 `find %{buildroot} -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \
fi
# Copy text files to correct place.
mkdir -p %{buildroot}%{_docdir}
mv -f %{buildroot}%{_datadir}/doc/%{name} %{buildroot}%{_docdir}/
# install blender sample.
%__install -D -m 0644 %{S:2} %{buildroot}%{_docdir}/%{name}/
%__install -D -m 0644 %{S:3} %{buildroot}%{_docdir}/%{name}/
%__install -D -m 0755 %{S:4} %{buildroot}%{_bindir}/
# Add Changes.txt
cp -v %{S:1} %{buildroot}%{_docdir}/%{name}/
# Doxygen is broken in 11.3 see bnc # 650330
pushd doc
if test `doxygen --version` != 1.6.3; \
then \
# Build documentation until the script is fixed
doxygen -u Doxyfile; \
doxygen Doxyfile; \
fi
cp -r * %{buildroot}%{_docdir}/%{name}/
rm -rf %{buildroot}%{_docdir}/%{name}/Doxy* %{buildroot}%{_docdir}/%{name}/doxy* %{buildroot}%{_docdir}/%{name}/python_api \
%{buildroot}%{_docdir}/%{name}/manpage; \
popd
# blender-devel stuff soon depreciated.
mkdir -p %{buildroot}%{_includedir}/%{name}
cp -pr source/blender/blenpluginapi/* %{buildroot}%{_includedir}/%{name}/
rm -f %{buildroot}%{_includedir}/%{name}/blenpluginapi
# Add more icons.
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
cp release/freedesktop/icons/16x16/blender.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/
cp release/freedesktop/icons/22x22/blender.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/
cp release/freedesktop/icons/32x32/blender.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
pushd %{buildroot}%{_datadir}/pixmaps/
ln -s ../icons/hicolor/32x32/apps/blender.png blender.png
popd
# Install s6=blender.xpm and s11=v-2.55
%__install -D -m 0644 %{S:6} %{buildroot}%{_datadir}/pixmaps/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
pushd %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
ln -s ../../../../pixmaps/blender.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/blender.svg
popd
# Install s6=blender.xpm
%__install -D -m 0644 %{S:6} %{buildroot}%{_datadir}/pixmaps/
rm -f %{buildroot}%{_includedir}/%{name}/CMakeLists.txt %{buildroot}%{_includedir}/%{name}/SConscript %{buildroot}%{_includedir}/%{name}/intern/Makefile \
%{buildroot}%{_includedir}/%{name}/intern/pluginapi.c %{buildroot}%{_includedir}/%{name}/Makefile
%suse_update_desktop_file -i "%{name}"
# x-blend.desktop
%__install -D -m 0644 "%{S:7}" "%{buildroot}%{_datadir}/applications/x-blend.desktop"
%suse_update_desktop_file %{buildroot}/%{_datadir}/applications/x-blend.desktop
# Remove executables from buildroot/_docdir}/name
#find %%{buildroot}%%{_docdir}/%%{name} -name *.py -delete
if test -z `find %{buildroot}%{_docdir}/%{name} -name *.py -perm 0755 -print0|xargs -0r grep -l '#!'`; \
then break;
else chmod -f 0644 `find %{buildroot}%{_docdir}/%{name} -name *.py -perm 0755 -print0|xargs -0r grep -l '#!'`; \
fi
%find_lang %{name}
%fdupes -s %{buildroot}%{_datadir}
%post
/usr/bin/update-mime-database "%{_datadir}/mime" >/dev/null
%postun
/usr/bin/update-mime-database "%{_datadir}/mime" >/dev/null
%clean
%__rm -rf "%{buildroot}"
%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/blender
%{_bindir}/blender-thumbnailer.py
%{_bindir}/blender-sample
%{_docdir}/%{name}/geeko.*
%{_docdir}/%{name}/Changes.txt
%if %wplayer == 1
%{_bindir}/blenderplayer
%{_mandir}/man1/blenderplayer.1.gz
%endif
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/%{rlversion}
%{_datadir}/%{name}/%{rlversion}/*
%{_mandir}/man1/blender.1.gz
%{_datadir}/applications/blender.desktop
%{_datadir}/applications/x-blend.desktop
%{_datadir}/pixmaps/blender.xpm
%{_datadir}/icons/hicolor/16x16/apps/blender.png
%{_datadir}/icons/hicolor/22x22/apps/blender.png
%{_datadir}/icons/hicolor/32x32/apps/blender.png
%{_datadir}/icons/hicolor/scalable/apps/blender.svg
%{_datadir}/pixmaps/blender.svg
%{_datadir}/pixmaps/blender.png
%files doc
%defattr(-,root,root)
%dir %{_docdir}/%{name}/
%doc %{_docdir}/%{name}/*
%exclude %{_docdir}/%{name}/geeko.*
%exclude %{_docdir}/%{name}/Changes.txt
%files devel
%defattr(-,root,root)
%dir %{_includedir}/%{name}/
%{_includedir}/%{name}/*.h
%{_includedir}/%{name}/*.DEF
%changelog