summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/pyopenssl/PKGBUILD
blob: 2753f8fd9c6be71e2d27b1516385abd56ea93d3e (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
60
61
# $Id$
# Maintainer : Felix Yan <felixonmars@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgbase=pyopenssl
pkgname=('python-pyopenssl' 'python2-pyopenssl')
pkgver=17.5.0
pkgrel=1
arch=('any')
url="http://pypi.python.org/pypi/pyOpenSSL"
license=('LGPL2.1')
makedepends=('openssl' 'python-setuptools' 'python2-setuptools' 'python-cryptography'
             'python2-cryptography')
checkdepends=('python-pytest-runner' 'python2-pytest-runner' 'python-pretend' 'python2-pretend'
              'python-flaky' 'python2-flaky')
source=("https://pypi.io/packages/source/p/pyOpenSSL/pyOpenSSL-$pkgver.tar.gz")
sha512sums=('f194662b5842f1e3a4fcb910b9f2e6482d1dcdf834f306acc3dd6d9723f65038f7bff550248fa6268d90c839c9d9e8248bb6c7d399495fe6aed25291b93ece86')

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 pytest

    cd "$srcdir"/pyOpenSSL-$pkgver-py2
    python2 setup.py pytest
  ) || 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')
  replaces=('pyopenssl')
  provides=('pyopenssl')
  conflicts=('pyopenssl')

  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')

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