#!/bin/sh # Heavily based on the Slackware 14 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. # Last build from umaga (frankyricci(at)gmail(dot)com) # 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 # Some useful variables about the package CWD=`pwd` OUTPUT=${OUTPUT:-$CWD} PKGNAME=fox TMP=${TMP:-/tmp/buildpkg/$PKGNAME} PKG=$TMP/package VERSION=${VERSION:-1.6.46} ARCH=${ARCH:-i686} JOBS=${JOBS:--j2} BUILD=${BUILD:-7} TAG=${TAG:-sl} SOURCE="ftp://ftp.fox-toolkit.org/pub/$PKGNAME-$VERSION.tar.gz" DOCS="ADDITIONS AUTHORS INSTALL LICENSE* README TRACING" SLKFILES="" TAR=${TAR:-$(basename $SOURCE)} DIR=${DIR:-$(echo "$TAR"|sed -r 's/(\.tar|)(.gz|.bz2|.xz|)$//')} if [ ! -e $CWD/$PKGNAME-$VERSION.tar.gz ]; then wget -c $SOURCE fi CHOST="i686" # Set compiling FLAGS if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST="i486" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST="i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"; CHOST="x86_64" fi # Create building directory rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT # Decompress the source tarball cd $TMP tar xvzf $CWD/$PKGNAME-$VERSION.tar.gz echo -e "\E[0;32m+-----------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild PLIB |\E[0;0m" echo -e "\E[0;32m+-----------------------+\E[0;0m" # Adjust permissions and ownerships cd $PKGNAME-$VERSION chown -R root:root . chmod -R u+w,go+r-w,a-s . # 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 $JOBS make install DESTDIR=$PKG # Strip binaries and shared objects, if present ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true ) # Add documentation files: readme, changelog and so on mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -r $DOCS $PKG/usr/doc/$PKGNAME-$VERSION mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION/SlackBuild cd $CWD for SB in $PKGNAME.SlackBuild slack-desc doinst.sh doinst.sh.gz EULA.TXT $SLKFILES;do [ -e $SB ]&&cp -r $SB $PKG/usr/doc/$PKGNAME-$VERSION/SlackBuild/$SB done if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done ) fi mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc [ -e $CWD/doinst.sh ] && cat $CWD/doinst.sh > $PKG/install/doinst.sh [ -e $CWD/doinst.sh.gz ] && zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh # Find and print dependencies into slack-required file cd $PKG chown -R root:root $PKG if [ -x "$(which requiredbuilder 2>/dev/null)" ];then requiredbuilder -y -v -s $CWD $PKG # add "-c -b" if you have binary files in /usr/share [ -e install/slack-required ]&&cat install/slack-required > $PKG/usr/doc/$PKGNAME-$VERSION/SlackBuild/slack-required fi # Create txz package /sbin/makepkg -l y -c n $OUTPUT/$PKGNAME-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} # Cleanup if enabled if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi