mrrl

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

libressl (6870B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.379b7b2d8316b3678245563c8e592d71e6c380bc22a735c30c1c0e6f8f60caf3
      3 #+busybox-bzip2.4788e6edf9eeb73c7c665238a23aeed4703f8e25ab101509aee01440865ccdb1
      4 #+busybox-gzip.4fc908cacf4533192819578a079617c0cbe879b8ebd3e2140d896b067d3a574c
      5 #+busybox-lzop.e6e42a1a8451a4b845355899c9cd49efea2e395a0ef0c6ae7099103213a7bf4f
      6 #+busybox-unzip.93b5e83122059c87a2ddf489cdc7381bb80288630c508c218c2cfbadff524784
      7 #+busybox-xz.34137cc6ac8d23bf1bf5979b7fd047d4f50b34be07cd6ab636368952a199368d
      8 #+busybox-cpio.de88944ccff44a1f3abe06c42f83492a7e080de89fba27aadf5fe1a40e830cae
      9 #+busybox-dpkg.17e445a8089bc61db749a44c665597ecac3f21c4088daaa024f574412eb4d704
     10 #+busybox-rpm.669ed61ee218bc72206e069c896f392a025c88772ceb92ecb37b01ab0765baf8
     11 #+busybox-tar.15f67670238651149114006ae79359f24e1fa3c62be2e229a48f1334747ba413
     12 #+busybox-ed.78c51627a372c5b2ad3d046d0e77f341ae7c79917c4a16ca8abba284e7472cb7
     13 #+busybox-sed.8782396ae5c7b6e7d6bc8a93a7cff9912e6427e3d919dd5e5b00d1813ae88caf
     14 #+busybox-vi.e661d8eb052fbeebdd3be36ff6bd27651a7e59c857dad05c8633589790caa38c
     15 #+busybox-xxd.d2dc96e92cfdafae2c91d6fe897f42fdccae2dbc8b2d79f31eccc49d4e3a2d68
     16 #+busybox-process-extra.993cfd65eae2892ecb3fdfbece44b11e7ff6caa78f73e9f22bc2c97e7cd8a267
     17 #+busybox-procps.51ea8cb23d5eb1498f9167cc80b97c1a873758a8c1a7293079f50a2365466a71
     18 #+busybox-psmisc.ff1f9cf00f4c448946acb65d52b3b598e0495822af70b1504720cadf559e2090
     19 #+busybox-ash.7d10753f118afb2568e9f950c9cffa559b053a9b3ea516d6b46c3c73ebb6f8d8
     20 #+busybox-bc.c595636f103108c81f0ae55d2bf10d7cbc06ef1455a8353fcf04e42e765780a8
     21 #+busybox-coreutils.6b8071260ab4297f0e71013e42ac2a1a83fa99d92378d181ba49003fd349134a
     22 #+busybox-coreutils-extra.fc1b0766c881ee461d36c386833909553fcb0c31a547bfb563a7c6a50206bdcd
     23 #+busybox-daemontools.97aad28bbe5f38cff29db16c0f0d21e2fdc931825f683137df9bb57ef3a9b628
     24 #+busybox-grep.261a809c35cb58acc896143c2a81406a097f5870e02ce9906953181ef6b4c72b
     25 #+busybox-misc.5c2c025f1b74b9243a0128cd3f10dd1577b5ae123f53244d8e6895d4bdbd161d
     26 #+busybox-sh.25a9438d8449ade9c98af61b14af5711990dd002462a046b13b61969634c4d94
     27 #+busybox-util-linux-unpriv.4ea1c8c8746d7e80d36dea8924c576bc9666905b461dd543ceb5595394406c97
     28 #+busybox-findutils.052256c5bf9c3e7fef2e69d22f3d402d004f22113ce10b4d2c54ff417bf42622
     29 #+busybox-awk.f44da758ab8e737f05fb82ca4342acdf29ec44a9c2a9670cded75b04e8208058
     30 #+busybox-diffutils.30a803a8b8dd1d4f18bc5e5952cc4b15aea625caf2af34dd424af233786ba0d0
     31 #+musl-cross-make.74cd95cd7bd1db21d28d9a8579d924d588b9cbfd0f9744c0fb890188d71646aa
     32 #+gnu-make.31d90a55d6506852f9784f6f6febf0d843f8051f63bc18795fd5275baa369f50
     33 #+m4.6bc8e8d5403cf05226ef517faa0f48f5e843f5eafc5f859f69e8479caa10f4a0
     34 #+ca-certificates-wip-donotuse.76ffe7a5b6db6af5e653d5e8cd692d15e27c6fe64fc5e99b8936ce7ae4c40b96
     35 #@sha256:a68fedc0edd976b9f35ecfdcb252d80dc12084b1bc4e945be7dc42c437d8b540:c_rehash.c
     36 #@untar:-z:sha256:6d4b8d5bbb25a1f8336639e56ec5088052d43a95256697a85c4ce91323c25954:.
     37 
     38 
     39 # - build script start -
     40 
     41 autotools_config() {
     42 	prefix=/home/ccx/versions/$pthbs_package
     43 	./configure -C \
     44 		--prefix="$prefix" \
     45 		--build="$(${CC:-gcc} -dumpmachine)" \
     46 		--bindir="$prefix/command" \
     47 		--sbindir="$prefix/command" \
     48 		--infodir="$prefix/info" \
     49 		--localedir="$prefix/locale" \
     50 		--mandir="$prefix/man" \
     51 		--libdir="$prefix/library" \
     52 		--docdir="$prefix/doc/libressl" \
     53 		--datadir="$prefix/data" \
     54 		--datarootdir="$prefix/data" \
     55 		--localstatedir='/var/pthbs' \
     56 		"$@"
     57 
     58 }
     59 
     60 autotools_config_static() {
     61 	build_env_static
     62 	autotools_config "$@" --enable-static --disable-shared
     63 }
     64 
     65 build_env_static() {
     66 	export LD_LIBRARY_PATH="$pthbs_build_environment/library"
     67 	export CPATH="$pthbs_build_environment/include"
     68 	export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS"
     69 }
     70 
     71 check_static() {
     72 	local exe || true
     73 	exe=$pthbs_destdir'/home/ccx/versions'/$pthbs_package/$1
     74 	if ! test -f $exe; then
     75 		printf '%s\n' "Error: file '$1' doesn't exist!"
     76 		exit 1
     77 	fi
     78 	local interp_info || true
     79 	interp_info=$(readelf --string-dump=.interp "$exe") || exit $?
     80 	if test x '!=' "x$interp_info"; then
     81 		printf '%s\n' "Error: '$1' is a dynamic binary!"
     82 		exit 1
     83 	fi
     84 }
     85 
     86 prefix=/home/ccx/versions/$pthbs_package
     87 dest=${pthbs_destdir%/}${prefix}
     88 cd 'libressl-3.8.2'
     89 
     90 export LDFLAGS="--static"
     91 
     92 autotools_config_static --with-openssldir="$prefix/config/ssl"
     93 
     94 
     95 make -j${JOBS:-1} -l$((1+${JOBS:-1}))
     96 
     97 make DESTDIR="$pthbs_destdir" install
     98 
     99 
    100 cd ..
    101 gcc ./c_rehash.c -o c_rehash --static -static -I"$pthbs_destdir/$prefix/include" -L"$pthbs_destdir/$prefix/library" -lssl -lcrypto
    102 cp -vs '/home/ccx/versions/ca-certificates-wip-donotuse.76ffe7a5b6db6af5e653d5e8cd692d15e27c6fe64fc5e99b8936ce7ae4c40b96/config/ssl/certs'/*.crt "$pthbs_destdir/$prefix/config/ssl/certs/"
    103 ./c_rehash  "$pthbs_destdir/$prefix/config/ssl/certs/"
    104 cd  "$pthbs_destdir/$prefix/config/ssl/"
    105 mv cert.pem libressl-cert.pem
    106 cp -a certs/ca-certificates.crt cert.pem
    107 
    108 cd  "$pthbs_destdir/$prefix/"
    109 mkdir -p env
    110 # for s6-networking
    111 printf >env/CADIR '%s\n' "$prefix/config/ssl/certs"
    112 # for curl
    113 printf >env/SSL_CERT_DIR '%s\n' "$prefix/config/ssl/certs"
    114 # for git
    115 printf >env/GIT_SSL_CAPATH '%s\n' "$prefix/config/ssl/certs"
    116 
    117 
    118 check_static command/openssl
    119 check_static command/ocspcheck
    120 
    121 
    122 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
    123 find -type d -o -print | awk -F/ '
    124 BEGIN {
    125 	x["./command/openssl"]=1
    126 	x["./command/ocspcheck"]=1
    127 	x["./man/man1/openssl.1"]=1
    128 	x["./library/libssl.a"]=1
    129 	x["./include/tls.h"]=1
    130 	x["./config/ssl/certs/0b9bc432.0"]=1  # ISRG_Root_X2.crt
    131 	x["./config/ssl/certs/4042bcee.0"]=1  # ISRG_Root_X1.crt
    132 	x["./config/ssl/cert.pem"]=1  # merged bundle
    133 }
    134 
    135 function r1(s) {
    136 	sub("^[.]/[^/]*", ".", s)
    137 	return s
    138 }
    139 function s1(repl, s) {
    140 	sub("^[.]/[^/]*", "./"repl, s)
    141 	return s
    142 }
    143 function link(src) {
    144 	x[$0]=0
    145 	printf "%s\t%s\n", $0, src
    146 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
    147 }
    148 $1!="."{exit 1}
    149 
    150 
    151 $2 == "config" { link($0); next }
    152 $2 == "keys" { link($0); next }
    153 $2 == "zsh" { link($0); next }
    154 $2 == "env" { link($0); next }
    155 $2 == "command" { link($0); next }
    156 $2 == "bin" { link(s1("command", $0)); next }
    157 
    158 $2 == "library.so" { link($0); next }
    159 $2 == "library" { link($0); next }
    160 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
    161 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
    162 
    163 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
    164 
    165 $2 == "man" { link($0); next }
    166 $2 == "info" { link($0); next }
    167 $2 == "doc" { link($0); next }
    168 $2 == "icons" { link($0); next }
    169 $2 == "terminfo" { link($0); next }
    170 $2 == "data" { link($0); next }
    171 $2 == "include" { link($0); next }
    172 
    173 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
    174 
    175 END {
    176 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
    177 	for(fname in x) {
    178 		if(x[fname]) {
    179 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
    180 			exit 3
    181 		}
    182 	}
    183 }' >.install-links.new
    184 mv .install-links.new .install-links
    185