# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Tommy Li <ttoo74@gmail.com>
pkgname=python-certipy
_pkgname="${pkgname#*-}"
pkgver=0.1.3
pkgrel=64
pkgdesc="A simple python tool for creating certificate authorities and certificates on the fly"
arch=(any)
url="https://github.com/LLNL/certipy"
license=('BSD')
depends=(
  'python>=3.10'
  'python<3.11'
  'python-pyopenssl'
)
makedepends=(
  'python-pypandoc'
  'python-setuptools'
)
source=("https://pypi.python.org/packages/3a/b3/f9228354c1eac06cd3577a981571b9188392d73d583fcaa7a8f3fb374a56/${_pkgname}-$pkgver.tar.gz")
sha512sums=('6168146b60900883e4901920b354e17e341a87cf7dbdf674f0fbcbbb12067aa324d1dc7bf0817b5539873f883ac130f6b199fbab61222d2e06bde70e02019e95')

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

build() {
  cd "${_pkgname}-$pkgver"
  python setup.py build
}

package() {
  cd "${_pkgname}-$pkgver"
  python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
}