pthbs

Packaging Through Hashed Build Scripts
git clone https://ccx.te2000.cz/git/pthbs
Log | Files | Refs | Submodules | README

s6 (2787B)


      1 #!/usr/bin/env pthbs-build
      2 #+musl-cross-make.65f98305f5666435bf0c6b9ccedffae2179ff1b3286752756886f760cf7771d2
      3 #+gnu-make.782c9e6625fd7420e2cd38b847afed19db3b3844cae8a0426a0dbf73e10d78e5
      4 #+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9
      5 #+patch.c2f2ffe5c9b78dce8f2a1adeca76c83dd548ffcabed790bfb6e886e9d27474bb
      6 #+skalibs.a98901a2d19b3799a9c481e2be46a14642d670d9724480b81988486c71eba15a
      7 #+execline.70f92114a71a2949f770fa2771b69b3b89b42b65cffb3247fbf2119614967ab5
      8 #@git:9bf94d170fd0d5540be8c6337f53ed71dbca268a:s6
      9 #@sha256:627d1273036dc35239ba9dd1da45132e3bfce1ab8171dd27dc7952cdf09b698e:s6_clone3_newpid.patch
     10 #@sha256:64488d8562a4e98a3b299f095bb2550cff6a3d743dc2b9c5aaeea03e5b83ec33:s6_ftrigr_max.patch
     11 
     12 : ${JOBS:=1}
     13 
     14 prefix=/versions/$pthbs_package
     15 cd s6
     16 patch -up 1 -i ../s6_clone3_newpid.patch
     17 patch -up 1 -i ../s6_ftrigr_max.patch
     18 ./configure \
     19 	--prefix="$prefix" \
     20 	--dynlibdir="${prefix}/library.so" \
     21 	--bindir="${prefix}/command" \
     22 	--libdir="${prefix}/library" \
     23 	--shebangdir="${prefix}/command" \
     24 	--with-sysdeps='/versions/skalibs.a98901a2d19b3799a9c481e2be46a14642d670d9724480b81988486c71eba15a/sysdeps' \
     25 	--with-include="$pthbs_build_environment/include" \
     26 	--with-lib="$pthbs_build_environment/library" \
     27 	--with-dynlib="$pthbs_build_environment/library.so" \
     28 	--disable-shared --enable-static --enable-allstatic --enable-static-libc --absolute-paths
     29 
     30 make -j${JOBS:-1} -l$((1+${JOBS:-1})) CFLAGS=-DWANT_CLONE_NEWPID
     31 make DESTDIR="$pthbs_destdir" install
     32 
     33 cd "$pthbs_destdir/versions/$pthbs_package"
     34 find -type d -o -print | awk -F/ '
     35 BEGIN {
     36 }
     37 
     38 function r1(s) {
     39 	sub("^[.]/[^/]*", ".", s)
     40 	return s
     41 }
     42 function s1(repl, s) {
     43 	sub("^[.]/[^/]*", "./"repl, s)
     44 	return s
     45 }
     46 function link(src) {
     47 	x[$0]=0
     48 	printf "%s\t%s\n", $0, src
     49 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     50 }
     51 $1!="."{exit 1}
     52 
     53 
     54 $2 == "command" { link($0); next }
     55 $2 == "bin" { link(s1("command", $0)); next }
     56 
     57 $2 == "library.so" { link($0); next }
     58 $2 == "library" { link($0); next }
     59 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     60 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     61 
     62 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     63 
     64 $2 == "man" { link($0); next }
     65 $2 == "info" { link($0); next }
     66 $2 == "doc" { link($0); next }
     67 $2 == "icons" { link($0); next }
     68 $2 == "terminfo" { link($0); next }
     69 $2 == "data" { link($0); next }
     70 $2 == "include" { link($0); next }
     71 
     72 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     73 
     74 END {
     75 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     76 	for(fname in x) {
     77 		if(x[fname]) {
     78 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     79 			exit 3
     80 		}
     81 	}
     82 }' >.install-links.new
     83 mv .install-links.new .install-links