# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=secpwgen
pkgver=1.3
pkgrel=3
pkgdesc="secure password generator"
url="http://zvrba.net/"
arch="all"
license="MIT"
depends_dev="libressl-dev"
makedepends="$depends_dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/itoffshore/$pkgname/archive/v$pkgver.tar.gz
	make-openssl.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	mv Makefile.proto Makefile
	make
}

package() {
	cd "$builddir"

	mkdir -p "$pkgdir"/usr/bin \
		"$pkgdir"/usr/share/man/man1
	install -m 755 secpwgen "$pkgdir"/usr/bin
	install -m 644 secpwgen.1 "$pkgdir"/usr/share/man/man1

	# post-install message
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"
	cat > "$pkgdir"/usr/share/doc/$pkgname/README.alpine <<EOF
To increase entropy in your system:
-----------------------------------
apk add haveged
rc-update add haveged
rc-service haveged start
EOF
}

sha512sums="a18b5405ae5f6a62c25dd61654ea897b2f099fa459530bc6cfdbe79d96bfa6b4943e4ba2456ad5355d37cababe585299638afe56ff1a9fc649b6df0b7aa1e269  secpwgen-1.3.tar.gz
d9e4f84ab0d557ecc4c57152ea78fd2c610f36d2ea4ae87f690944ac454497cb450e693ab4726209b58ade32e3c1f6f2bb74fec47b2a766e68eed56bfcfbc8d0  make-openssl.patch"
