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

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

check() {
# Checking for configuration
# Downloading sources lists
INSTALLED="`ls -1 $PACKAGES/packages/|grep $PACKAGE|cut -d "-" -f 1,2`"
$WGET -q wget -c "http://sourceforge.net/project/showfiles.php?group_id=38678"
NEW=`cat showfiles.php\?group_id\=38678|grep lstat-|cut -d / -f 66|cut -d '?' -f 1|sed -e s/.tar.*//|tail -1`
#Checking for new version
    checkpkg
# clean
rm showfiles.php*
}

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL http://switch.dl.sourceforge.net/sourceforge/lstat/$SRC.tar.gz
}

build() {
# Creating new
tar zxvf $DOWNL/$SRC.tar.gz
cd $SRC
./configure \
    --with-prefix=/usr \
    --with-www=/var/www/lstat \
    --with-httpdconf=/etc/httpd/httpd.conf \
    --noupdate_apache_conf \
    --with-wwwuser=nobody \
    --with-wwwgroup=nogroup \
    --with-etc=/etc/lstat \
    $TARGET || exit
make
make install
make install DESTDIR=$PKG
    postbuild
}

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

