vinix-ports / ca-certificates-bundle / PKGBUILD.vile
32 lines · 31 sloc · 1.63 KB · c40b2907711697a4c77e405add76a3115766e106
Raw
1defpkgbuild(ca-certificates-bundle,
2 #:pkgname, "ca-certificates-bundle",
3 #:pkgver, "20261020",
4 #:pkgrel, 2,
5 #:pkgdesc, "Mozilla TLS certificate authorities for Vinix",
6 #:arch, [#:any],
7 #:url, "https://gitlab.alpinelinux.org/alpine/ca-certificates",
8 #:license, "MPL-2.0",
9 #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/ca-certificates-20261020.tar.bz2"],
10 #:sha256sums, ["1048bc7f50fa42a6621bc2f8816173f89a0c0098f26dff072bc8fe40af714400"],
11
12 ; Generate the trust bundle from the pinned NSS certdata, using the same
13 ; server-auth trust selection as Alpine. certdata.stamp also splits the PEMs.
14 #:build, fn() {
15 run("make", "-C", "ca-certificates-20261020", "certdata.stamp")
16 ; libarchive also extracts this port under the bootstrap C locale.
17 run("mv", "ca-certificates-20261020/NetLock_Arany_=Class_Gold=_Főtanúsítvány.crt",
18 "ca-certificates-20261020/NetLock_Arany_Class_Gold.crt")
19 },
20 #:check, fn() {
21 run("grep", "-q", "^-----BEGIN CERTIFICATE-----$", "ca-certificates-20261020/cert.pem")
22 run("test", "-f", "ca-certificates-20261020/ISRG_Root_X1.crt")
23 },
24 #:package, fn() {
25 run("install", "-Dm644", "ca-certificates-20261020/cert.pem",
26 string-append(pkgdir(), "/etc/ssl/certs/ca-certificates.crt"))
27 run("ln", "-s", "certs/ca-certificates.crt", string-append(pkgdir(), "/etc/ssl/cert.pem"))
28 ; The Java trust-store builder also consumes the authorities individually.
29 dest := string-append(pkgdir(), "/usr/share/ca-certificates/mozilla")
30 run("mkdir", "-p", dest)
31 for-each(fn(cert) { run("install", "-m644", cert, dest) }, glob("ca-certificates-20261020/*.crt"))
32 })
33