summaryrefslogtreecommitdiff
path: root/python-certipy/PKGBUILD
blob: b8d1c6b806bbad97db3e23c95bcfa8bfc45f2230 (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
71
72
73
74
75
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Tommy Li <ttoo74@gmail.com>
pkgbase=python-certipy
pkgname=(python-certipy python2-certipy)
_name=${pkgbase#python-}
pkgver=0.1.2
pkgrel=1
pkgdesc="A simple python tool for creating certificate authorities and certificates on the fly"
arch=(any)
url="https://github.com/LLNL/certipy"
license=('BSD')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_depends=(
  'python-pyopenssl'
)
_makedepends=(
  'python-pypandoc'
)
makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_depends[@]}"
  "${_depends[@]/python/python2}"
  "${_makedepends[@]}"
  "${_makedepends[@]/ython/ython2}"
)
source=("https://files.pythonhosted.org/packages/04/1e/340c66cddafdbbc378ff4ddd8659c633a162471645059fc5976b3aadf58b/certipy-0.1.2.tar.gz")
sha256sums=('3461c5ff28eda977185132d4c6d4393989c7dd996ba8c780b07b9b4e679d455a')

prepare() {
	# fix permission error
	chmod -R u+rwX,go+rX,go-w "$_name-$pkgver"
  cp -a "$_name-$pkgver"{,-py2}
}

build() {
  echo "Building python..."
  (
		cd "$_name-$pkgver"
		python setup.py build
  )
  echo "Building python2..."
  (
		cd "$_name-$pkgver-py2"
		python2 setup.py build
  )
}

package_python-certipy() {
  depends=(
    "${_deppy[@]}"
    "${_depends[@]}"
  )
	cd "$_name-$pkgver"
	python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
}

package_python2-certipy() {
  depends=(
    "${_deppy2[@]}"
    "${_depends[@]/python/python2}"
  )
	cd "$_name-$pkgver-py2"
	python2 setup.py install --root="$pkgdir/" --optimize=1 --skip-build
	find "$pkgdir/" -type f -exec sed -i '1 s,/python$,\02,' {} +
	mv "$pkgdir/usr/bin/certipy" "$pkgdir/usr/bin/certipy2"
}