#!/bin/sh
# Set initial variables:

VERSION=1.4.1

CWD=`pwd`
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi
if [ ! -d $TMP ]; then
  mkdir -p $TMP # location to build the source
fi

cd $TMP
rm -rf hpijs-$VERSION
tar xzvf $CWD/hpijs-$VERSION.tar.gz
cd hpijs-$VERSION
chown -R root.root .
find . -perm 664 -exec chmod 644 {} \;
# Use -O0 to avoid problems.
CFLAGS=-O0 ./configure --prefix=/usr i486-slackware-linux
make
make install
mkdir -p /usr/doc/hpijs-$VERSION
cp -a \
  gs_hpijs.png hpijs_readme.html \
  /usr/doc/hpijs-$VERSION
chmod 644 /usr/doc/hpijs-$VERSION/*
chown root.root /usr/doc/hpijs-$VERSION/*
mkdir -p /install
cat $CWD/slack-desc > /install/slack-desc
