| 1 | defpkgbuild(ca-certificates-bundle, |
| 2 | #:pkgname, "ca-certificates-bundle", |
| 3 | #:pkgver, "20261020", |
| 4 | #:pkgrel, 3, |
| 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 | run("mkdir", "-p", string-append(pkgdir(), "/etc/ssl1.1")) |
| 29 | run("ln", "-s", "../ssl/certs", string-append(pkgdir(), "/etc/ssl1.1/certs")) |
| 30 | run("ln", "-s", "../ssl/cert.pem", string-append(pkgdir(), "/etc/ssl1.1/cert.pem")) |
| 31 | run("cmp", string-append(pkgdir(), "/etc/ssl1.1/cert.pem"), string-append(pkgdir(), "/etc/ssl1.1/certs/ca-certificates.crt")) |
| 32 | ; The Java trust-store builder also consumes the authorities individually. |
| 33 | dest := string-append(pkgdir(), "/usr/share/ca-certificates/mozilla") |
| 34 | run("mkdir", "-p", dest) |
| 35 | for-each(fn(cert) { run("install", "-m644", cert, dest) }, glob("ca-certificates-20261020/*.crt")) |
| 36 | }) |
| 37 | |