#!/bin/sh # Set initial variables: CWD=`pwd` PKG=/tmp/package-xfm VERSION=1.5 # We are using xfm 1.5 from Debian as 1.4.x will not run properly on AMD64 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" SLKLDFLAGS="-L/usr/lib64" fi rm -rf $PKG mkdir -p $PKG cd /tmp rm -rf xfm-$VERSION tar xzvf $CWD/xfm-$VERSION.tar.gz cd xfm-$VERSION zcat $CWD/xfm-defaults.diff.gz | patch -p1 || exit 1 # Fix up some of the default paths and icons chown -R root:root . if [ ! -r configure ]; then sh autogen.sh fi LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr/X11R6 \ --libdir=/usr/lib64 \ --sysconfdir=/etc \ --program-prefix="" \ --program-suffix="" \ $ARCH-slackware-linux make -j4 make install DESTDIR=$PKG # Install missing icons (cd $PKG/usr/X11R6/share/xfm/icons/application; tar xf $CWD/missing_icons.tar.gz; chown -R root:root .) chown -R root:root $PKG/usr/X11R6/bin ( cd $PKG 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 ) mkdir -p $PKG/usr/doc/xfm-$VERSION cp -a \ COPYING ChangeLog INSTALL README README-1.2 README-1.4 TODO \ $PKG/usr/doc/xfm-$VERSION chmod 644 $PKG/usr/doc/xfm-$VERSION/* gzip -9 $PKG/usr/X11R6/man/man?/* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../xfm-$VERSION-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf /tmp/xfm-$VERSION rm -rf $PKG fi