# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Thomas Bächler <thomas@archlinux.org>

pkgname=easy-rsa
pkgver=3.2.1
pkgrel=1
pkgdesc='Simple shell based CA utility'
arch=(any)
url='https://github.com/OpenVPN/easy-rsa'
depends=('openssl' 'sh' 'grep')
license=('custom')
backup=('etc/easy-rsa/openssl-easyrsa.cnf'
	'etc/easy-rsa/vars')
validpgpkeys=(
	'65FF3F24AA08E882CB444C94D731D97A606FD463'	# Josh Cepek <josh.cepek@usa.net>
	'6F4056821152F03B6B24F2FCF8489F839D7367F3')	# Eric Crist <ecrist@secure-computing.net>
source=("https://github.com/OpenVPN/easy-rsa/releases/download/v${pkgver}/EasyRSA-${pkgver}.tgz"{,.sig})
sha256sums=('ec0fdca46c07afef341e0e0eeb2bf0cfe74a11322b77163e5d764d28cb4eec89'
            'SKIP')

package() {
	cd EasyRSA-${pkgver}/

	install -D -m0755 easyrsa "${pkgdir}"/usr/bin/easyrsa

	install -D -m0644 openssl-easyrsa.cnf "${pkgdir}"/etc/easy-rsa/openssl-easyrsa.cnf
	install -D -m0644 vars.example "${pkgdir}"/etc/easy-rsa/vars
	install -d -m0755 "${pkgdir}"/etc/easy-rsa/x509-types/
	install -m0644 x509-types/* "${pkgdir}"/etc/easy-rsa/x509-types/

	install -d -m0755  "${pkgdir}"/usr/share/doc/easy-rsa/
	install -m0644 doc/* ChangeLog "${pkgdir}"/usr/share/doc/easy-rsa/

	install -D -m0644 COPYING.md "${pkgdir}"/usr/share/licenses/easy-rsa/COPYING
}

