File blender.spec of Package blender

#
# spec file for package blender (Version 2.49a)
#
# Copyright (c) 2009 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

BuildRequires:  Mesa-devel OpenEXR-devel SDL-devel freealut-devel freetype2-devel ftgl-devel
BuildRequires:  gcc-c++ libjpeg-devel libogg-devel libstdc++-devel libtheora-devel zlib-devel
BuildRequires:  libao-devel libdrm-devel libpng-devel libquicktime-devel libtiff-devel libvorbis-devel
BuildRequires:  openal-devel openssl-devel python-devel scons update-desktop-files xorg-x11 yafray
BuildRequires:  desktop-file-utils kdebase3-runtime shared-mime-info yasm-devel
BuildRequires:  gettext-tools
%if %suse_version > 1110
BuildRequires:  rpm >= 4.6.0
%endif

Name:           blender
License:        GNU General Public License version 2 or later (GPL v2 or later)
Group:          Productivity/Graphics/Visualization/Raytracers
Summary:        3D Animation and Rendering Software
Version:        2.49a
Release:        2
AutoReqProv:    on
Requires:       yafray
Url:            http://www.blender.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        blender-%{version}.tar.bz2
#Source1:	blender-examples.tar.bz2
Source2:        geeko.blend
Source3:        geeko.README
Source4:        blender-sample
Source5:        blenderplayer.desktop
Source6:        blender.xpm
Source7:        blender_wrapper.tar.bz2
Source9:        blender.desktop
Patch0:         blender-2.48-bmake.patch
Patch1:         blender-2.48-gcc43.patch
Patch2:         blender-2.48-libtiff.patch
Patch3:         blender-2.48-python64.patch
Patch4:         blender-2.48-strncat.patch
Patch5:         blender-2.48-undefine-operation.patch
Patch6:         blender-2.48-uninitialized_variables.patch
#only fix issue lib -> lib64 in wrapper
Patch7:         blender-wrapper.patch
#Patch submitted upstream - Blender Patches item #19234,
Patch8:         blender-2.49-uninit_var.patch
Recommends:     blender-doc

%description
Blender is the open source software for 3D modeling, animation,
rendering, post-production, interactive creation and playback.
Available for all major operating systems under the GNU General Public
License.



Authors:
--------
    Stichting Blender Foundation 
    Frederiksstraat 12-2 
    1054 LC Amsterdam 
    the Netherlands 
    foundation(at)blender(dot)org 

%package doc
License:        GNU General Public License version 2 or later (GPL v2 or later)
Summary:        Documentation for blender
Group:          Productivity/Graphics/Visualization/Raytracers
Requires:       %{name} = %{version}
#noarch subpackage of binary package only possible for 11.2 onwards
%if %suse_version > 1110
BuildArch:      noarch
%endif

%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.

You can easy build and manage complex environments. The renderer is
versatile and extremely fast. All basic animation principles (curves &
keys) are well implemented.

%package devel
License:        GNU General Public License version 2 or later (GPL v2 or later)
Summary:        Include files for blender plugin development
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
This package provides the include files necessary to develop and 
build plugins for Blender

%prep
%setup -q -a7
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%if "%_lib" == "lib64"
%patch7
%endif
%patch8
#fix locale naming
%__mv bin/.blender/locale/hr_HR bin/.blender/locale/hr
%__sed -i -e '/LLIBS/s/ c / /' config/linux2-config.py
cat > user-config.py <<EOF
REL_CFLAGS = [$(echo %{optflags} | sed -e "s/[^ ]*/'&'/g" -e "s/ /,/g")]
EOF

%build
%__rm -rf ../build
export BF_TIFF_LIB="%{_libdir}/libtiff.so"
export BF_TIFF_INC="%{_includedir}"
export BF_PYTHON_INC="%{py_incdir}"
export BF_GETTEXT_LIBPATH="%{_libdir}"
export BF_ICONV_LIBPATH="%{_libdir}"
export BF_FFMPEG_LIBPATH="%{_libdir}"
export BF_OPENGL_LIBPATH="%{_usr}/%{_lib}"
export BF_FFMPEG_LIBPATH="%{_usr}/%{_lib}"
scons   BF_QUIET=0 \
	BF_PYTHON_VERSION="%{py_ver}" \
	BF_PYTHON_INC="%{py_incdir}" \
	WITH_BF_OPENAL=true \
	BF_OPENAL_LIBPATH="%{_usr}/include/AL" \
	WITH_BF_SDL=true \
	BF_PTHREADS=true \
	WITH_BF_FFMPEG=false \
	WITH_BF_ZLIB=true \
	WITH_BF_INTERNATIONAL=true \
        WITH_BF_GAMEENGINE=true \
        WITH_BF_VERSE=true \
        WITH_BF_PLAYER=true \
	WITH_BF_ODE=true \
	WITH_BF_OPENEXR=true \
	WITH_BF_BULLET=true \
	WITH_BF_QUICKTIME=no \
	BF_QUICKTIME_INC="%{_usr}/include/quicktime" \
	WITH_BF_FTGL=true \
	WITH_BF_ICONV=no \
	WITH_BF_LIBMP3LAME=no \
	WITH_BF_X264=no \
	CFLAGS="%{optflags}"
# Build plugins
pushd release/plugins
   if [ -d ./include ]; then
	%__rm -rf ./include
   fi
   %__ln_s ../../source/blender/blenpluginapi include
   %__chmod +x bmake
   %__make %{?jobs:-j%{jobs}}
popd

%install
%__install -D ./blender "%{buildroot}%{_bindir}/blender"
%__install -d "%{buildroot}%{_docdir}/%{name}"
# install
pushd ../install/linux2
%__install -d "%{buildroot}%{_libdir}/%{name}"
%__rm `find . -name "*make*"`
%__rm `find . -name "*c"`
%__cp -pR * "%{buildroot}%{_libdir}/%{name}"
%__cp -pR .blender "%{buildroot}%{_libdir}/%{name}"
popd
# plugins
%__install -d "%{buildroot}%{_libdir}/%{name}/.blender/plugins"
# find all plugins create subdirs and cp them one by one
pushd release/plugins
find . -name "*so" | awk -F "/" '{line="";for(i=2;i<NF;i++) line=line $i"/";pole[line]=line} END {for( i in pole) print pole[i]}' | \
	while read line; do
		pushd $line 
		%__install -d "%{buildroot}%{_libdir}/%{name}/.blender/plugins/${line}"
		%__cp *.so "%{buildroot}/%{_libdir}/%{name}/.blender/plugins/${line}/"
		popd
	done 
popd
# fix exutable bit on various scripts (they should not be exutable)
find "%{buildroot}%{_libdir}/%{name}/.blender" -name '*py' -exec %__chmod u-x,g-x,o-x \{\} \;
# copy doc into right place
%__cp -p "%{SOURCE2}" "%{SOURCE3}" COPYING README doc/* \
      "%{buildroot}%{_docdir}/%{name}/"
%__install -m0755 "%{SOURCE4}" "%{buildroot}%{_bindir}/"
%__install -d "%{buildroot}%{_datadir}/pixmaps"
%__install -D -m 0644 "%{SOURCE6}" "%{buildroot}%{_datadir}/pixmaps/blender.xpm"
%suse_update_desktop_file -i "%{name}" Graphics 3DGraphics
# x-blend.desktop
%__install -dm 755 %{buildroot}/opt/kde3/share/mimelnk/application
%__cat > %{buildroot}/opt/kde3/share/mimelnk/application/x-blend.desktop <<EOF
%suse_update_desktop_file -c
[Desktop Entry]
Comment=Blender Template
Icon=%{_datadir}//pixmaps/blender.xpm
DefaultApp=blender
Type=MimeType
MimeType=application/x-blend
Patterns=*.blend;
EOF
# symlink blenderplayer
%__ln_s %{_libdir}/blender/blenderplayer %{buildroot}/%{_bindir}/blenderplayer

%post
/usr/bin/update-mime-database "%{_datadir}/mime" >/dev/null

%postun
/usr/bin/update-mime-database "%{_datadir}/mime" >/dev/null

%clean
%__rm -rf ../build
%__rm -rf ../install
%__rm -rf "%{buildroot}"

%files
%defattr(-,root,root)
%{_bindir}/blender
%{_bindir}/blender-sample
%{_bindir}/blenderplayer
%dir %{_libdir}/blender/
%{_libdir}/blender/blender
%{_libdir}/blender/blenderplayer
%dir %{_libdir}/blender/plugins
%{_libdir}/blender/plugins/Makefile
%dir %{_libdir}/blender/plugins/texture
%{_libdir}/blender/plugins/texture/Makefile
%dir %{_libdir}/blender/plugins/sequence
%{_libdir}/blender/plugins/sequence/Makefile
%dir %{_libdir}/blender/.blender
%{_libdir}/blender/.blender/.Blanguages
%{_libdir}/blender/.blender/.bfont.ttf
%dir %{_libdir}/blender/.blender/plugins/
%dir %{_libdir}/blender/.blender/plugins/sequence
%{_libdir}/blender/.blender/plugins/sequence/*.so
%dir %{_libdir}/blender/.blender/plugins/texture
%{_libdir}/blender/.blender/plugins/texture/*.so
%dir %{_libdir}/blender/.blender/scripts
%{_libdir}/blender/.blender/scripts/*.py
%dir %{_libdir}/blender/.blender/scripts/bpydata
%dir %{_libdir}/blender/.blender/scripts/bpydata/config
%dir %{_libdir}/blender/.blender/scripts/bpymodules
%{_libdir}/blender/.blender/scripts/bpymodules/*.py
%dir %{_libdir}/blender/.blender/scripts/bpymodules/colladaImEx
%{_libdir}/blender/.blender/scripts/bpymodules/colladaImEx/*.py
%{_libdir}/blender/.blender/scripts/bpymodules/colladaImEx/*.png
%dir %{_libdir}/blender/.blender/locale
%dir %{_libdir}/blender/.blender/locale/*/
%dir %{_libdir}/blender/.blender/locale/*/LC_MESSAGES
%{_libdir}/blender/.blender/locale/ar/LC_MESSAGES/blender.mo
%{_libdir}/blender/.blender/locale/*/LC_MESSAGES/blender.mo
%dir %{_libdir}/blender/.blender/locale/hr/hr_HR/LC_MESSAGES
%{_libdir}/blender/.blender/locale/hr/hr_HR
%{_libdir}/blender/.blender/locale/hr/hr_HR/LC_MESSAGES/*.mo
%dir %{_libdir}/blender/icons
%{_libdir}/blender/icons/16x16
%{_libdir}/blender/icons/22x22
%{_libdir}/blender/icons/32x32
%{_libdir}/blender/icons/scalable
%{_libdir}/blender/icons/*/blender.png
%{_libdir}/blender/icons/*/blender.xcf.bz2
%{_libdir}/blender/icons/*/blender.svg
#%{_libdir}/blender/icons/scalable/blender.svg
%{_libdir}/blender/verse
%doc %{_libdir}/blender/*.txt
%doc %{_libdir}/blender/.blender/scripts/bpydata/*.txt
%doc %{_libdir}/blender/.blender/scripts/bpydata/config/readme.txt

%files doc
%defattr(-,root,root)
%{_datadir}/applications/blender.desktop
/opt/kde3/share/mimelnk/application/x-blend.desktop
%{_datadir}/pixmaps/blender.xpm
%dir %{_datadir}/doc/packages/blender/
%{_datadir}/doc/packages/blender/*
#%{_datadir}/doc/packages/blender/BlenderQuickStart.pdf
#%{_datadir}/doc/packages/blender/blender.html
#%{_datadir}/doc/packages/blender/COPYING
#%{_datadir}/doc/packages/blender/README
#%{_datadir}/doc/packages/blender/geeko.*

%files devel
%defattr(-,root,root)
%dir %{_libdir}/blender/plugins/include/
%{_libdir}/blender/plugins/include/*.h
%{_libdir}/blender/plugins/include/*.DEF

%changelog
openSUSE Build Service is sponsored by