pthbs

Packaging Through Hashed Build Scripts
git clone https://ccx.te2000.cz/git/pthbs
Log | Files | Refs | Submodules | README

core-system-conf (2195B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.62e4b1201b20ef0faf051b0e9b3ad1d3fbf4d498b8a0910ce4845a9017323f62
      3 #+diffutils.9bd0b617bcce5a19e212cebc52bcc91bec60f8e8240c1a646a3d6d3cbb6089c1
      4 #+gnu-make.00c93791f26f1498038cac282320484ad67ec79c1e920da9799f311ac6454675
      5 #+aat.9da7c8dd0936f2dcfd534a0473da1b730e29946cdd4db133659a1a35f0b53144
      6 #+fileset.37af839aac99d29b668754b76018e789e3e734158468c6972e3d401845d816f6
      7 #@git:68c2ffd5f266f0c27e3d0b9038872088235659f5:core-system-conf
      8 
      9 : ${JOBS:=1}
     10 prefix=/home/ccx/versions/$pthbs_package
     11 pkgdir="$pthbs_destdir/$prefix"
     12 mkdir -p "$pkgdir/"
     13 cp -av 'core-system-conf' "$pkgdir/"
     14 # verify build
     15 make -j${JOBS:-1} -l$((1+${JOBS:-1})) -C 'core-system-conf' clean
     16 make -j${JOBS:-1} -l$((1+${JOBS:-1})) -C 'core-system-conf' all
     17 rm -rf 'core-system-conf/build'
     18 diff -ru 'core-system-conf/' "$pkgdir/core-system-conf/"
     19 
     20 
     21 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     22 find -type d -o -print | awk -F/ '
     23 BEGIN {
     24 }
     25 
     26 function r1(s) {
     27 	sub("^[.]/[^/]*", ".", s)
     28 	return s
     29 }
     30 function s1(repl, s) {
     31 	sub("^[.]/[^/]*", "./"repl, s)
     32 	return s
     33 }
     34 function link(src) {
     35 	x[$0]=0
     36 	printf "%s\t%s\n", $0, src
     37 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     38 }
     39 $1!="."{exit 1}
     40 
     41 
     42 $2 == "static" { link(r1($0)); next }
     43 $2 == "authorized_keys" { link($0); next }
     44 $2 == "command" { link($0); next }
     45 $2 == "bin" { link(s1("command", $0)); next }
     46 
     47 $2 == "library.so" { link($0); next }
     48 $2 == "library" { link($0); next }
     49 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     50 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     51 
     52 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     53 
     54 $2 == "man" { link($0); next }
     55 $2 == "info" { link($0); next }
     56 $2 == "doc" { link($0); next }
     57 $2 == "icons" { link($0); next }
     58 $2 == "terminfo" { link($0); next }
     59 
     60 $2 == "include" { link($0); next }
     61 
     62 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     63 
     64 END {
     65 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     66 	for(fname in x) {
     67 		if(x[fname]) {
     68 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     69 			exit 3
     70 		}
     71 	}
     72 }' >.install-links.new
     73 mv .install-links.new .install-links