summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0a93bae09d7d1d8307b7e79cfd9a16bf1562eb9c (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
62
63
64
65
66
67
68
69
70
# Maintainer: Gordian Edenhofer <gordian.edenhofer@gmail.com>

pkgbase=python-acme-git
pkgname=("python-acme-git" "python2-acme-git")
_reponame="certbot"
pkgver=0.31.0.r3.gec4c03fa6
pkgrel=1
pkgdesc="ACME protocol implementation for Python"
arch=('any')
license=('Apache')
url="https://github.com/certbot/${_reponame}"
depends=('')
makedepends=('git' 'python-setuptools' 'python2-setuptools' 'python-pyasn1' 'python2-pyasn1'
	'python-cryptography' 'python2-cryptography' 'python-pyopenssl' 'python2-pyopenssl'
	'python-ndg-httpsclient' 'python2-ndg-httpsclient' 'python-pyrfc3339'
	'python2-pyrfc3339' 'python-pytz' 'python2-pytz' 'python-requests'
	'python2-requests' 'python-six' 'python2-six' 'python-werkzeug' 'python2-werkzeug'
	'python-mock' 'python2-mock')
provides=("")
conflicts=("")
source=("${_reponame}"::"git+https://github.com/certbot/${_reponame}")
sha512sums=('SKIP')

pkgver() {
	cd "${srcdir}/${_reponame}"
	( set -o pipefail
	git describe --long 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' \
	|| printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
}

prepare() {
	cp -a "${srcdir}/${_reponame}/acme"{,-py2}
}

build() {
	cd "${srcdir}/${_reponame}/acme"
	python setup.py clean
	rm -rf build dist
	python setup.py build

	cd "${srcdir}/${_reponame}/acme-py2"
	python2 setup.py clean
	rm -rf build dist
	python2 setup.py build
}

package_python-acme-git() {
	depends=('python-setuptools' 'python-pyasn1' 'python-cryptography' 'python-pyopenssl'
		'python-ndg-httpsclient' 'python-pyrfc3339' 'python-pytz' 'python-requests'
		'python-six' 'python-werkzeug' 'python-mock')
	optdepends=("python-dnspython: local validation of dns-01 challenges")
	provides=("python-acme=${pkgver}")
	conflicts=("python-acme")

	cd "${srcdir}/${_reponame}/acme"
	python setup.py install --root="${pkgdir}" --optimize=1
}

package_python2-acme-git() {
	depends=('python2-setuptools' 'python2-pyasn1' 'python2-cryptography' 'python2-pyopenssl'
		'python2-ndg-httpsclient' 'python2-pyrfc3339' 'python2-pytz' 'python2-requests'
		'python2-six' 'python2-werkzeug' 'python2-mock')
	optdepends=("python2-dnspython: local validation of dns-01 challenges")
	provides=("python2-acme=${pkgver}")
	conflicts=("python2-acme")

	cd "${srcdir}/${_reponame}/acme-py2"
	python2 setup.py install --root="${pkgdir}" --optimize=1
}