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

pkgname=synergy-plus
pkgver=1.3.4
pkgrel=1ab
arch=i486
source=("http://synergy-plus.googlecode.com/files/synergy-plus-1.3.4.tar.gz")
sourcetemplate="http://gaia.homelinux.org/salix/packages/$pkgname/$pkgver/"
docs=("readme" "install" "copying" "changelog" "authors" "news")
url='http://code.google.com/p/synergy-plus/'

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (lets you share a mouse and keyboard between computers)"
"Synergy+ lets you easily share a single mouse and keyboard between"
"multiple computers with different operating systems, each with its own"
"display, without special hardware."
"Redirecting the mouse and keyboard is as simple as moving"
"the mouse off the edge of your screen. Synergy also merges the"
"clipboards of all the systems into one, allowing cut-and-paste between"
"systems. Furthermore, it synchronizes screen savers so they all start"
"and stop together and, if screen locking is enabled, only one screen"
"requires a password to unlock them all."
)


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 \
		--disable-debug \
		--with-x || return 1
	find . -name 'Makefile' | xargs -r sed -e 's/-Werror//' -i
	make $threads || return 1
	make install DESTDIR=$startdir/pkg || return 1
}