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

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

check() {
# Checking for configuration
# Downloading sources lists
INSTALLED=`ls -1 $PACKAGES/packages/|grep epic|cut -d "-" -f 1,2`
$WGET -q ftp://ftp.epicsol.org/pub/epic/EPIC4-PRODUCTION/
NEW=`grep $PACKAGE index.html|grep .tar.bz2|cut -d / -f 7|cut -d '"' -f 1|sed -e s/.tar.bz2//|tail -1`
#Checking for new version
    checkpkg
# clean
rm index.html
}

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL ftp://ftp.epicsol.org/pub/epic/EPIC4-PRODUCTION/$SRC.tar.bz2
}

build() {
# Creating new
tar jxvf $DOWNL/$SRC.tar.bz2
cd $SRC
./configure \
    --prefix=/usr \
    --with-ipv6 \
    --with-ssl \
    --with-tcl \
    --with-perl \
    $TARGET || exit
make || exit
make install prefix=$PKG/usr || exit
cd $PKG/usr/bin/
ln -sf epic-EPIC4-`echo $SRC|cut -d - -f 2` epic
    postbuild
}

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

