mrrl

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

libseccomp (2676B)


      1 #!/usr/bin/env pthbs-build
      2 #+musl-cross-make.757bcca6771cad3395ae302e0fdc835ebf5b4a965c08e30d758e6149b0bacbcd
      3 #+gnu-make.529116171fecc2bdac7c70e109d28270d765379c8a52cf7c3ea7453195bbf42b
      4 #+busybox.3664b94c09ea6d35ce73985026762c142829e53fed4a38541af3afb00c37dd4a
      5 #+busybox-diffutils.a22698424a7618572314d3da6953bf6652138ec492d3a0d01c37072f74adefc4
      6 #+pkgconf-pkg-config.00b5dde2db59264dcdcc0fba6f3952da3a4320bcf523fc7751d0e9dd34fe6294
      7 #@untar:-z:sha256:248a2c8a4d9b9858aa6baf52712c34afefcf9c9e94b76dce02c1c9aa25fb3375:.
      8 
      9 check_static() {
     10 	local exe || true
     11 	exe=$pthbs_destdir/'/versions'/$pthbs_package/$1
     12 	if ! test -f $exe; then
     13 		printf '%s\n' "Error: file '$1' doesn't exist!"
     14 		exit 1
     15 	fi
     16 	interp_info=$(readelf --string-dump=.interp "$exe") || exit $?
     17 	if test x '!=' "x$interp_info"; then
     18 		printf '%s\n' "Error: '$1' is a dynamic binary!"
     19 		exit 1
     20 	fi
     21 }
     22 build_env_static() {
     23 	export LD_LIBRARY_PATH="$pthbs_build_environment/library"
     24 	export CPATH="$pthbs_build_environment/include"
     25 	export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS"
     26 }
     27 def_prefix() {
     28 	prefix=/versions/$pthbs_package
     29 }
     30 def_dest() {
     31 	dest=${pthbs_destdir%/}//versions/$pthbs_package
     32 }
     33 def_prefix
     34 LDFLAGS=--static
     35 build_env_static
     36 
     37 cd libseccomp-2.5.5
     38 autotools_static libseccomp-2.5.5
     39 
     40 check_static command/scmp_sys_resolver
     41 
     42 
     43 cd "$pthbs_destdir/versions/$pthbs_package"
     44 find -type d -o -print | awk -F/ '
     45 BEGIN {
     46 	x["./command/scmp_sys_resolver"]=1
     47 	x["./library/libseccomp.a"]=1
     48 }
     49 
     50 function r1(s) {
     51 	sub("^[.]/[^/]*", ".", s)
     52 	return s
     53 }
     54 function s1(repl, s) {
     55 	sub("^[.]/[^/]*", "./"repl, s)
     56 	return s
     57 }
     58 function link(src) {
     59 	x[$0]=0
     60 	printf "%s\t%s\n", $0, src
     61 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     62 }
     63 $1!="."{exit 1}
     64 
     65 
     66 $2 == "command" { link($0); next }
     67 $2 == "bin" { link(s1("command", $0)); next }
     68 
     69 $2 == "library.so" { link($0); next }
     70 $2 == "library" { link($0); next }
     71 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     72 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     73 
     74 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     75 
     76 $2 == "man" { link($0); next }
     77 $2 == "info" { link($0); next }
     78 $2 == "doc" { link($0); next }
     79 $2 == "icons" { link($0); next }
     80 $2 == "terminfo" { link($0); next }
     81 $2 == "data" { link($0); next }
     82 $2 == "include" { link($0); next }
     83 
     84 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     85 
     86 END {
     87 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     88 	for(fname in x) {
     89 		if(x[fname]) {
     90 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     91 			exit 3
     92 		}
     93 	}
     94 }' >.install-links.new
     95 mv .install-links.new .install-links