summaryrefslogtreecommitdiff
path: root/extra/python-cryptography/PKGBUILD
blob: 18e334002c6b68556a1f4f11aa9e3608932500c6 (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
# $Id: PKGBUILD 212992 2014-05-17 05:33:24Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>

pkgbase=python-cryptography
pkgname=('python-cryptography' 'python2-cryptography')
pkgver=0.4
pkgrel=1
pkgdesc="A package designed to expose cryptographic recipes and primitives to Python developers"
arch=('i686' 'x86_64')
license=('Apache')
url="http://pypi.python.org/pypi/cryptography"
makedepends=('python-setuptools' 'python2-setuptools' 'python-six' 'python2-six' 'python-cffi' 'python2-cffi')
checkdepends=('python-pytest' 'python2-pytest' 'python-cryptography-vectors' 'python2-cryptography-vectors'
              'python-iso8601' 'python2-iso8601' 'python-pretend' 'python2-pretend' 'python-pyasn1' 'python2-pyasn1')
source=("http://pypi.python.org/packages/source/c/cryptography/cryptography-${pkgver}.tar.gz")
md5sums=('d1bb13648a12eda2a54653ba113d2e84')

prepare() {
   cp -a cryptography-${pkgver}{,-python2}
}

build() {
   # Build python 3 module
   cd cryptography-${pkgver}
   python3 setup.py build
 
   # Build python 2 module
   cd ../cryptography-${pkgver}-python2
   python2 setup.py build
}

check() {
   # Check python3 module
   cd "${srcdir}"/cryptography-${pkgver}
   python3 setup.py test

   # Check python2 module
   cd "${srcdir}"/cryptography-${pkgver}-python2
   python2 setup.py test
}
 
package_python-cryptography() {
   depends=('python' 'python-six' 'python-cffi')
 
   cd cryptography-${pkgver}
   python3 setup.py install --root="${pkgdir}" --optimize=1 --skip-build
}
 
package_python2-cryptography() {
   depends=('python2' 'python2-six' 'python2-cffi')
 
   cd cryptography-${pkgver}-python2
   python2 setup.py install --root="${pkgdir}" --optimize=1 --skip-build
}