#Maintainer: Shador <futur~DOT~andy~AT~googlemail.com>

pkgname=corkscrew
pkgver=2.0
pkgrel=1ab
arch=i486
source=('http://www.agroman.net/corkscrew/corkscrew-2.0.tar.gz')
sourcetemplate="http://gaia.homelinux.org/salix/packages/$pkgname/$pkgver/"
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url='http://www.agroman.net/corkscrew/'

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (tool for tunneling SSH through HTTP proxies)"
"Corkscrew has been tested with the following HTTP proxies :"
"    * Gauntlet"
"    * CacheFlow"
"    * JunkBuster"
"    * Squid"
"    * Apache's mod_proxy"
"Corkscrew has been tested against several proxies requiring HTTP"
"Corkscrew only supports basic autentication, which has been tested."
"Digest authentication unlike NTLM authentication may become supported."
)


build() {
	threadcount=$(($(sed -ne '/cpu cores/h;${g;s/[^0-9]*//p}' \
						< /proc/cpuinfo)*2))
	if [ $threadcount -lt 2 ]; then
		threadcount=2
	elif [ $threadcount -gt 8 ]; then
		threadcount=8
	fi
	threads="-j${threadcount}"

	cd $startdir/src/$pkgname-$pkgver
	
	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--mandir=/usr/man || return 1
	make $threads || return 1
	make install DESTDIR=$startdir/pkg || return 1
}