mrrl

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

lnstools:bootstrap (2719B)


      1 #!/usr/bin/env pthbs-build
      2 #@pragma:nosandbox
      3 #+musl-cross-make.473310ee8dd6c0b20a1b81598700e61a0e38dcfe0b8503bd5cdbb9bf4f9af4fc
      4 #+gnu-make.47af7543e52e6b72ac25e13223e2ce78703c58993166ba25c56cba245e48dbfa
      5 #+busybox.73a23c9ea571875b0e9e166a6974b6b314b540c8c247783d9cf96e10a59fcd73
      6 #+skalibs.4d9bb8936cbc1be9e4b0025b7d2f676d51646b050917d8789e8cab642ed1e31a
      7 #+execline.af0c8cfaacb871066cf86080e71ee5f804e2e9d8fa2369bac3f889100824c741
      8 #+libcap.0abe508b7282086aeb4a2da6dba6d63ac317c26494eaccd2a49bc9f272020023
      9 #@git:7fbfb934cdaa187a063a4df41498c06c46d4a6a9:lnstools
     10 
     11 
     12 # - build script start -
     13 
     14 prefix=/versions/$pthbs_package
     15 dest=${pthbs_destdir%/}${prefix}
     16 cd 'lnstools'
     17 
     18 export CC="$pthbs_build_environment/command/x86_64-linux-musl-gcc"
     19 export CPATH="$pthbs_build_environment/include"
     20 export LIBRARY_PATH="$pthbs_build_environment/library"
     21 export LDFLAGS="-L$pthbs_build_environment/library"
     22 sh ./configure --enable-absolute-paths \
     23 	--prefix="$prefix" \
     24 	--bindir="${prefix}/command" \
     25 	--includedir="${prefix}/include" \
     26 	--libdir="${prefix}/library" \
     27 	--dynlibdir="${prefix}/library.so"
     28 
     29 
     30 make -j${JOBS:-1} -l$((1+${JOBS:-1}))
     31 
     32 make DESTDIR="$pthbs_destdir" install
     33 
     34 
     35 
     36 
     37 
     38 cd "$pthbs_destdir/versions/$pthbs_package"
     39 find -type d -o -print | awk -F/ '
     40 BEGIN {
     41 	x["./command/lns-lockdown"]=1
     42 	x["./command/lns-envuidgid"]=1
     43 	x["./command/lns-applyuidgid"]=1
     44 	x["./command/lns-pidns"]=1
     45 }
     46 
     47 function r1(s) {
     48 	sub("^[.]/[^/]*", ".", s)
     49 	return s
     50 }
     51 function s1(repl, s) {
     52 	sub("^[.]/[^/]*", "./"repl, s)
     53 	return s
     54 }
     55 function link(src) {
     56 	x[$0]=0
     57 	printf "%s\t%s\n", $0, src
     58 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     59 }
     60 $1!="."{exit 1}
     61 
     62 
     63 $2 == "config" { link($0); next }
     64 $2 == "keys" { link($0); next }
     65 $2 == "zsh" { link($0); next }
     66 $2 == "env" { link($0); next }
     67 $2 == "command" { link($0); next }
     68 $2 == "bin" { link(s1("command", $0)); next }
     69 
     70 $2 == "library.so" { link($0); next }
     71 $2 == "library" { link($0); next }
     72 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     73 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
     74 
     75 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     76 
     77 $2 == "man" { link($0); next }
     78 $2 == "info" { link($0); next }
     79 $2 == "doc" { link($0); next }
     80 $2 == "icons" { link($0); next }
     81 $2 == "terminfo" { link($0); next }
     82 $2 == "data" { link($0); next }
     83 $2 == "include" { link($0); next }
     84 
     85 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     86 
     87 END {
     88 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     89 	for(fname in x) {
     90 		if(x[fname]) {
     91 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     92 			exit 3
     93 		}
     94 	}
     95 }' >.install-links.new
     96 mv .install-links.new .install-links
     97