summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4eeaa5ce8ac756784ce48861f58d94d4c99a1c4d (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
# Contributor: Kyle Keen <keenerd@gmail.com>
pkgname=pyspeed
_pkgname=PySpeed
pkgver=0.1.1
pkgrel=1
pkgdesc="Add progress bars with easy pythonic wrapper iterators.  Py2 and Py3"
arch=('any')
url="https://launchpad.net/pyspeed"
license=('MIT')
depends=('python2')
optdepends=('python')
source=(http://launchpad.net/$pkgname/trunk/initial/+download/$_pkgname-$pkgver.tar.gz)
md5sums=('9d24be9fd3635d5e6299da313a69a26b')

build() {
  cd "$srcdir"
  mkdir -p py3
  cp -r $_pkgname-$pkgver/* py3
  
  if which python2; then
    cd "$srcdir/$_pkgname-$pkgver"
    msg "Building for Python2"
    python2 setup.py build
  fi

  if which python3; then
    cd "$srcdir/py3"
    msg "Building for Python3"
    2to3 -w ./
    2to3 -w speed/
    python3 setup.py build
  fi
}

package() {
  if which python2; then
    cd "$srcdir/$_pkgname-$pkgver"
    python2 setup.py install --prefix=/usr --root="$pkgdir"
  fi

  if which python3; then
    cd "$srcdir/py3"
    python3 setup.py install --prefix=/usr --root="$pkgdir"
  fi
}