#Maintainer: Thorsten Muehlfelder <thenktor(at)gmx.de>

pkgname=libffado
pkgver=2.0.1
pkgrel=1tm
source=("http://www.ffado.org/files/$pkgname-$pkgver.tar.gz" "ffado.png")
docs=('authors' 'copying' 'changelog' 'install' 'news' 'readme')
url="http://www.ffado.org/"
# extradepends=('PyQt' 'sip')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname - Free Firewire Audio Drivers"
"The FFADO project aims to provide a generic, open-source"
"solution for the support of FireWire based audio devices for"
"the Linux platform. It is the successor of the FreeBoB project."
)

build() {
	cd $startdir/src/$pkgname-$pkgver

	# check a build dep
	if [ ! -e "/usr/bin/sip" ]; then
		echo "You have to install the sip package first!"
		return 1
	fi

	sed -i "s/-O2/$CFLAGS/" SConstruct || return 1
	scons PREFIX=/usr LIBDIR=/usr/lib${LIBDIRSUFFIX} DISTTARGET=$arch PROFILE=yes || return 1
	scons DESTDIR=$startdir/pkg install

	# icon
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	cp $startdir/ffado.png $startdir/pkg/usr/share/icons/hicolor/48x48/apps/

	# desktop file
	mkdir -p $startdir/pkg/usr/share/applications
	cat << "EOF" > $startdir/pkg/usr/share/applications/ffado.desktop
[Desktop Entry]
Name=FFADO Mixer
Comment=A mixer for FireWire cards supported by FFADO
Icon=ffado
Exec=ffado-mixer
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Qt;Audio;AudioVideo;AudioVideoEditing;Multimedia
EOF
}