summaryrefslogtreecommitdiff
path: root/pcr/python2-pysfml2-git/PKGBUILD
blob: 6bd8e759cab6aa183d600952743d029e144211b1 (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
46
47
48
49
# Maintainer: Philippe Huerlimann <phihue@gmail.com>
pkgname=python2-pysfml2-git
pkgver=20120804
pkgrel=1
pkgdesc="A Python 2 binding for SFML 2, written with Cython."
arch=('i686' 'x86_64')
url="http://pysfml2-cython.readthedocs.org/"
license=('BSD')
depends=('sfml-git' 'python2')
makedepends=('cython2' 'git')
source=()
md5sums=() 
_gitroot='https://github.com/bastienleonard/pysfml2-cython.git'
_gitname='pysfml2-cython'

build() {
	cd "$srcdir"
	msg "Connecting to GIT server...."

	if [ -d $_gitname ] ; then
		cd $_gitname && git pull origin
		msg "The local files are updated."
	else
		git clone $_gitroot $_gitname
	fi

	msg "GIT checkout done or server timeout"
	msg "Starting make..."

	rm -rf "$srcdir/$_gitname-build"
	git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
	cd "$srcdir/$_gitname-build"

	python2 setup.py build
}

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

	# Copying the examples
	cp -R examples "${pkgdir}/usr/lib/python2.7/site-packages/pysfml"

	# Copying the License file
	install -D -m644 "$srcdir/$_gitname-build/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

	# Fixing permissions
	chmod 644 "${pkgdir}"/usr/lib/python2.7/site-packages/sfml.so
}