mrrl

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

libcap:bootstrap (3077B)


      1 #!/usr/bin/env pthbs-build
      2 #@pragma:nosandbox
      3 #+musl-cross-make.de554c172179c402cf921f506a2369385ea83330a5bb4ab6bb6a253db9aac258
      4 #+musl-cross-make-headers.0587efdd01173871f2962a1fe0ed335bb3fad94e901a65ad651fc64a712008a3
      5 #+gnu-make.6236d2c236f658167aece4d10bc59fa913f7fac60938f31bb5ef4a34bad42a94
      6 #+busybox.119bbc99a86bd999b052ed79095bc38c05f6280924ec718a0eb13f1a8d3410c1
      7 #+nawk.596c1948e96cbcabfe3954a70deb947de0c73be1ddde41fafe8291bfec04bdd4
      8 #@untar:-J:sha256:f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb:.
      9 
     10 
     11 # - build script start -
     12 
     13 PATH="$pthbs_build_environment/command:$PATH"
     14 prefix=/versions/$pthbs_package
     15 dest=${pthbs_destdir%/}${prefix}
     16 cd 'libcap-2.69'
     17 sed -i "1 s|^#!/bin/bash|#!$(which sh)|" progs/*.sh
     18 
     19 
     20 export CC="$pthbs_build_environment/command/x86_64-linux-musl-gcc"
     21 export CPATH="$pthbs_build_environment/include"
     22 export LIBRARY_PATH="$pthbs_build_environment/library"
     23 LDFLAGS=--static
     24 
     25 
     26 make -j1 \
     27 	DESTDIR="$pthbs_destdir" \
     28 	SHARED=no DYNAMIC=no LIBCSTATIC=yes \
     29 	prefix="$prefix" \
     30 	exec_prefix="$prefix" \
     31 	lib_prefix="$prefix" \
     32 	inc_prefix="$prefix" \
     33 	man_prefix="$prefix/share" \
     34 	MANDIR="$prefix/man" \
     35 	sbin=command \
     36 	SBINDIR="$prefix/command" \
     37 	INCDIR="$prefix/include" \
     38 	lib=library \
     39 	LIBDIR="$prefix/library" \
     40 	PKGCONFIGDIR="$prefix/library/pkgconfig" \
     41 	CAPSH_SHELL="'-DSHELL=\"$(which sh)\"'" \
     42 	LDFLAGS="$LDFLAGS" \
     43 	all install
     44 
     45 
     46 
     47 
     48 cd "$pthbs_destdir/versions/$pthbs_package"
     49 find -type d -o -print | awk -F/ '
     50 BEGIN {
     51 	x["./command/capsh"]=1
     52 	x["./command/getcap"]=1
     53 	x["./command/setcap"]=1
     54 	x["./command/getpcaps"]=1
     55 	x["./library/libcap.a"]=1
     56 }
     57 
     58 function r1(s) {
     59 	sub("^[.]/[^/]*", ".", s)
     60 	return s
     61 }
     62 function s1(repl, s) {
     63 	sub("^[.]/[^/]*", "./"repl, s)
     64 	return s
     65 }
     66 function link(src) {
     67 	x[$0]=0
     68 	printf "%s\t%s\n", $0, src
     69 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     70 }
     71 $1!="."{exit 1}
     72 $2 == "env" { link($0); next }
     73 $2 == ".env-template" { link($0); next }
     74 
     75 $2 == "command" { link($0); next }
     76 $2 == "command" { link($0); next }
     77 $2 == "bin" { link(s1("command", $0)); next }
     78 $2 == "sbin" { link(s1("command", $0)); next }
     79 
     80 $2 == "library.so" { link($0); next }
     81 $2 == "library" { link($0); next }
     82 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     83 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
     84 
     85 $2 == "share" && $3 == "info" { link(s1("info", r1($0))); next }
     86 $2 == "share" && $3 == "man" { link(s1("man", r1($0))); next }
     87 $2 == "share" && $3 == "doc" { link(s1("doc", r1($0))); next }
     88 
     89 $2 == "config" { link($0); next }
     90 $2 == "man" { link($0); next }
     91 $2 == "info" { link($0); next }
     92 $2 == "doc" { link($0); next }
     93 $2 == "data" { link($0); next }
     94 $2 == "include" { link($0); next }
     95 
     96 
     97 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     98 
     99 END {
    100 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
    101 	retcode = 0
    102 	for(fname in x) {
    103 		if(x[fname]) {
    104 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
    105 			retcode = 3
    106 		}
    107 	}
    108 	exit retcode
    109 }' >.install-links.new
    110 mv .install-links.new .install-links
    111