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

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

check() { 
# Checking for configuration
# Downloading sources lists
INSTALLED="`ls -1 $PACKAGES/packages/|grep $PACKAGE-|cut -d "-" -f 1,2`"
$WGET -q http://dev.null.pl/ekg/download.php
NEW=`grep $PACKAGE-20 download.php | cut -d\  -f6 | cut -d\\" -f2 | tail -1 | sed -e s/.tar.gz//`
#Checking for new version
    checkpkg
# clean
rm download.php
}

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL http://dev.null.pl/ekg/$SRC.tar.gz
}

build() {
# Creating new
tar zxvf $DOWNL/$SRC.tar.gz
cd $SRC
./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --with-shared \
    $TARGET || exit
#    --with-ioctl \
make || exit
make install DESTDIR=$PKG || exit
    postbuild
}

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