libcap:bootstrap (2751B)
1 #!/usr/bin/env pthbs-build 2 #@pragma:nosandbox 3 #+musl-cross-make.513f0acae3d9d88d67a9151a33515f34995d3ff3d69f38b47239070d1b02c731 4 #+gnu-make.0a6fbda1db6316eb5ed666a1697e7bf0e4604d371ac4cf5d24a5151e76280074 5 #+busybox.a0af8a5860e7fa278d39404f06a382633b7e2122d85c16bb2e22b1804cdd1654 6 #@untar:-J:sha256:f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb:. 7 8 9 # - build script start - 10 11 prefix=/home/ccx/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/home/ccx/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