mrrl

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

libcap:bootstrap (2733B)


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