#!/bin/sh # Heavily based on the Slackware 11.0 SlackBuild # http://blender.org/ # Packager Andrea Sciucca ( gohanz at infinito.it) # http://www.slacky.it # Need Scons to Compile. # Required: Openexr, openal, freealut, smpeg, faad2, faac # Required: FFmpeg, lame, libdc1394, libgsm, libraw1394 # Required: xvid, imlib2, a52, id3lib, lzo,mpeg4ip # Required: Fmod, libdts, ftgl. CWD=`pwd` TMP=${TMP:-/tmp/tgz} PKG=$TMP/package/blender NAME=blender VERSION=2.43 ARCH=${ARCH:-i686} BUILD=1as SOURCE=http://mirror.cs.umn.edu/blender.org/source/$NAME-$VERSION.tar.gz if [ ! -e $NAME-$VERSION.tar.gz ]; then wget -c $SOURCE fi if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O3 -march=i686 -pipe -fomit-frame-pointer" elif [ "$ARCH" = "athlon64" ]; then SLKCFLAGS="-O2 -march=athlon64 -pipe" elif [ "$ARCH" = "athlonxp" ]; then SLKCFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi cd $TMP tar xvzf $CWD/$NAME-$VERSION.tar.gz echo -e "\E[0;32m+-------------------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild $NAME-$VERSION |\E[0;0m" echo -e "\E[0;32m+-------------------------------+\E[0;0m" cd $NAME-$VERSION find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; chown -R root:root . # Run configure and build with scons scons CFLAGS="$SLKCFLAGS" \ WITH_BF_PLAYER=no \ WITH_BF_FMOD=yes \ WITH_BF_ODE=yes \ WITH_BF_FFMPEG=yes \ WITH_BF_OPENAL=yes \ BF_FTGL=/usr \ BF_FTGL_INC=/usr/include/FTGL \ BF_FTGL_LIB=/usr/lib \ BF_INSTALLDIR=$PKG/usr/share/$NAME mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a COPYING ChangeLog INSTALL README $PKG/usr/doc/$NAME-$VERSION mkdir -p $PKG/usr/bin mkdir -p $PKG/usr/share/pixmaps mkdir -p $PKG/usr/share/applications mkdir -p $PKG/etc/profile.d install -m 755 $CWD/blender.sh $PKG/etc/profile.d install -m 755 $CWD/blender.csh $PKG/etc/profile.d install -m 755 $CWD/blender $PKG/usr/bin #install -m 755 $CWD/blenderplayer $PKG/usr/bin ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) cat $CWD/blender.png > $PKG/usr/share/pixmaps/blender.png mkdir -p $PKG/usr/share/applications cat << EOF > $PKG/usr/share/applications/$NAME.desktop [Desktop Entry] Categories=Application;Graphics; Comment=3D modeling, animation & rendering. Comment[it]=3D modeling, animation & rendering. Encoding=UTF-8 Exec=blender GenericName=3D Graphics Creation GenericName[it]=3D Graphics Creation Icon=/usr/share/pixmaps/blender.png MimeType= Name=Blender Name[it]=Blender Path= StartupNotify=true Terminal=false TerminalOptions= Type=Application X-DCOP-ServiceType= X-KDE-SubstituteUID=false X-KDE-Username= EOF mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild echo "export BLENDERDIR=/usr/share/blender" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi