openssl (3002B)
1 #!/usr/bin/env pthbs-build 2 #+busybox.d2d7aa00eac6ec561a10d126b1866f22e226a1276307466251e80fd8a4a1ebc7 3 #+busybox-findutils.85b2328981df683d1ae7597eebdf3a332aa4241b936c0030fe3618cec1f4841a 4 #+busybox-awk.4c3f8cc249ba35f1206fcaf2979bcfd66d09b117eeea4e6a939024825a542496 5 #+gnu-make.75a726f6c19f7bc10b95a84da3ce72fb785ebdf587504430c6b74cfb6610b728 6 #+musl-cross-make.e4735d8572f9b6654a7381ebdfbd62e665d1d1da5e06a56923e89274cc6a510f 7 #@untar:-z:sha256:712590fd20aaa60ec75d778fe5b810d6b829ca7fb1e530577917a131f9105539:. 8 9 10 # - build script start - 11 12 build_env_static() { 13 export LD_LIBRARY_PATH="$pthbs_build_environment/library" 14 export CPATH="$pthbs_build_environment/include" 15 export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" 16 } 17 18 check_static() { 19 local exe || true 20 exe=$pthbs_destdir'/home/ccx/versions'/$pthbs_package/$1 21 if ! test -f $exe; then 22 printf '%s\n' "Error: file '$1' doesn't exist!" 23 exit 1 24 fi 25 local interp_info || true 26 interp_info=$(readelf --string-dump=.interp "$exe") || exit $? 27 if test x '!=' "x$interp_info"; then 28 printf '%s\n' "Error: '$1' is a dynamic binary!" 29 exit 1 30 fi 31 } 32 33 prefix=/home/ccx/versions/$pthbs_package 34 dest=${pthbs_destdir%/}${prefix} 35 cd 'openssl-3.3.3' 36 37 build_env_static 38 cd openssl-3.3.3 39 ./config # this will fail, perl is not packaged 40 41 make -j${JOBS:-1} -l$((1+${JOBS:-1})) 42 43 make DESTDIR="$pthbs_destdir" install 44 45 46 47 check_static command/openssl 48 check_static command/ocspcheck 49 50 51 52 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" 53 find -type d -o -print | awk -F/ ' 54 BEGIN { 55 x["./command/openssl"]=1 56 x["./command/ocspcheck"]=1 57 x["./man/man1/openssl.1"]=1 58 x["./library/libssl.a"]=1 59 x["./include/tls.h"]=1 60 } 61 62 function r1(s) { 63 sub("^[.]/[^/]*", ".", s) 64 return s 65 } 66 function s1(repl, s) { 67 sub("^[.]/[^/]*", "./"repl, s) 68 return s 69 } 70 function link(src) { 71 x[$0]=0 72 printf "%s\t%s\n", $0, src 73 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 74 } 75 $1!="."{exit 1} 76 77 78 $2 == "config" { link($0); next } 79 $2 == "keys" { link($0); next } 80 $2 == "zsh" { link($0); next } 81 $2 == "env" { link($0); next } 82 $2 == "command" { link($0); next } 83 $2 == "bin" { link(s1("command", $0)); next } 84 85 $2 == "library.so" { link($0); next } 86 $2 == "library" { link($0); next } 87 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 88 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 89 90 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 91 92 $2 == "man" { link($0); next } 93 $2 == "info" { link($0); next } 94 $2 == "doc" { link($0); next } 95 $2 == "icons" { link($0); next } 96 $2 == "terminfo" { link($0); next } 97 $2 == "data" { link($0); next } 98 $2 == "include" { link($0); next } 99 100 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 101 102 END { 103 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 104 for(fname in x) { 105 if(x[fname]) { 106 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 107 exit 3 108 } 109 } 110 }' >.install-links.new 111 mv .install-links.new .install-links 112