#!/bin/sh # Set initial variables: CWD=`pwd` PKG=/tmp/package-xpaint VERSION=2.7.0 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" LIBSUFFIX=64 fi rm -rf $PKG mkdir -p $PKG cd /tmp rm -rf xpaint-$VERSION tar xjvf $CWD/xpaint-$VERSION.tar.bz2 cd xpaint-$VERSION zcat $CWD/xpaint.errno.diff.gz | patch -p1 || exit 1 chown -R root.root . xmkmf -a make xaw SHAREDIR=/usr/X11R6/share/xpaint make install DESTDIR=$PKG SHAREDIR=/usr/X11R6/share/xpaint make install.man DESTDIR=$PKG SHAREDIR=/usr/X11R6/share/xpaint ( cd bitmaps mkdir -p $PKG/usr/X11R6/include/X11/bitmaps find . -name "*.xbm" -exec cp {} $PKG/usr/X11R6/include/X11/bitmaps \; mkdir -p $PKG/usr/X11R6/include/X11/pixmaps find . -name "*.xpm" -exec cp {} $PKG/usr/X11R6/include/X11/pixmaps \; ) chown -R root.root $PKG/usr/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/xpaint-$VERSION cp -a \ README README.PNG README.old TODO \ $PKG/usr/doc/xpaint-$VERSION chmod 644 $PKG/usr/doc/xpaint-$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 ../xpaint-$VERSION-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf /tmp/xpaint-$VERSION rm -rf $PKG fi