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

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

check() {
# Checking for configuration
# Downloading sources lists
INSTALLED="`ls -1 $PACKAGES/packages/|grep $PACKAGE|cut -d "-" -f 1,2`"
$WGET -q ftp://ftp.slackware.at/slackware-current/slackware/l/
NEW=`grep $PACKAGE index.html|grep .tgz|cut -d / -f 7|cut -d '"' -f 1|cut -d - -f 1,2|tail -1`
#Checking for new version
    checkpkg
# clean
rm index.html
}

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL ftp://ftp.slackware.at/slackware-current/source/l/zlib/*.gz
}

build() {
# Creating new
tar zxvf $DOWNL/$SRC.tar.gz
cd $SRC
./configure \
        --prefix=/usr || exit
make clean
make || exit
mkdir -p $PKG/usr/include
mkdir -p $PKG/usr/lib
make install prefix=$PKG/usr
./configure \
    --prefix=/usr \
    --shared || exit
make clean
make || exit
make install prefix=$PKG/usr || exit
    postbuild
}

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

