mrrl

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

libcap:bootstrap (3095B)


      1 #!/usr/bin/env pthbs-build
      2 #@pragma:nosandbox
      3 #+musl-cross-make.9be7a57aa0035ff26870115e69056e25445f3a96768a7d81251e7073630aadf9
      4 #+musl-cross-make-headers.08c33fe1a66af0c7a9dad4d5e46cd977b4e16ee4ffa2278a4caf6ee3f4f66b0f
      5 #+gnu-make.05bfcd168c0d3714ecba9e27d84e02bfd2ef8f754c26c162be357882390451fc
      6 #+busybox.23105cf3c52263661c44f7d855ae5dfc7287f5f8b60d6a026dedee24f4cf7a2e
      7 #+nawk.abe3790fd5e321ccd4e1ab7dab56339222e2eee686bc4b2241e7853104a4a500
      8 #@untar:-J:sha256:f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb:.
      9 
     10 
     11 # - build script start -
     12 
     13 PATH="$pthbs_build_environment/command:$PATH"
     14 prefix=/home/ccx/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/home/ccx/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