aports/secret/selfsigned/APKBUILD

38 lines
1.1 KiB
Plaintext

# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=redxen-secret-selfsigned
pkgver="$(date +'%Y.%m.%d')"
pkgrel=0
pkgdesc="Self-signed keys"
url="https://git.redxen.eu/RedXen"
arch="noarch"
license="none"
options="!check"
makedepends="openssl"
subpackages="$pkgname-private $pkgname-public $pkgname-fullchain"
install="$pkgname-private.pre-install $pkgname-fullchain.pre-install"
builddir="$srcdir"
build() {
openssl genrsa -out private.key 4096
openssl req -new -key private.key -days 365 -out public.pem -x509 -subj '/C=DE/ST=Bavaria/L=Nurnberg/O=RedXen/CN=redxen.eu'
cat public.pem private.key > fullchain.crt
}
package() {
mkdir -p $pkgdir
}
private() {
pkgdesc="Private key"
install -Dm440 -g 3000 "$builddir"/private.key "$subpkgdir"/etc/ssl/redxen/selfsigned/private.key
}
fullchain() {
pkgdesc="Full chain of certificates (public and private)"
install -Dm440 -g 3000 "$builddir"/fullchain.crt "$subpkgdir"/etc/ssl/redxen/selfsigned/fullchain.crt
}
public() {
pkgdesc="Public key"
install -Dm444 -g 3000 "$builddir"/public.pem "$subpkgdir"/etc/ssl/redxen/selfsigned/public.pem
}