summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/pyopenssl/PKGBUILD
blob: d99cafa3d58bd6f5d2a3b1e81f052d3974f36bdc (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
51
52
53
54
55
56
57
58
59
# $Id$
# Maintainer : Felix Yan <felixonmars@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgbase=pyopenssl
pkgname=('python2-pyopenssl')
pkgver=16.0.0
pkgrel=1
arch=('any')
url="http://pypi.python.org/pypi/pyOpenSSL"
license=('LGPL2.1')
makedepends=('openssl' 'python2-setuptools' 'python2-cryptography')
checkdepends=('python2-pytest-runner')
source=(http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-$pkgver.tar.gz)
md5sums=('9587d813dcf656e9f2760e41a3682dc3')

prepare() {
  cp -a pyOpenSSL-$pkgver{,-py2}

  export LC_CTYPE=en_US.UTF-8
}

build () {
  cd "$srcdir"/pyOpenSSL-$pkgver
#  python setup.py build

  cd "$srcdir"/pyOpenSSL-$pkgver-py2
  python2 setup.py build
}

check () {
  (
    cd "$srcdir"/pyOpenSSL-$pkgver
    python setup.py ptr

    cd "$srcdir"/pyOpenSSL-$pkgver-py2
    python2 setup.py ptr
  ) || warning "Tests failed due to missing SSLv3_METHOD"
}

package_python-pyopenssl(){
  pkgdesc="Python3 wrapper module around the OpenSSL library"
  depends=('openssl' 'python-six' 'python-cryptography')

  cd "$srcdir"/pyOpenSSL-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}

package_python2-pyopenssl(){
  pkgdesc="Python2 wrapper module around the OpenSSL library"
  depends=('openssl' 'python2-six' 'python2-cryptography')
  replaces=('pyopenssl')
  provides=('pyopenssl')
  conflicts=('pyopenssl')

  cd "$srcdir"/pyOpenSSL-$pkgver-py2
  python2 setup.py install --root="$pkgdir" --optimize=1
}