#!/bin/sh # Heavily based on the Slackware 12.2 SlackBuild # http://www.scilab.org/ # Packager Vincenzi Loris - slacky@slacky.it CWD=`pwd` TMP=${TMP:-/tmp/tgz} PKG=$TMP/package-scilab NAME=scilab VERSION=5.1 CHOST=i486 ARCH=${ARCH:-i486} BUILD=1sl SOURCE=http://www.scilab.org/download/$VERSION/$NAME-$VERSION-src.tar.gz PREREQUIREMENTS=http://www.scilab.org/download/$VERSION/prerequirements-$NAME-$VERSION-src.tar.gz # PVM=http://www.netlib.org/pvm3/pvm3.4.6.tgz set -e if [ ! -e prerequirements-$NAME-$VERSION-src.tar.gz ]; then echo "Downloading prerequirements" wget -c $PREREQUIREMENTS fi # if [ ! -e pvm3.4.6.tgz ]; then # echo "Downloading PVM" # wget -c $PVM # fi if [ ! -e $NAME-$VERSION-src.tar.gz ]; then echo "Downloading source" wget -c $SOURCE fi if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" 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 xzf $CWD/pvm3.4.6.tgz # export PVM_ROOT=$TMP/pvm3 # ( # echo "Building PVM" # cd pvm3 # CFLOPTS="$SLKCFLAGS" \ # FFLOPTS="$SLKCFLAGS" \ # make # make install # ) echo "Unpacking Prerequirements (this can take several minutes)" tar xzf $CWD/prerequirements-$NAME-$VERSION-src.tar.gz tar xzf $CWD/$NAME-$VERSION-src.tar.gz echo "+==============================================================================" echo "| Building $NAME-$VERSION" echo "+==============================================================================" cd $NAME-$VERSION find . \( -perm 777 -o -perm 775 -o -perm 711 \) -exec chmod 755 {} \; find . \( -perm 700 -o -perm 555 -o -perm 511 \) -exec chmod 755 {} \; find . \( -perm 666 -o -perm 664 -o -perm 600 \) -exec chmod 644 {} \; find . \( -perm 444 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; chown -R root:root . CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ FFLABS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --sysconfdir=/etc \ --without-ocaml \ --without-pvm \ --with-jdk=$TMP/$NAME-$VERSION/java/jdk \ --without-matio \ --with-ant=/usr/lib/ant \ --with-x \ --enable-build-localization \ --enable-build-help \ --build=$CHOST-slackware-linux make all make doc make install DESTDIR=$PKG cd $PKG mv $TMP/$NAME-$VERSION/thirdparty $PKG/usr/share/$NAME cp $TMP/$NAME-$VERSION/bin/lib* $PKG/usr/lib/$NAME/ sed -i "s/\/tmp\/tgz\/$NAME-$VERSION/\$SCILAB/" $PKG/usr/share/scilab/etc/classpath.xml find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null mkdir -p $PKG/usr/share/applications cp $CWD/scilab.desktop $PKG/usr/share/applications mkdir -p $PKG/usr/share/pixmaps cp $CWD/scilab.png $PKG/usr/share/pixmaps mkdir -p $PKG/usr/doc/$NAME-$VERSION ln -s /usr/share/$NAME $PKG/usr/doc/$NAME-$VERSION 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 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