summaryrefslogtreecommitdiff
path: root/community/python-pyzmq/PKGBUILD
blob: 0a466281df0da043e655657f09aa40442e74d8d9 (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
50
# $Id: PKGBUILD 102641 2013-12-17 01:18:22Z kkeen $
# Maintainer: Kyle Keen <keenerd at gmail dot com>
pkgbase=python-pyzmq
pkgname=(python2-pyzmq python-pyzmq)
pkgver=14.0.1
pkgrel=1
pkgdesc="Python bindings for zeromq, written in Cython"
arch=(i686 x86_64)
url="http://www.zeromq.org/bindings:python"
license=('LGPL')
depends=(zeromq python)
makedepends=(python python2 zeromq)
#source=(https://github.com/zeromq/pyzmq/downloads/pyzmq-$pkgver.tar.gz)
source=(https://pypi.python.org/packages/source/p/pyzmq/pyzmq-$pkgver.tar.gz)
md5sums=('c35fa03e58d48e6f3df2ab2c2dfa1413')

build() {
  cd "$srcdir"
  cp -a pyzmq-${pkgver} py2zmq-${pkgver}
  cd "$srcdir/pyzmq-$pkgver"
  # py3 errors added in 2.2.0.1 
  sed -i 's|except socket.error, e:|except socket.error as e:|' zmq/eventloop/ioloop.py
  sed -i 's|except gevent.Timeout, t:|except gevent.Timeout as t:|' zmq/green/core.py
  cd "$srcdir/py2zmq-$pkgver"
  sed -i 's|^#!/usr/bin/env python$|&2|' $(find ./ -name '*.py')
}

package_python2-pyzmq() {
  pkgdesc="Python2 bindings for zeromq, written in Cython"
  depends=(zeromq python2)
  cd "$srcdir/py2zmq-$pkgver"
  python2 setup.py install --root="$pkgdir" --optimize=0
}

package_python-pyzmq() {
  pkgdesc="Python3 bindings for zeromq, written in Cython"
  depends=(zeromq python)
  cd "$srcdir/pyzmq-$pkgver"
  python3 setup.py install --root="$pkgdir" --optimize=0
}

check()
{
  cd "$srcdir/pyzmq-$pkgver"
  python3 setup.py build_ext --inplace
  python3 setup.py test
  cd "$srcdir/py2zmq-$pkgver"
  python2 setup.py build_ext --inplace
  python2 setup.py test
}