updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / calise / PKGBUILD
blob3132144a96abbb6343f54d18e4abba3b9235df61
1 # Maintainer: Nicolo' Barbon <smilzoboboz@gmail.com>
2 pkgname=calise
3 pkgver=0.0.7
4 pkgrel=3
5 pkgdesc="Calculates ambient brightness and sets screen's correct backlight using a webcam."
6 arch=(any)
7 url="http://sourceforge.net/projects/calise/"
8 license=('GPL3')
9 groups=()
10 depends=('python-pygame' 'python-imaging' 'python2-numpy' 'hicolor-icon-theme' 'pyxdg')
11 makedepends=('python-distutils-extra' 'intltool')
12 optdepends=('python2-pyqt: gui, screenbalance feature')
13 provides=('calise')
14 conflicts=()
15 replaces=(camsensor)
16 backup=()
17 options=()
18 install=calise.install
19 changelog=
20 source=(http://sourceforge.net/projects/$pkgname/files/$pkgname-beta/$pkgver/$pkgname-$pkgver.tar.gz)
21 noextract=()
22 sha256sums=('87c82ca76e7d05a97b44069eb673758bc1e8af6536272e4007daae1ca4198383')
24 build() {
25   cd "$srcdir/$pkgname"
26   env python2 setup.py build
29 package() {
30   cd "$srcdir/$pkgname"
31   interface="`udevadm info -a -p /sys/class/backlight/* | 
32     grep "KERNEL=" | 
33     sed s'/KERNEL==//' | 
34     awk -F ['"'] '{print $2}'`"
35   if [ ! -e /sys/class/backlight/$interface/brightness ]; then
36     echo "Your configuration is currently not supported."
37     return 1
38   fi
39   udevrule="$pkgdir/lib/udev/rules.d/99-backlight-$interface.rules"
40   mkdir -p "$pkgdir/lib/udev/rules.d/"
41   echo "KERNEL==\"${interface}\", RUN+=\"/bin/chmod 664 /sys/class/backlight/$interface/brightness\"" > $udevrule
42   echo "KERNEL==\"${interface}\", RUN+=\"/bin/chgrp video /sys/class/backlight/$interface/brightness\"" >> $udevrule
43   env python2 setup.py install --prefix="$pkgdir/usr/"