#!/bin/sh
#
# kTm port by Juzer
#
#       regards to hns & psych
#

# local config:
BUILD="1"
PACKAGE="xpdf"

check() {
# Checking for configuration
# Downloading sources lists
INSTALLED=`ls -1 $PACKAGES/packages/|grep $PACKAGE|cut -d "-" -f 1,2`
$WGET -q ftp://ftp.foolabs.com/pub/xpdf/
NEW=`grep $PACKAGE-3 index.html|grep .tar.gz|cut -d / -f 6|cut -d '"' -f 1|sed -e s/.tar.*//|tail -1`
#Checking for new version
    checkpkg
# clean
rm index.html
}

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL ftp://ftp.foolabs.com/pub/xpdf/$SRC.tar.gz
}

build() {
# Creating new
tar zxvf $DOWNL/$SRC.tar.gz
cd $SRC
./configure \
    --prefix=/opt/kde \
    --with-Xm-library=/usr/X11/lib \
    --with-Xm-includes=/usr/X11/include \
    --host=$TARGET --build=$TARGET || exit
make || exit
make install DESTDIR=$PKG || exit
    postbuild
}

source "${DATA:-/usr/lib/ktm}/ktm.ports.sh"

