# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5
PYTHON_DEPEND="2"

inherit eutils

DESCRIPTION="A Python GTk based controller for Alienware AlienFX lighting"
HOMEPAGE="https://code.google.com/p/pyalienfx/"
SRC_URI="http://gentoo.awalp.net/pub/gentoo/distfiles/pyalienfx-1.02.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="x86 amd64"
IUSE=""

S=${WORKDIR}/${P}

RDEPEND="
	dev-python/pygtk
	dev-libs/libusb
	x11-libs/gksu"
DEPEND="${RDEPEND}"

src_install () {
	dodir /usr/local/pyalienfx-1.02/
	cp -R "${S}/" "${D}/usr/local/" || die "Install failed!"
}

pkg_postinst() {
	echo "cd /usr/local/pyalienfx-1.02/; gksu python2 pyAlienFX.py" > /usr/local/bin/pyalienfx
	chmod +x /usr/local/bin/pyalienfx
	elog "** **              ** **"
	elog " "
	elog "   run  'pyalienfx'  to start program"
	elog " "
	elog "** **              ** **"
}