#!/bin/sh # Heavily based on the Slackware 13.37 SlackBuild # SlackBuild for FOX # http://www.fox-toolkit.org/ # By SukkoPera # Rebuild by Packager Loris Vincenzi (community slacky.eu) < slacky@slacky.it > # In hoc signo vinces. # # Thanks a lot to CAT for his Slackware package cration # # Check out # - http://www.sukkopera.tk # - http://www.slacky.eu # - http://www.nyft.org # Get the current and temporary directories CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp/pkg fi # Set up working directories if [ ! -d $TMP ] then mkdir -p $TMP fi # Some useful variables about the package NAME=fox PKG=$TMP/package-$NAME VERSION=1.6.43 ARCH=i486 BUILD=1sl SOURCEARCH=$NAME-$VERSION # Print a welcome screen echo "+-----------+" echo "| $NAME-$VERSION |" echo "+-----------+" if [ -d $PKG ] then # Clean up a previous build #rm -rf $PKG #mkdir -p $PKG echo "Previous package build directory found, please remove it and" echo "restart the SlackBuild script: $PKG" exit 1 else mkdir -p $PKG fi for i in do echo "--- Creating directory $PKG/$i" mkdir -p $PKG/$i done # Decompress echo "------------------------- Uncompressing source -------------------------" cd $TMP tar zxvf $CWD/$SOURCEARCH.tar.gz #mv $SOURCEARCH $NAME-$VERSION cd $NAME-$VERSION # Build echo "------------------------------ Configuring -----------------------------" CFLAGS="-O2 -march=i486 -mtune=i686" \ CXXFLAGS="-O2 -march=i486 -mtune=i686" \ ./configure --prefix=/usr \ --x-includes=/usr/X11R6/include \ --x-libraries=/usr/X11R6/lib \ --disable-static \ --mandir=/usr/man \ --with-xcursor \ --enable-release \ --with-opengl \ --with-xft \ --with-xrandr \ --with-xim echo "------------------------------- Patching -------------------------------" # Needed because html documentation installation seems broken and will # spread files here and there sed -i "s/\$(datadir)\/doc\/fox-1.6\/html/\$(prefix)\/doc\/$NAME-$VERSION\/html/" doc/Makefile sed -i "s/\$(prefix)\/fox\/html\/art/\$(prefix)\/doc\/$NAME-$VERSION\/html\/art/" doc/art/Makefile sed -i "s/\$(prefix)\/fox\/html\/screenshots/\$(prefix)\/doc\/$NAME-$VERSION\/html\/screenshots/" doc/screenshots/Makefile echo "------------------------------ Compiling -------------------------------" make res=$? if [ $res -ne 0 ] then # make failed, we cannot continue exit $res fi echo "------------------------------ Installing ------------------------------" make install DESTDIR=$PKG res=$? if [ $res -ne 0 ] then # make install failed, we cannot continue exit 1 fi # Doc echo "----------------- Copying documentation and other files ----------------" mkdir -p $PKG/usr/doc/$NAME-$VERSION for i in ADDITIONS AUTHORS INSTALL LICENSE* README TRACING do # cat $i | gzip > $PKG/usr/doc/$NAME-$VERSION/$i.gz cp -a $i $PKG/usr/doc/$NAME-$VERSION/ done # Gzip man pages find $PKG/usr/man -name "*.[123456789]" -exec gzip -9 {} \; # SlackBuild stuff mkdir -p $PKG/usr/doc/$NAME-$VERSION/slackbuild cp $CWD/$0 $CWD/slack-desc $PKG/usr/doc/$NAME-$VERSION/slackbuild # Strip binaries echo "--------------------------- Stripping binaries -------------------------" find $PKG -type f | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded # Set permissions echo "--------------------------- Setting permissions ------------------------" chown -R root:root $PKG chmod -R 755 $PKG/usr/doc/* find $PKG/usr/doc -type f -exec chmod 644 {} \; #chown -R root.root $PKG/usr/share #chmod -R 755 $PKG/usr/share/* #find $PKG/usr/share -type f -exec chmod 644 {} \; # Copy Slackware package files echo "--------------------- Copying Slackware package files ------------------" mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc #cat $CWD/slack-required > $PKG/install/slack-required # Create package echo "---------------------------- Creating package --------------------------" echo "Creating package" cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz # Clean up if [ "$1" = "--cleanup" ]; then echo "---------------------- Cleaning up working directory -------------------" rm -rf $TMP/$NAME-$VERSION rm -rf $PKG fi # Package created echo "Package creation finished!"