aports/secrets/letsencrypt/APKBUILD

52 lines
1.5 KiB
Plaintext
Raw Normal View History

2021-01-02 02:35:44 +00:00
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=redxen-secret-letsencrypt
pkgver=2020.12.18
pkgrel=1
pkgdesc="LetsEncrypt keys"
url="https://git.redxen.eu/RedXen"
arch="noarch"
license="none"
subpackages="$pkgname-private $pkgname-public $pkgname-fullchain"
source="
private.key
public.pem
ca.pem
"
checkdepends="openssl"
install="$pkgname-private.pre-install $pkgname-fullchain.pre-install"
builddir="$srcdir"
build() {
cat public.pem ca.pem private.key > fullchain.crt
}
package() {
mkdir -p $pkgdir
}
check() {
openssl x509 -in public.pem -noout -checkend 0 >/dev/null && return
error "You have provided a expired certificate!"
return 1
}
private() {
pkgdesc="Private key"
install -Dm400 -g 3005 "$srcdir"/private.key "$subpkgdir"/etc/ssl/redxen/letsencrypt/private.key
}
fullchain() {
pkgdesc="Full chain of certificates (public and private)"
install -Dm400 -g 3005 "$builddir"/fullchain.crt "$subpkgdir"/etc/ssl/redxen/letsencrypt/fullchain.crt
}
public() {
pkgdesc="Public key"
install -Dm444 -g 3005 "$srcdir"/public.pem "$subpkgdir"/etc/ssl/redxen/letsencrypt/public.pem
}
sha512sums="11d85953a19bbc4ccea99370d0c7bc1fea78398173602b2b0b4b393704887d9686705456c2b1c8857242c1ced6efe0dd3aca1b202ba5d72549185bd4d1a5feaf private.key
c215e38eb78e359f9a27170c936af9b6fb0b04344e5202aaf6128d178e665d3643dfb27fd57ad9cda30351769e43c7b1ce2189a87bf804ab3a90d3808dc8f954 public.pem
0fa893f751f0880c7d89c398cae9708f5ff04d466832fb6160a824395032259ac52e02a44da531d0f8bf7e310298b0067b1e8257f816d3223034f391ecba491d ca.pem"