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

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

check() {
# Checking for configuration
# Downloading sources lists
INSTALLED="`ls -1 $PACKAGES/packages/|grep $PACKAGE|cut -d "-" -f 1,2`"
$WGET -q ftp://atrey.karlin.mff.cuni.cz/pub/local/clock/links/
NEW=`grep $PACKAGE index.html|grep .tar.bz2|cut -d / -f 8|cut -d '"' -f 1|sort -t e -k +2 -n|sed -e s/.tar.*//|tail -1`
#Checking for new version
    checkpkg
# clean
rm index.html
}

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL ftp://atrey.karlin.mff.cuni.cz/pub/local/clock/links/$SRC.tar.bz2
}

build() {
# Creating new
tar jxvf $DOWNL/$SRC.tar.bz2
cd $SRC
./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-javascript \
    --enable-graphics \
    --without-x \
    $TARGET || exit
make || exit
make install DESTDIR=$PKG || exit
    postbuild
}

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

