#!/bin/sh # Set initial variables: CWD=`pwd` PKG=/tmp/package-gv # Slamd64 is using 3.6.1 because 3.5.8 has problems opening PDFs when built # with the latest versions of Ghostscript VERSION=3.6.1 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-2} 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 gv-$VERSION tar xzvf $CWD/gv-$VERSION.tar.gz cd gv-$VERSION chown -R root:root . LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr/X11R6 \ --libdir=/usr/lib64 --program-prefix="" \ --program-suffix="" \ $ARCH-slackware-linux make install DESTDIR=$PKG 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/gv-$VERSION cp -a \ CHANGES COPYING INSTALL.Unix README doc/*.html \ $PKG/usr/doc/gv-$VERSION ( cd doc tar xjvf $CWD/gv-3.5.8-docs.tar.bz2 # Documentation taken from the older version of gv zcat key-bindings.txt-gz > $PKG/usr/doc/gv-$VERSION/key-bindings.txt zcat comments.doc-gz > $PKG/usr/doc/gv-$VERSION/comments.doc zcat gs.interface-gz > $PKG/usr/doc/gv-$VERSION/gs.interface ) chmod 644 $PKG/usr/doc/gv-$VERSION/* gzip -9 $PKG/usr/X11R6/man/man?/* gzip -9 $PKG/usr/X11R6/info/*.info mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../gv-$VERSION-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf /tmp/gv-$VERSION rm -rf $PKG fi