wok-6.x rev 16499

Addpython-rpi-pyglow with custom pyglow tool to easily test Pyglow (tested by myself)
author Christophe Lincoln <pankso@slitaz.org>
date Wed Apr 23 19:22:10 2014 +0200 (2014-04-23)
parents 351577bd7833
children bb6560098b70
files python-rpi-pyglow/receipt python-rpi-pyglow/stuff/pyglow
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/python-rpi-pyglow/receipt	Wed Apr 23 19:22:10 2014 +0200
     1.3 @@ -0,0 +1,25 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="python-rpi-pyglow"
     1.7 +VERSION="git-1"
     1.8 +CATEGORY="system-tools"
     1.9 +SHORT_DESC="Controlling the PiGlow from Python."
    1.10 +MAINTAINER="pankso@slitaz.org"
    1.11 +LICENSE="BSD"
    1.12 +TARBALL="$PACKAGE-$VERSION.tar.bz2"
    1.13 +WEB_SITE="https://github.com/benleb/PyGlow"
    1.14 +WGET_URL="git|git://github.com/benleb/PyGlow.git"
    1.15 +TAGS="raspberrypi rpi"
    1.16 +HOST_ARCH="arm"
    1.17 +
    1.18 +DEPENDS="python python-smbus python-rpi-gpio"
    1.19 +
    1.20 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.21 +genpkg_rules()
    1.22 +{
    1.23 +	pylibs="/usr/lib/python2.7"
    1.24 +	mkdir -p $fs/${pylibs} $fs/usr/share $fs/usr/bin
    1.25 +	cp -a ${src}/pyglow.py $fs/${pylibs}
    1.26 +	cp -a ${src}/examples $fs/usr/share/pyglow
    1.27 +	cp ${stuff}/pyglow $fs/usr/bin
    1.28 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/python-rpi-pyglow/stuff/pyglow	Wed Apr 23 19:22:10 2014 +0200
     2.3 @@ -0,0 +1,26 @@
     2.4 +#!/bin/sh
     2.5 +#
     2.6 +# Tiny wrapper to Python Pyglow examples
     2.7 +#
     2.8 +
     2.9 +ex="/usr/share/pyglow"
    2.10 +
    2.11 +# Make sure we have i2c-dev module loaded
    2.12 +if ! lsmod | fgrep -q 'iec_dev'; then
    2.13 +	modprobe i2c-dev
    2.14 +fi
    2.15 +
    2.16 +case "$1" in
    2.17 +	cpu) 
    2.18 +		python ${ex}/cpu.py ;;
    2.19 +	clock) 
    2.20 +		python ${ex}/clock.py ;;
    2.21 +	set-leds) 
    2.22 +		python ${ex}/set_leds.py ;;
    2.23 +	'test') 
    2.24 +		python ${ex}/test.py ;;
    2.25 +	*) 
    2.26 +		echo "Usage: $(basename $0) [test|cpu|clock|set-leds]" ;;
    2.27 +esac
    2.28 +
    2.29 +exit 0