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

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

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

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL http://www.ibiblio.org/pub/Linux/system/hardware/$SRC.tar.gz
}

build() {
# Creating new
tar zxvf $DOWNL/$SRC.tar.gz
cd $SRC
make
mkdir -p $PKG/usr/sbin
cp hdparm $PKG/usr/sbin/
chmod 755 $PKG/usr/sbin/hdparm
mkdir -p $PKG/usr/man/man8
cp hdparm.8 $PKG/usr/man/man8/
    postbuild
}

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

