mrrl

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

argp-standalone (3182B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.d2d7aa00eac6ec561a10d126b1866f22e226a1276307466251e80fd8a4a1ebc7
      3 #+busybox-findutils.85b2328981df683d1ae7597eebdf3a332aa4241b936c0030fe3618cec1f4841a
      4 #+busybox-awk.4c3f8cc249ba35f1206fcaf2979bcfd66d09b117eeea4e6a939024825a542496
      5 #+busybox-diffutils.24775f761d337796ffe81623350e4bf2f039067f593411146bfeb9c80567d182
      6 #+musl-cross-make.e4735d8572f9b6654a7381ebdfbd62e665d1d1da5e06a56923e89274cc6a510f
      7 #+gnu-make.75a726f6c19f7bc10b95a84da3ce72fb785ebdf587504430c6b74cfb6610b728
      8 #+m4.478aa95758da2858007dad2c971921d7d91e7166d000285a1b91bc684a6f17a9
      9 #@untar:-z:sha256:c29eae929dfebd575c38174f2c8c315766092cec99a8f987569d0cad3c6d64f6:.
     10 #@untar::sha256:a4facc0856b512ad8ab5aed7b07e14a9629aaf042b1e92377ba22fcfc4c4205b:argp-standalone-1.5.0
     11 
     12 
     13 # - build script start -
     14 
     15 autotools_config() {
     16 	prefix=/home/ccx/versions/$pthbs_package
     17 	./configure -C \
     18 		--prefix="$prefix" \
     19 		--build="$(${CC:-gcc} -dumpmachine)" \
     20 		--bindir="$prefix/command" \
     21 		--sbindir="$prefix/command" \
     22 		--infodir="$prefix/info" \
     23 		--localedir="$prefix/locale" \
     24 		--mandir="$prefix/man" \
     25 		--libdir="$prefix/library" \
     26 		--docdir="$prefix/doc/argp-standalone" \
     27 		--datadir="$prefix/data" \
     28 		--datarootdir="$prefix/data" \
     29 		--localstatedir='/var/pthbs' \
     30 		"$@"
     31 
     32 }
     33 
     34 autotools_config_static() {
     35 	build_env_static
     36 	autotools_config "$@" --enable-static --disable-shared
     37 }
     38 
     39 prefix=/home/ccx/versions/$pthbs_package
     40 dest=${pthbs_destdir%/}${prefix}
     41 cd 'argp-standalone-1.5.0'
     42 
     43 
     44 autotools_config 
     45  
     46 
     47 
     48 make -j${JOBS:-1} -l$((1+${JOBS:-1})) libargp.a
     49 
     50 
     51 install -d "${dest}/library"
     52 install -m 644 libargp.a "${dest}/library"
     53 
     54 install -d "${dest}/include"
     55 install -m 644 argp.h "${dest}/include"
     56 
     57 
     58 
     59 
     60 
     61 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     62 find -type d -o -print | awk -F/ '
     63 BEGIN {
     64 	x["./library/libargp.a"]=1
     65 	x["./include/argp.h"]=1
     66 }
     67 
     68 function r1(s) {
     69 	sub("^[.]/[^/]*", ".", s)
     70 	return s
     71 }
     72 function s1(repl, s) {
     73 	sub("^[.]/[^/]*", "./"repl, s)
     74 	return s
     75 }
     76 function link(src) {
     77 	x[$0]=0
     78 	printf "%s\t%s\n", $0, src
     79 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     80 }
     81 $1!="."{exit 1}
     82 
     83 
     84 $2 == "config" { link($0); next }
     85 $2 == "keys" { link($0); next }
     86 $2 == "zsh" { link($0); next }
     87 $2 == "env" { link($0); next }
     88 $2 == "command" { link($0); next }
     89 $2 == "bin" { link(s1("command", $0)); next }
     90 
     91 $2 == "library.so" { link($0); next }
     92 $2 == "library" { link($0); next }
     93 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     94 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
     95 
     96 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     97 
     98 $2 == "man" { link($0); next }
     99 $2 == "info" { link($0); next }
    100 $2 == "doc" { link($0); next }
    101 $2 == "icons" { link($0); next }
    102 $2 == "terminfo" { link($0); next }
    103 $2 == "data" { link($0); next }
    104 $2 == "include" { link($0); next }
    105 
    106 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
    107 
    108 END {
    109 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
    110 	for(fname in x) {
    111 		if(x[fname]) {
    112 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
    113 			exit 3
    114 		}
    115 	}
    116 }' >.install-links.new
    117 mv .install-links.new .install-links
    118