mrrl

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

nawk (2382B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.d2d7aa00eac6ec561a10d126b1866f22e226a1276307466251e80fd8a4a1ebc7
      3 #+busybox-findutils.85b2328981df683d1ae7597eebdf3a332aa4241b936c0030fe3618cec1f4841a
      4 #+busybox-awk.4c3f8cc249ba35f1206fcaf2979bcfd66d09b117eeea4e6a939024825a542496
      5 #+bison.4d593c48fa3d4403c468571fa999dacc4e7ee9e92bf546d1b792b2b8ec0df3bc
      6 #+musl-cross-make.e4735d8572f9b6654a7381ebdfbd62e665d1d1da5e06a56923e89274cc6a510f
      7 #+gnu-make.75a726f6c19f7bc10b95a84da3ce72fb785ebdf587504430c6b74cfb6610b728
      8 #@untar:-z:sha256:e031b1e1d2b230f276f975bffb923f0ea15f798c839d15a3f26a1a39448e32d7:.
      9 
     10 
     11 # - build script start -
     12 
     13 prefix=/home/ccx/versions/$pthbs_package
     14 dest=${pthbs_destdir%/}${prefix}
     15 cd 'awk-20250116'
     16 
     17 
     18 make -j${JOBS:-1} -l$((1+${JOBS:-1}))
     19 
     20 install -Dm755 a.out "${dest}"/command/awk
     21 install -Dm644 awk.1 "${dest}"/man/man1/awk.1
     22 install -Dm644 LICENSE FIXES FIXES.1e README.md TODO -t "${dest}"/doc/
     23 
     24 
     25 
     26 
     27 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     28 find -type d -o -print | awk -F/ '
     29 BEGIN {x["./command/awk"]=1
     30 	x["./man/man1/awk.1"]=1
     31 }
     32 
     33 function r1(s) {
     34 	sub("^[.]/[^/]*", ".", s)
     35 	return s
     36 }
     37 function s1(repl, s) {
     38 	sub("^[.]/[^/]*", "./"repl, s)
     39 	return s
     40 }
     41 function link(src) {
     42 	x[$0]=0
     43 	printf "%s\t%s\n", $0, src
     44 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     45 }
     46 $1!="."{exit 1}
     47 
     48 
     49 $2 == "config" { link($0); next }
     50 $2 == "keys" { link($0); next }
     51 $2 == "zsh" { link($0); next }
     52 $2 == "env" { link($0); next }
     53 $2 == "command" { link($0); next }
     54 $2 == "bin" { link(s1("command", $0)); next }
     55 
     56 $2 == "library.so" { link($0); next }
     57 $2 == "library" { link($0); next }
     58 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     59 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
     60 
     61 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     62 
     63 $2 == "man" { link($0); next }
     64 $2 == "info" { link($0); next }
     65 $2 == "doc" { link($0); next }
     66 $2 == "icons" { link($0); next }
     67 $2 == "terminfo" { link($0); next }
     68 $2 == "data" { link($0); next }
     69 $2 == "include" { link($0); next }
     70 
     71 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     72 
     73 END {
     74 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     75 	for(fname in x) {
     76 		if(x[fname]) {
     77 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     78 			exit 3
     79 		}
     80 	}
     81 }' >.install-links.new
     82 mv .install-links.new .install-links
     83