mrrl

Minimal Reliable Reproducible Linux
git clone https://ccx.te2000.cz/git/mrrl
Log | Files | Refs | Submodules | README

ca-certificates-wip-donotuse (2272B)


      1 #!/usr/bin/env pthbs-build
      2 #+musl-cross-make.d0431fc0def788be03da43136972361827de52c8e6f0a6f3890dc57fe32e8ecc
      3 #+busybox.f4ef3d511c029095beda8d21dd48f7730bec63fb09792ca951402d6620338089
      4 #+certdata2pem.6fb0945911370fa1db1e3a0fac6f5c610fc6e61a46c433302aa7dd79ea979184
      5 #@untar:-j:sha256:6ef7bc56cc0e0b307d99a3c494119686091cc1d4ad08986d68aa089dd00c7788:.
      6 
      7 def_prefix() {
      8 	prefix=/versions/$pthbs_package
      9 }
     10 def_dest() {
     11 	dest=${pthbs_destdir%/}//versions/$pthbs_package
     12 }
     13 def_prefix
     14 
     15 cd ca-certificates-20241121
     16 touch blacklist.txt  # TODO!
     17 certdata2pem
     18 
     19 install -d "$pthbs_destdir/$prefix/config/ssl/certs"
     20 for file in ./*.crt; do
     21 	install -m 644 $file  "$pthbs_destdir/$prefix/config/ssl/certs"
     22 	printf '# %s\n' $file >>"$pthbs_destdir/$prefix/config/ssl/certs/ca-certificates.crt"
     23 	cat $file >>"$pthbs_destdir/$prefix/config/ssl/certs/ca-certificates.crt"
     24 done
     25 
     26 
     27 cd "$pthbs_destdir/versions/$pthbs_package"
     28 find -type d -o -print | awk -F/ '
     29 BEGIN {
     30 	x["./config/ssl/certs/ISRG_Root_X1.crt"]=1
     31 	x["./config/ssl/certs/ISRG_Root_X2.crt"]=1}
     32 
     33 function r1(s) {
     34 	sub("^[.]/[^/]*", ".", s)
     35 	return s
     36 }
     37 function s1(repl, s) {
     38 	sub("^[.]/[^/]*", "./"repl, s)
     39 	return s
     40 }
     41 function link(src) {
     42 	x[$0]=0
     43 	printf "%s\t%s\n", $0, src
     44 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     45 }
     46 $1!="."{exit 1}
     47 
     48 
     49 $2 == "config" { link($0); next }
     50 $2 == "command" { link($0); next }
     51 $2 == "bin" { link(s1("command", $0)); next }
     52 
     53 $2 == "library.so" { link($0); next }
     54 $2 == "library" { link($0); next }
     55 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     56 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     57 
     58 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     59 
     60 $2 == "man" { link($0); next }
     61 $2 == "info" { link($0); next }
     62 $2 == "doc" { link($0); next }
     63 $2 == "icons" { link($0); next }
     64 $2 == "terminfo" { link($0); next }
     65 $2 == "data" { link($0); next }
     66 $2 == "include" { link($0); next }
     67 
     68 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     69 
     70 END {
     71 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     72 	for(fname in x) {
     73 		if(x[fname]) {
     74 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     75 			exit 3
     76 		}
     77 	}
     78 }' >.install-links.new
     79 mv .install-links.new .install-links