mrrl

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

lnstools:bootstrap (3073B)


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