#! /bin/bash # Heavily based on the Slackware 12.1 SlackBuild # http://wxmaxima.sourceforge.net/wiki/index.php/Main_Page # Packagers mimmoforlug (Domenico Suppa mimmoforlug@slacky.it) # http://www.slacky.it # Requirements: maxima, wxwidgets, libxml2 CWD=`pwd` TMP=${TMP:-/tmp/tgz} PKG=$TMP/package-wxMaxima NAME=wxMaxima VERSION=0.8.0 CHOST=i486 ARCH=${ARCH:-i486} BUILD=1mf SOURCE=http://mesh.dl.sourceforge.net/sourceforge/wxmaxima/$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" = "x86_64" ]; then SLKCFLAGS="-O2 -march=athlon64 -pipe" elif [ "$ARCH" = "athlonxp" ]; then SLKCFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi echo "+--------------+" echo "| $NAME-$VERSION |" echo "+--------------+" cd $TMP tar zxf $CWD/$NAME-$VERSION.tar.gz 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 {} \; CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --program-prefix= \ --program-suffix= \ --build=$CHOST-slackware-linux make || exit 1 make install DESTDIR=$PKG || exit 1 rm -fr $PKG/usr/doc/$NAME mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README $PKG/usr/doc/$NAME-$VERSION mkdir -p $PKG/usr/share/applications cp $CWD/wxmaxima.desktop $PKG/usr/share/applications mkdir -p $PKG/usr/share/pixmaps cp wxmaxima.png $PKG/usr/share/pixmaps/wxmaxima.png cd $CWD cp -a *.SlackBuild slack-desc $PKG/usr/doc/$NAME-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-required > $PKG/install/slack-required ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) cd $PKG chown -R root:root . requiredbuilder -y -v -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi