rsync (3866B)
1 #!/usr/bin/env pthbs-build 2 #+busybox.d2d7aa00eac6ec561a10d126b1866f22e226a1276307466251e80fd8a4a1ebc7 3 #+busybox-findutils.85b2328981df683d1ae7597eebdf3a332aa4241b936c0030fe3618cec1f4841a 4 #+busybox-diffutils.24775f761d337796ffe81623350e4bf2f039067f593411146bfeb9c80567d182 5 #+musl-cross-make.e4735d8572f9b6654a7381ebdfbd62e665d1d1da5e06a56923e89274cc6a510f 6 #+gnu-make.75a726f6c19f7bc10b95a84da3ce72fb785ebdf587504430c6b74cfb6610b728 7 #+m4.478aa95758da2858007dad2c971921d7d91e7166d000285a1b91bc684a6f17a9 8 #+nawk.20e61757d30ba2271f207e142d393eb446a3ce4af79060fea9822a996e9eee29 9 #+popt.db66085e7a95493cb70c3b829bbc185611954c1706a29cac1899c5276bad7107 10 #+libressl.de7444026279c2cb27262bce64bc243cdfaab374282b63ad354f78cb0f04b311 11 #+zstd.9736e321b1b8e6549f338d427549f01301473de674823230efeaeb274d899796 12 #@untar:-z:sha256:4e7d9d3f6ed10878c58c5fb724a67dacf4b6aac7340b13e488fb2dc41346f2bb:. 13 14 15 # - build script start - 16 17 autotools_config() { 18 prefix=/home/ccx/versions/$pthbs_package 19 ./configure -C \ 20 --prefix="$prefix" \ 21 --build="$(${CC:-gcc} -dumpmachine)" \ 22 --bindir="$prefix/command" \ 23 --sbindir="$prefix/command" \ 24 --infodir="$prefix/info" \ 25 --localedir="$prefix/locale" \ 26 --mandir="$prefix/man" \ 27 --libdir="$prefix/library" \ 28 --docdir="$prefix/doc/rsync" \ 29 --datadir="$prefix/data" \ 30 --datarootdir="$prefix/data" \ 31 --localstatedir='/var/pthbs' \ 32 "$@" 33 34 } 35 36 autotools_config_static() { 37 build_env_static 38 autotools_config "$@" --enable-static --disable-shared 39 } 40 41 build_env_static() { 42 export LD_LIBRARY_PATH="$pthbs_build_environment/library" 43 export CPATH="$pthbs_build_environment/include" 44 export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" 45 } 46 47 check_static() { 48 local exe || true 49 exe=$pthbs_destdir'/home/ccx/versions'/$pthbs_package/$1 50 if ! test -f $exe; then 51 printf '%s\n' "Error: file '$1' doesn't exist!" 52 exit 1 53 fi 54 local interp_info || true 55 interp_info=$(readelf --string-dump=.interp "$exe") || exit $? 56 if test x '!=' "x$interp_info"; then 57 printf '%s\n' "Error: '$1' is a dynamic binary!" 58 exit 1 59 fi 60 } 61 62 prefix=/home/ccx/versions/$pthbs_package 63 dest=${pthbs_destdir%/}${prefix} 64 cd 'rsync-3.2.7' 65 66 67 autotools_config_static --without-included-popt \ 68 --enable-openssl \ 69 --enable-zstd \ 70 --disable-xxhash \ 71 --disable-lz4 72 73 74 75 make -j${JOBS:-1} -l$((1+${JOBS:-1})) 76 77 make DESTDIR="$pthbs_destdir" install 78 79 80 81 check_static command/rsync 82 83 84 85 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" 86 find -type d -o -print | awk -F/ ' 87 BEGIN { 88 x["./command/rsync"]=1 89 x["./man/man1/rsync.1"]=1 90 } 91 92 function r1(s) { 93 sub("^[.]/[^/]*", ".", s) 94 return s 95 } 96 function s1(repl, s) { 97 sub("^[.]/[^/]*", "./"repl, s) 98 return s 99 } 100 function link(src) { 101 x[$0]=0 102 printf "%s\t%s\n", $0, src 103 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 104 } 105 $1!="."{exit 1} 106 107 108 $2 == "config" { link($0); next } 109 $2 == "keys" { link($0); next } 110 $2 == "zsh" { link($0); next } 111 $2 == "env" { link($0); next } 112 $2 == "command" { link($0); next } 113 $2 == "bin" { link(s1("command", $0)); next } 114 115 $2 == "library.so" { link($0); next } 116 $2 == "library" { link($0); next } 117 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 118 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 119 120 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 121 122 $2 == "man" { link($0); next } 123 $2 == "info" { link($0); next } 124 $2 == "doc" { link($0); next } 125 $2 == "icons" { link($0); next } 126 $2 == "terminfo" { link($0); next } 127 $2 == "data" { link($0); next } 128 $2 == "include" { link($0); next } 129 130 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 131 132 END { 133 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 134 for(fname in x) { 135 if(x[fname]) { 136 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 137 exit 3 138 } 139 } 140 }' >.install-links.new 141 mv .install-links.new .install-links 142