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

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

check() {
# Checking for configuration
# Downloading sources lists
INSTALLED="`ls -1 $PACKAGES/packages/|grep $PACKAGE-|cut -d "-" -f 1,2`"
$WGET -q http://monkey.org/~dugsong/dsniff/
NEW=`grep $PACKAGE- index.html |grep tar.gz|cut -d '"' -f 2|sed -e s/.tar.*//|tail -1`
#Checking for new version
    checkpkg
# clean
rm index.html
}

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL http://monkey.org/~dugsong/dsniff/$SRC.tar.gz
}

build() {
# Creating new
tar zxvf $DOWNL/$SRC.tar.gz
cd $SRC
zcat $CWD/patches/ggsniff-1.2-dsniff-2.3-patch.gz | patch -p1 --verbose || exit
./configure \
    --prefix=/usr \
    $TARGET || exit
make -i
mkdir -p $PKG/usr/sbin/ $PKG/usr/man/man8/
mv mailsnarf $PKG/usr/sbin/
mv msgsnarf $PKG/usr/sbin/
mv mailsnarf.8 $PKG/usr/man/man8/
mv msgsnarf.8 $PKG/usr/man/man8/
    postbuild
}

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