summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 63128320062b96c2b4813e2b7cb781abec45f39f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Maintainer: balwierz
pkgname=python2-power-git
#pkgname=python2-power-git
pkgver=20141003
pkgrel=5
pkgdesc="A Python module that allows you to get power and battery status of the system"
depends=('python2')
makedepends=('git' 'python2-setuptools')
provides=('python2-power-git')
replaces=('python-power' 'python-power-git')
conflicts=('python-power' 'python-power-git')
url="https://github.com/GreatFruitOmsk/Power"
license=('MIT')
arch=('any')
source=()

_gitroot="https://github.com/GreatFruitOmsk/Power.git"
_gitname="Power"
_gitbranch="master"


build()
{
	cd "${srcdir}"

	msg "Connecting to GitHub..."

	if [ -d "${srcdir}/${_gitname}" ]; then
		cd "${_gitname}"
		git pull origin "${_gitbranch}"
		msg "The local files are updated."
	else
		git clone "${_gitroot}"
		cd "${_gitname}"
		git checkout "${_gitbranch}"
	fi

	msg "Git checkout done or server timeout."
}

package()
{
	cd "${srcdir}/${_gitname}"
	python2 setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1 || return 1
}