mrrl

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

lnstools:bootstrap (2737B)


      1 #!/usr/bin/env pthbs-build
      2 #@pragma:nosandbox
      3 #+musl-cross-make.513f0acae3d9d88d67a9151a33515f34995d3ff3d69f38b47239070d1b02c731
      4 #+gnu-make.0a6fbda1db6316eb5ed666a1697e7bf0e4604d371ac4cf5d24a5151e76280074
      5 #+busybox.a0af8a5860e7fa278d39404f06a382633b7e2122d85c16bb2e22b1804cdd1654
      6 #+skalibs.bbdbb2ba67e579c2d35158361a1aa7bf09386a7cd512c17bdd0fd03a699ddbb3
      7 #+execline.d0beb2314484ba9847cafda7dfe3f44f4c43f0c375fcbfb3331ef05e5b8752e5
      8 #+libcap.4f35712bd7b6e3f3faa71ca5d9b6d4c01d6a9358abfeff834d25a43944d2f442
      9 #@git:7fbfb934cdaa187a063a4df41498c06c46d4a6a9:lnstools
     10 
     11 
     12 # - build script start -
     13 
     14 prefix=/home/ccx/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/home/ccx/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