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

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

check() {
# Checking for configuration
# Downloading sources lists
INSTALLED="`ls -1 /var/packages/packages/|grep binutils|cut -d "-" -f 1,2`"
$WGET -q ftp://ftp.kernel.org/pub/linux/devel/binutils/
NEW=`grep binutils index.html|grep .tar|cut -d / -f 8|cut -d '"' -f 1|sed -e s/.tar.*//|tail -1`
#Checking for new version
    checkpkg
# clean
rm index.html
}

download() {
# Downloading version from "${VERFILE}"
$WGET -P $DOWNL ftp://ftp.kernel.org/pub/linux/devel/binutils/$SRC.tar.bz2
}

build() {
# Creating new
tar jxvf $DOWNL/$SRC.tar.bz2
cd $SRC
./configure \
    --prefix=/usr \
    --enable-shared \
    --enable-targets=$TARGET,$TARGET-gnulibc1,$TARGET-gnuaout \
    --enable-64-bit-bfd \
    --disable-nls \
    $TARGET || exit
make || exit
make info || exit
make install prefix=$PKG/usr || exit
rm $PKG/usr/info/dir
cd $CWD/ksymoops
./ksymoops.build
    postbuild
}

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

