mrrl

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

commit 39dcd079e2a3b722645475205832b5189de7df13
parent f123ca11876317c0f8e351ea98cc45cc3f82af7a
Author: Jan Pobrislo <ccx@te2000.cz>
Date:   Sat, 29 Nov 2025 13:51:57 +0000

Make directory layout configurable

Diffstat:
Mtemplates/busybox-links | 4++--
Mtemplates/dune | 14+++++++-------
Mtemplates/functions/autotools | 18+++++++++---------
Mtemplates/functions/build_env_dynamic | 6+++---
Mtemplates/functions/build_env_static | 6+++---
Mtemplates/functions/qx | 6+++---
Mtemplates/linux | 12++++++------
Mtemplates/macros | 30+++++++++++++++---------------
Mtemplates/musl-cross-make | 2+-
Mtemplates/pkg/aat | 4++--
Mtemplates/pkg/abduco | 8++++----
Mtemplates/pkg/acl | 10+++++-----
Mtemplates/pkg/alpine-keys | 8++++----
Mtemplates/pkg/apk-tools | 18+++++++++---------
Mtemplates/pkg/argp-standalone | 12++++++------
Mtemplates/pkg/attr | 10+++++-----
Mtemplates/pkg/bison | 2+-
Mtemplates/pkg/busybox | 12++++++------
Mtemplates/pkg/busybox:bootstrap | 12++++++------
Mtemplates/pkg/busybox:modutils | 8++++----
Mtemplates/pkg/ca-certificates-wip-donotuse | 12++++++------
Mtemplates/pkg/ccx-utils | 34+++++++++++++++++-----------------
Mtemplates/pkg/certdata2pem | 2+-
Mtemplates/pkg/confz | 2+-
Mtemplates/pkg/containers | 48++++++++++++++++++++++++------------------------
Mtemplates/pkg/curl | 6+++---
Mtemplates/pkg/diffutils | 4++--
Mtemplates/pkg/dune | 16++++++++--------
Mtemplates/pkg/easyseccomp | 4++--
Mtemplates/pkg/error-standalone | 8++++----
Mtemplates/pkg/execline | 8++++----
Mtemplates/pkg/execline:bootstrap | 24++++++++++++------------
Mtemplates/pkg/fileset | 6+++---
Mtemplates/pkg/findutils | 18+++++++++---------
Mtemplates/pkg/flex | 6+++---
Mtemplates/pkg/git | 18+++++++++---------
Mtemplates/pkg/gnu-make | 4++--
Mtemplates/pkg/gnu-make:bootstrap | 4++--
Mtemplates/pkg/gperf | 2+-
Mtemplates/pkg/kbd | 8++++----
Mtemplates/pkg/libarchive | 6+++---
Mtemplates/pkg/libbsd | 4++--
Mtemplates/pkg/libcap | 20++++++++++----------
Mtemplates/pkg/libcap:bootstrap | 26+++++++++++++-------------
Mtemplates/pkg/libcgroup | 4++--
Mtemplates/pkg/libelf | 22+++++++++++-----------
Mtemplates/pkg/libmd | 6+++---
Mtemplates/pkg/libressl | 32++++++++++++++++----------------
Mtemplates/pkg/libretls | 8++++----
Mtemplates/pkg/libseccomp | 4++--
Mtemplates/pkg/libunwind | 6+++---
Mtemplates/pkg/lnstools:bootstrap | 24++++++++++++------------
Mtemplates/pkg/logincaps | 22+++++++++++-----------
Mtemplates/pkg/m4 | 2+-
Mtemplates/pkg/mandoc | 34+++++++++++++++++-----------------
Mtemplates/pkg/mlog | 6+++---
Mtemplates/pkg/musl-cross-make | 26+++++++++++++-------------
Mtemplates/pkg/musl-fts | 14+++++++-------
Mtemplates/pkg/nawk | 10+++++-----
Mtemplates/pkg/netbsd-curses | 18+++++++++---------
Mtemplates/pkg/ocaml | 6+++---
Mtemplates/pkg/ocaml-base | 6+++---
Mtemplates/pkg/ocaml-compiler-libs | 8++++----
Mtemplates/pkg/ocaml-findlib | 36++++++++++++++++++------------------
Mtemplates/pkg/ocaml-ppxlib | 14+++++++-------
Mtemplates/pkg/ocaml-sexplib0 | 8++++----
Mtemplates/pkg/ocaml-stdlib-shims | 6+++---
Mtemplates/pkg/ocaml:dynlink | 6+++---
Mtemplates/pkg/ocaml_intrinsics_kernel | 16++++++++--------
Mtemplates/pkg/ocamlbuild | 8++++----
Mtemplates/pkg/opam | 20++++++++++----------
Mtemplates/pkg/openssl | 10+++++-----
Mtemplates/pkg/patch | 2+-
Mtemplates/pkg/patchelf:bootstrap | 4++--
Mtemplates/pkg/pkgconf | 4++--
Mtemplates/pkg/pkgconf-pkg-config | 4++--
Mtemplates/pkg/popt | 4++--
Mtemplates/pkg/pthbs-banginstall | 4++--
Mtemplates/pkg/rsync | 4++--
Mtemplates/pkg/s6-networking | 8++++----
Mtemplates/pkg/skalibs | 18+++++++++---------
Mtemplates/pkg/skalibs:bootstrap | 18+++++++++---------
Mtemplates/pkg/snaprep | 4++--
Mtemplates/pkg/squashfs-tools | 6+++---
Mtemplates/pkg/strace | 8++++----
Mtemplates/pkg/system-config | 36++++++++++++++++++------------------
Mtemplates/pkg/system-config-init | 8++++----
Mtemplates/pkg/system-config-rc | 6+++---
Mtemplates/pkg/system-config-scripts | 4++--
Mtemplates/pkg/system-config-zsh | 4++--
Mtemplates/pkg/tinyssh | 14+++++++-------
Mtemplates/pkg/user-env | 4++--
Mtemplates/pkg/xbps | 22+++++++++++-----------
Mtemplates/pkg/zsh | 18+++++++++---------
Mtemplates/pkg/zstd | 10+++++-----
Mtemplates/scriptsetup | 4++--
Mtemplates/single_static_c | 6+++---
Mtemplates/skaware | 14+++++++-------
Mtemplates/topkg | 6+++---
Mvariants/ccx-x86_64.yaml | 24++++++++++++++++++++++++
Mvariants/root-x86_64.yaml | 24++++++++++++++++++++++++
101 files changed, 607 insertions(+), 559 deletions(-)

diff --git a/templates/busybox-links b/templates/busybox-links @@ -11,9 +11,9 @@ for exe in {% block bb_link %}{% endblock %}; do ln -sf "$bb" command/$exe case $exe in (false);; - (*) ./command/$exe --help || exit $?;; + (*) ./{{bindir}}/$exe --help || exit $?;; esac - printf '%s\t%s\n' "./command/$exe" "./command/$exe" >>.install-links.new + printf '%s\t%s\n' "./{{bindir}}/$exe" "./{{bindir}}/$exe" >>.install-links.new done mv .install-links.new .install-links {% endblock %} diff --git a/templates/dune b/templates/dune @@ -18,13 +18,13 @@ dune build --no-buffer --verbose {% block dune_build_args %}--release{% endblock dune install \ --destdir="$pthbs_destdir" \ --prefix="$prefix" \ - --libdir="$prefix/library.ocaml" \ - --bindir="$prefix/command" \ - --sbindir="$prefix/command" \ - --etcdir="$prefix/config/etc" \ - --mandir="$prefix/man" \ - --docdir="$prefix/doc/{{shortname}}" \ - --datadir="$prefix/data" \ + --libdir="$prefix/{{ocamldir}}" \ + --bindir="$prefix/{{bindir}}" \ + --sbindir="$prefix/{{sbindir}}" \ + --etcdir="$prefix/{{configdir}}/etc" \ + --mandir="$prefix/{{mandir}}" \ + --docdir="$prefix/{{docdir}}/{{shortname}}" \ + --datadir="$prefix/{{datadir}}" \ {% block dune_install_args %}{% endblock %} {% endblock install %} diff --git a/templates/functions/autotools b/templates/functions/autotools @@ -3,15 +3,15 @@ autotools_config() { ./configure -C \ --prefix="$prefix" \ --build="$(${CC:-gcc} -dumpmachine)" \ - --bindir="$prefix/command" \ - --sbindir="$prefix/command" \ - --infodir="$prefix/info" \ - --localedir="$prefix/locale" \ - --mandir="$prefix/man" \ - --libdir="$prefix/library" \ - --docdir="$prefix/doc/{{shortname}}" \ - --datadir="$prefix/data" \ - --datarootdir="$prefix/data" \ + --bindir="$prefix/{{bindir}}" \ + --sbindir="$prefix/{{sbindir}}" \ + --infodir="$prefix/{{infodir}}" \ + --localedir="$prefix/{{localedir}}" \ + --mandir="$prefix/{{mandir}}" \ + --libdir="$prefix/{{libdir}}" \ + --docdir="$prefix/{{docdir}}/{{shortname}}" \ + --datadir="$prefix/{{datadir}}" \ + --datarootdir="$prefix/{{datarootdir}}" \ --localstatedir='{{var_dir}}' \ "$@" {# diff --git a/templates/functions/build_env_dynamic b/templates/functions/build_env_dynamic @@ -1,5 +1,5 @@ build_env_dynamic() { - export LD_LIBRARY_PATH="$pthbs_build_environment/library.so" - export CPATH="$pthbs_build_environment/include" - export LDFLAGS="-L$pthbs_build_environment/library.so $LDFLAGS" + export LD_LIBRARY_PATH="$pthbs_build_environment/{{dynlibdir}}" + export CPATH="$pthbs_build_environment/{{includedir}}" + export LDFLAGS="-L$pthbs_build_environment/{{dynlibdir}} $LDFLAGS" } diff --git a/templates/functions/build_env_static b/templates/functions/build_env_static @@ -1,5 +1,5 @@ build_env_static() { - export LD_LIBRARY_PATH="$pthbs_build_environment/library" - export CPATH="$pthbs_build_environment/include" - export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" + export LD_LIBRARY_PATH="$pthbs_build_environment/{{libdir}}" + export CPATH="$pthbs_build_environment/{{includedir}}" + export LDFLAGS="-static -L$pthbs_build_environment/{{libdir}} $LDFLAGS" } diff --git a/templates/functions/qx b/templates/functions/qx @@ -4,7 +4,7 @@ qx() { # register executable as dependency and quote full path to be suitable f if ! test -x "$exe"; then printf 'Error: executable not found: %s\n' "$1" fi - mkdir -p "${dest}/deps/command" - ln -sf $exe "${dest}/deps/command/$name" - "s6-quote" "$prefix/deps/command/$name" + mkdir -p "${dest}/deps/{{bindir}}" + ln -sf $exe "${dest}/deps/{{bindir}}/$name" + "s6-quote" "$prefix/deps/{{bindir}}/$name" } diff --git a/templates/linux b/templates/linux @@ -33,7 +33,7 @@ unxz -c < '../patch-{{ patch_version }}.xz' | patch -p1 -N patch -p1 -N <../noobjtool.patch {% endblock prepare %} {%- block configure %} -export CPATH="$pthbs_build_environment/include" +export CPATH="$pthbs_build_environment/{{includedir}}" cp -v ../linux.config .config {{ linux_arch_personality|default('') }} make olddefconfig @@ -43,14 +43,14 @@ diff -u ../linux.config .config || true {%- block build %} {{ linux_arch_personality|default('') }} {{make}} \ V=1 \ - HOSTLDFLAGS="-static -L$pthbs_build_environment/library" \ - HOSTCFLAGS="-L$pthbs_build_environment/library" + HOSTLDFLAGS="-static -L$pthbs_build_environment/{{libdir}}" \ + HOSTCFLAGS="-L$pthbs_build_environment/{{libdir}}" {% endblock build %} {%- block install %} -mkdir -p "${dest}/doc/linux" "${dest}/boot" -cp -v .config "${dest}/config" -mv Documentation/* "${dest}/doc/linux" +mkdir -p "${dest}/{{docdir}}/linux" "${dest}/boot" +cp -v .config "${dest}/{{configdir}}" +mv Documentation/* "${dest}/{{docdir}}/linux" {{ linux_arch_personality|default('') }} make modules_install install \ INSTALL_MOD_PATH="${dest}/kernel" \ INSTALL_MOD_STRIP=1 \ diff --git a/templates/macros b/templates/macros @@ -1,22 +1,22 @@ {% macro genlinks_ocaml_library(name, modules=[], ifaces=[]) %} - x["./library.ocaml/{{name}}/META"]=1 + x["./{{ocamldir}}/{{name}}/META"]=1 {%- for m in modules %} - x["./library.ocaml/{{name}}/{{m}}.a"]=1 - x["./library.ocaml/{{name}}/{{m}}.cma"]=1 - x["./library.ocaml/{{name}}/{{m}}.cmi"]=1 - {#- x["./library.ocaml/{{name}}/{{m}}.cmt"]=1 #} - x["./library.ocaml/{{name}}/{{m}}.cmti"]=1 - x["./library.ocaml/{{name}}/{{m}}.cmx"]=1 - x["./library.ocaml/{{name}}/{{m}}.cmxa"]=1 - {#- x["./library.ocaml/{{name}}/{{m}}.cmxs"]=1 #} - {#- x["./library.ocaml/{{name}}/{{m}}.ml"]=1 #} - x["./library.ocaml/{{name}}/{{m}}.mli"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.a"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.cma"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.cmi"]=1 + {#- x["./{{ocamldir}}/{{name}}/{{m}}.cmt"]=1 #} + x["./{{ocamldir}}/{{name}}/{{m}}.cmti"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.cmx"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.cmxa"]=1 + {#- x["./{{ocamldir}}/{{name}}/{{m}}.cmxs"]=1 #} + {#- x["./{{ocamldir}}/{{name}}/{{m}}.ml"]=1 #} + x["./{{ocamldir}}/{{name}}/{{m}}.mli"]=1 {%- endfor -%} {%- for m in ifaces %} - x["./library.ocaml/{{name}}/{{m}}.cmi"]=1 - x["./library.ocaml/{{name}}/{{m}}.cmti"]=1 - x["./library.ocaml/{{name}}/{{m}}.cmx"]=1 - x["./library.ocaml/{{name}}/{{m}}.mli"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.cmi"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.cmti"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.cmx"]=1 + x["./{{ocamldir}}/{{name}}/{{m}}.mli"]=1 {%- endfor -%} {% endmacro %} diff --git a/templates/musl-cross-make b/templates/musl-cross-make @@ -68,7 +68,7 @@ grep -F "$pthbs_package" true.linker #} {% endblock %} {% block genlinks_rules %} -$2 == "bin" && $3 ~ /^{{triplet}}-/ { target=$3; sub("{{triplet}}-", "", target); link("./command/" target) } +$2 == "bin" && $3 ~ /^{{triplet}}-/ { target=$3; sub("{{triplet}}-", "", target); link("./{{bindir}}/" target) } # $2 == "{{triplet}}" && $3 == "include" { link(r1($0)) } $2 == "{{triplet}}" && $3 == "include" && $4 == "linux" { link(r1($0)) } {% endblock -%} diff --git a/templates/pkg/aat b/templates/pkg/aat @@ -6,6 +6,6 @@ mv -v data.awk "${dest}/" {% endblock %} {% block genlinks_begin %} - x["./command/aat"]=1 - x["./command/aat.awk"]=1 + x["./{{bindir}}/aat"]=1 + x["./{{bindir}}/aat.awk"]=1 {% endblock %} diff --git a/templates/pkg/abduco b/templates/pkg/abduco @@ -13,8 +13,8 @@ cat >config.mk <<EOF SRCDIR = . PREFIX = ${prefix} EXEC_PREFIX = \$(PREFIX) -BINDIR = ${prefix}/command -MANPREFIX = ${prefix}/man +BINDIR = ${prefix}/{{bindir}} +MANPREFIX = ${prefix}/{{mandir}} CC = cc CFLAGS = -pipe -Os LDFLAGS = -static @@ -25,7 +25,7 @@ sed 's/^/> /' config.mk {% block install -%} {{ super() -}} # the Makefile hardcodes 'bin' despite configure undersanding BINDIR -mv "${dest}/bin" "${dest}/command" +mv "${dest}/bin" "${dest}/{{bindir}}" {% endblock %} {% block check -%} @@ -33,5 +33,5 @@ check_static command/abduco {% endblock %} {% block genlinks_begin %} - x["./command/abduco"]=1 + x["./{{bindir}}/abduco"]=1 {% endblock %} diff --git a/templates/pkg/acl b/templates/pkg/acl @@ -10,9 +10,9 @@ check_static command/chacl {% endblock %} {% block genlinks_begin %} - x["./command/chacl"]=1 - x["./command/setfacl"]=1 - x["./command/getfacl"]=1 - x["./library/libacl.a"]=1 - x["./include/acl/libacl.h"]=1 + x["./{{bindir}}/chacl"]=1 + x["./{{bindir}}/setfacl"]=1 + x["./{{bindir}}/getfacl"]=1 + x["./{{libdir}}/libacl.a"]=1 + x["./{{includedir}}/acl/libacl.h"]=1 {% endblock %} diff --git a/templates/pkg/alpine-keys b/templates/pkg/alpine-keys @@ -3,12 +3,12 @@ {% block build -%} {% endblock %} {% block install -%} -mkdir -p "${dest}/keys" -mv keys "${dest}/keys/alpine" +mkdir -p "${dest}/{{keysdir}}" +mv keys "${dest}/{{keysdir}}/alpine" {% endblock %} {% block genlinks_begin %} - x["./keys/alpine/alpine-devel@lists.alpinelinux.org-58199dcc.rsa.pub"]=1 - x["./keys/alpine/alpine-devel@lists.alpinelinux.org-616ae350.rsa.pub"]=1 + x["./{{keysdir}}/alpine/alpine-devel@lists.alpinelinux.org-58199dcc.rsa.pub"]=1 + x["./{{keysdir}}/alpine/alpine-devel@lists.alpinelinux.org-616ae350.rsa.pub"]=1 {% endblock %} {% block genlinks_rules %} $2 == "keys" { link($0); next } diff --git a/templates/pkg/apk-tools b/templates/pkg/apk-tools @@ -21,20 +21,20 @@ build_env_static {{make}} STATIC=y LUA=no V=1 \ CFLAGS=-O2 \ DESTDIR="$pthbs_destdir" \ - SBINDIR="$prefix/command" \ + SBINDIR="$prefix/{{bindir}}" \ CONFDIR="$prefix/etc/apk" \ - MANDIR="$prefix/man" \ - DOCDIR="$prefix/doc/apk" \ - INCLUDEDIR="$prefix/include" \ - LIBDIR="$prefix/library" \ - PKGCONFIGDIR="$prefix/library/pkgconfig" \ + MANDIR="$prefix/{{mandir}}" \ + DOCDIR="$prefix/{{docdir}}/apk" \ + INCLUDEDIR="$prefix/{{includedir}}" \ + LIBDIR="$prefix/{{libdir}}" \ + PKGCONFIGDIR="$prefix/{{pkgconfigdir}}" \ install-static {% endblock build_and_install %} {% block check -%} check_static command/apk.static {% endblock check %} {% block genlinks_begin %} - x["./command/apk.static"]=1 - x["./library/libapk.a"]=1 - x["./library/pkgconfig/apk.pc"]=1 + x["./{{bindir}}/apk.static"]=1 + x["./{{libdir}}/libapk.a"]=1 + x["./{{pkgconfigdir}}/apk.pc"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/argp-standalone b/templates/pkg/argp-standalone @@ -9,14 +9,14 @@ {% endblock %} {% block install %} -install -d "${dest}/library" -install -m 644 libargp.a "${dest}/library" +install -d "${dest}/{{libdir}}" +install -m 644 libargp.a "${dest}/{{libdir}}" -install -d "${dest}/include" -install -m 644 argp.h "${dest}/include" +install -d "${dest}/{{includedir}}" +install -m 644 argp.h "${dest}/{{includedir}}" {% endblock %} {% block genlinks_begin %} - x["./library/libargp.a"]=1 - x["./include/argp.h"]=1 + x["./{{libdir}}/libargp.a"]=1 + x["./{{includedir}}/argp.h"]=1 {% endblock %} diff --git a/templates/pkg/attr b/templates/pkg/attr @@ -6,9 +6,9 @@ LDFLAGS=--static {{ super() -}} {% endblock %} {% block genlinks_begin %} - x["./command/attr"]=1 - x["./command/setfattr"]=1 - x["./command/getfattr"]=1 - x["./library/libattr.a"]=1 - x["./include/attr/libattr.h"]=1 + x["./{{bindir}}/attr"]=1 + x["./{{bindir}}/setfattr"]=1 + x["./{{bindir}}/getfattr"]=1 + x["./{{libdir}}/libattr.a"]=1 + x["./{{includedir}}/attr/libattr.h"]=1 {% endblock %} diff --git a/templates/pkg/bison b/templates/pkg/bison @@ -19,5 +19,5 @@ rmdir -p "$pthbs_destdir"/$prefix/lib || true check_static command/bison {% endblock %} {% block genlinks_begin %} - x["./command/bison"]=1 + x["./{{bindir}}/bison"]=1 {% endblock %} diff --git a/templates/pkg/busybox b/templates/pkg/busybox @@ -7,12 +7,12 @@ #@sha256:{{files["busybox.config"]}}:busybox/.config {% endblock %} {% block configure -%} -export CC="$pthbs_build_environment/command/{{triplet}}-gcc" +export CC="$pthbs_build_environment/{{bindir}}/{{triplet}}-gcc" export CFLAGS="-D_GNU_SOURCE" export LDFLAGS="-static" cat >>.config <<EOF -CONFIG_BUSYBOX_EXEC_PATH="${prefix}/command/busybox" +CONFIG_BUSYBOX_EXEC_PATH="${prefix}/{{bindir}}/busybox" EOF make oldconfig cat .config @@ -24,13 +24,13 @@ make V=1 CROSS_COMPILE={{triplet}}- LDFLAGS=-static HOSTLDFLAGS=-static \ {% endblock %} {% block install -%} -mkdir -p "${dest}/command" -cp -a busybox "${dest}/command/" +mkdir -p "${dest}/{{bindir}}" +cp -a busybox "${dest}/{{bindir}}/" {% endblock %} {% block finish -%} cd "${dest}" -echo false | ./command/busybox --list >/dev/null # test if it works -printf "./command/busybox\t./command/%s\n" busybox bbconfig >.install-links.new +echo false | ./{{bindir}}/busybox --list >/dev/null # test if it works +printf "./{{bindir}}/busybox\t./{{bindir}}/%s\n" busybox bbconfig >.install-links.new mv .install-links.new .install-links {% endblock %} diff --git a/templates/pkg/busybox:bootstrap b/templates/pkg/busybox:bootstrap @@ -16,16 +16,16 @@ export CFLAGS="-D_GNU_SOURCE" export LDFLAGS="-static" cd busybox -$make/command/make V=1 CROSS_COMPILE={{triplet}}- LDFLAGS=-static HOSTLDFLAGS=-static \ +$make/{{bindir}}/make V=1 CROSS_COMPILE={{triplet}}- LDFLAGS=-static HOSTLDFLAGS=-static \ HOSTCC="$CC -static" CC="$CC -static" HOSTCFLAGS=-D_GNU_SOURCE -j${JOBS:-1} -mkdir -p "$pthbs_destdir{{versions}}/$pthbs_package/command" -cp -a busybox "$pthbs_destdir{{versions}}/$pthbs_package/command/" +mkdir -p "$pthbs_destdir{{versions}}/$pthbs_package/{{bindir}}" +cp -a busybox "$pthbs_destdir{{versions}}/$pthbs_package/{{bindir}}/" cd "$pthbs_destdir{{versions}}/$pthbs_package" -echo false | ./command/busybox --list >/dev/null # test if it works -./command/busybox --list | awk ' +echo false | ./{{bindir}}/busybox --list >/dev/null # test if it works +./{{bindir}}/busybox --list | awk ' $0 == "bbconfig" { next } -{ print "./command/busybox\t./command/" $0 } +{ print "./{{bindir}}/busybox\t./{{bindir}}/" $0 } ' >.install-links.new mv .install-links.new .install-links {% endblock %} diff --git a/templates/pkg/busybox:modutils b/templates/pkg/busybox:modutils @@ -13,7 +13,7 @@ #@sha256:{{files["busybox_modutils.config"]}}:busybox/.config {% endblock %} {% block configure -%} -export CC="$pthbs_build_environment/command/{{triplet}}-gcc" +export CC="$pthbs_build_environment/{{bindir}}/{{triplet}}-gcc" export CFLAGS="-D_GNU_SOURCE" export LDFLAGS="-static" # TODO: indirection via deps directory/symlink @@ -30,12 +30,12 @@ make V=1 CROSS_COMPILE={{triplet}}- LDFLAGS=-static HOSTLDFLAGS=-static \ ./make_single_applets.sh {% endblock %} {% block install -%} -mkdir -p "${dest}/command" +mkdir -p "${dest}/{{bindir}}" for exe in depmod insmod lsmod modinfo modprobe rmmod; do - mv -v "busybox_$(printf '%s' $exe | tr '[a-z]' '[A-Z]')" "${dest}/command/${exe}" + mv -v "busybox_$(printf '%s' $exe | tr '[a-z]' '[A-Z]')" "${dest}/{{bindir}}/${exe}" check_static command/$exe - printf './command/%s\t./command/%s\n' "$exe" "$exe" \ + printf './{{bindir}}/%s\t./{{bindir}}/%s\n' "$exe" "$exe" \ >>"${dest}/.install-links.new" done diff --git a/templates/pkg/ca-certificates-wip-donotuse b/templates/pkg/ca-certificates-wip-donotuse @@ -10,11 +10,11 @@ certdata2pem {% endblock %} {% block install -%} -install -d "${dest}/config/ssl/certs" +install -d "${dest}/{{ssldir}}/certs" for file in ./*.crt; do - install -m 644 $file "${dest}/config/ssl/certs" - printf '# %s\n' $file >>"${dest}/config/ssl/certs/ca-certificates.crt" - cat $file >>"${dest}/config/ssl/certs/ca-certificates.crt" + install -m 644 $file "${dest}/{{ssldir}}/certs" + printf '# %s\n' $file >>"${dest}/{{ssldir}}/certs/ca-certificates.crt" + cat $file >>"${dest}/{{ssldir}}/certs/ca-certificates.crt" done {% endblock %} @@ -22,6 +22,6 @@ done $2 == "config" { link($0); next } {% endblock -%} {% block genlinks_begin %} - x["./config/ssl/certs/ISRG_Root_X1.crt"]=1 - x["./config/ssl/certs/ISRG_Root_X2.crt"]=1 + x["./{{ssldir}}/certs/ISRG_Root_X1.crt"]=1 + x["./{{ssldir}}/certs/ISRG_Root_X2.crt"]=1 {% endblock %} diff --git a/templates/pkg/ccx-utils b/templates/pkg/ccx-utils @@ -29,27 +29,27 @@ for name in \ ucspi-socksserver-access do make $name - install -d "${dest}/command" - install -m 755 $name "${dest}/command" + install -d "${dest}/{{bindir}}" + install -m 755 $name "${dest}/{{bindir}}" check_static command/$name done {% endblock %} {% block install -%} {% endblock %} {% block genlinks_begin %} - x["./command/spawn-pty"]=1 - x["./command/argv0exec"]=1 - x["./command/nosuid"]=1 - x["./command/pidns_run"]=1 - x["./command/safelink"]=1 - x["./command/spawn-pty"]=1 - x["./command/fdsend"]=1 - x["./command/fdrecv"]=1 - x["./command/fdrecvto"]=1 - x["./command/socketpair"]=1 - x["./command/ptsname"]=1 - x["./command/mtime_to_uuidv7"]=1 - x["./command/ucspi-socksserver"]=1 - x["./command/ucspi-socksserver-connected"]=1 - x["./command/ucspi-socksserver-access"]=1 + x["./{{bindir}}/spawn-pty"]=1 + x["./{{bindir}}/argv0exec"]=1 + x["./{{bindir}}/nosuid"]=1 + x["./{{bindir}}/pidns_run"]=1 + x["./{{bindir}}/safelink"]=1 + x["./{{bindir}}/spawn-pty"]=1 + x["./{{bindir}}/fdsend"]=1 + x["./{{bindir}}/fdrecv"]=1 + x["./{{bindir}}/fdrecvto"]=1 + x["./{{bindir}}/socketpair"]=1 + x["./{{bindir}}/ptsname"]=1 + x["./{{bindir}}/mtime_to_uuidv7"]=1 + x["./{{bindir}}/ucspi-socksserver"]=1 + x["./{{bindir}}/ucspi-socksserver-connected"]=1 + x["./{{bindir}}/ucspi-socksserver-access"]=1 {% endblock %} diff --git a/templates/pkg/certdata2pem b/templates/pkg/certdata2pem @@ -4,5 +4,5 @@ CFLAGS="-D_GNU_SOURCE" {% endblock %} {% block genlinks_begin %} - x["./command/certdata2pem"]=1 + x["./{{bindir}}/certdata2pem"]=1 {% endblock %} diff --git a/templates/pkg/confz b/templates/pkg/confz @@ -1,5 +1,5 @@ {%- set pkg_source="git" -%} {% extends "scriptsetup" %} {% block genlinks_begin %} - x["./command/confz"]=1 + x["./{{bindir}}/confz"]=1 {% endblock %} diff --git a/templates/pkg/containers b/templates/pkg/containers @@ -9,32 +9,32 @@ {% endblock %} {% block install -%} {{ super() -}} -mkdir "${dest}/data" -mv -v service_scripts container_template "${dest}/data/" -printf '%s\n' >"${dest}/zsh/site-functions/confz_containers_pthbs_init" \ - "typeset -g container_template_dir='$prefix/data/container_template'" \ - "typeset -g container_service_script_dir='$prefix/data/service_scripts'" \ +mkdir "${dest}/{{datadir}}" +mv -v service_scripts container_template "${dest}/{{datadir}}/" +printf '%s\n' >"${dest}/{{zshdir}}/site-functions/confz_containers_pthbs_init" \ + "typeset -g container_template_dir='$prefix/{{datadir}}/container_template'" \ + "typeset -g container_service_script_dir='$prefix/{{datadir}}/service_scripts'" \ "typeset -g container_ns_bin_dir='$prefix/deps/container-bin-image'" \ 'container_ns_bin_dir=${container_ns_bin_dir:P}' \ - "typeset -g container_alpine_keys_dir='$prefix/deps/keys/alpine/x86_64'" \ - "typeset -g container_apk_executable='$prefix/deps/command/apk.static'" \ - "typeset -g container_void_keys_dir='$prefix/deps/keys/void'" \ - "typeset -g container_xbps_install_executable='$prefix/deps/command/xbps-install.static'" + "typeset -g container_alpine_keys_dir='$prefix/deps/{{keysdir}}/alpine/x86_64'" \ + "typeset -g container_apk_executable='$prefix/deps/{{bindir}}/apk.static'" \ + "typeset -g container_void_keys_dir='$prefix/deps/{{keysdir}}/void'" \ + "typeset -g container_xbps_install_executable='$prefix/deps/{{bindir}}/xbps-install.static'" -mkdir -p "${dest}/deps/command" -ln -sf '{{pkg_install_dir("apk-tools")}}/command/apk.static' "${dest}/deps/command/" -ln -sf '{{pkg_install_dir("xbps")}}/command/xbps-install.static' "${dest}/deps/command/" +mkdir -p "${dest}/deps/{{bindir}}" +ln -sf '{{pkg_install_dir("apk-tools")}}/{{bindir}}/apk.static' "${dest}/deps/{{bindir}}/" +ln -sf '{{pkg_install_dir("xbps")}}/{{bindir}}/xbps-install.static' "${dest}/deps/{{bindir}}/" -for f in '{{pkg_install_dir("alpine-keys")}}'/keys/alpine/*/*; do +for f in '{{pkg_install_dir("alpine-keys")}}'/{{keysdir}}/alpine/*/*; do test -f "$f" d=$(basename "${f%/*}") - mkdir -p "${dest}/deps/keys/alpine/$d" - ln -sf "$f" "${dest}/deps/keys/alpine/$d/" + mkdir -p "${dest}/deps/{{keysdir}}/alpine/$d" + ln -sf "$f" "${dest}/deps/{{keysdir}}/alpine/$d/" done -mkdir -p "${dest}/deps/keys/void" -for f in '{{pkg_install_dir("xbps")}}'/keys/void/*; do - ln -sf "$f" "${dest}/deps/keys/void/" +mkdir -p "${dest}/deps/{{keysdir}}/void" +for f in '{{pkg_install_dir("xbps")}}'/{{keysdir}}/void/*; do + ln -sf "$f" "${dest}/deps/{{keysdir}}/void/" done test -d '{{pkg_install_dir("container-bin-image")}}/container-bin-image' @@ -43,10 +43,10 @@ ln -sf '{{pkg_install_dir("container-bin-image")}}/container-bin-image' "${dest} {% endblock %} {% block genlinks_begin %} - x["./command/container_sysroot_run"]=1 - x["./command/ns_run"]=1 - x["./command/ns_umount_script.awk"]=1 - x["./command/pidns_run.py"]=1 - x["./zsh/site-functions/confz_containers_init"]=1 - x["./zsh/site-functions/confz_site_containers_init"]=1 + x["./{{bindir}}/container_sysroot_run"]=1 + x["./{{bindir}}/ns_run"]=1 + x["./{{bindir}}/ns_umount_script.awk"]=1 + x["./{{bindir}}/pidns_run.py"]=1 + x["./{{zshdir}}/site-functions/confz_containers_init"]=1 + x["./{{zshdir}}/site-functions/confz_site_containers_init"]=1 {% endblock %} diff --git a/templates/pkg/curl b/templates/pkg/curl @@ -30,7 +30,7 @@ autotools_config_static \ {% endblock %} {% block install %} {{ super() -}} -rm -r -v "$pthbs_destdir"'{{versions}}'"/$pthbs_package/man" +rm -r -v "$pthbs_destdir"'{{versions}}'"/$pthbs_package/{{mandir}}" {% endblock %} {% block check -%} @@ -38,6 +38,6 @@ check_static command/curl {% endblock %} {% block genlinks_begin %} - x["./command/curl"]=1 - x["./library/libcurl.a"]=1 + x["./{{bindir}}/curl"]=1 + x["./{{libdir}}/libcurl.a"]=1 {% endblock %} diff --git a/templates/pkg/diffutils b/templates/pkg/diffutils @@ -8,6 +8,6 @@ check_static command/cmp {% endblock %} {% block genlinks_begin %} - x["./command/diff"]=1 - x["./man/man1/diff.1"]=1 + x["./{{bindir}}/diff"]=1 + x["./{{mandir}}/man1/diff.1"]=1 {% endblock %} diff --git a/templates/pkg/dune b/templates/pkg/dune @@ -19,13 +19,13 @@ sed -i 's/stdune.csexp/dune-configurator.csexp/' vendor/csexp/src/dune export DUNE_CACHE=disabled ./configure \ --prefix="$prefix" \ - --libdir="$prefix/library.ocaml" \ - --bindir="$prefix/command" \ - --sbindir="$prefix/command" \ - --etcdir="$prefix/config/etc" \ - --mandir="$prefix/man" \ - --docdir="$prefix/doc/{{shortname}}" \ - --datadir="$prefix/data" + --libdir="$prefix/{{ocamldir}}" \ + --bindir="$prefix/{{bindir}}" \ + --sbindir="$prefix/{{sbindir}}" \ + --etcdir="$prefix/{{configdir}}/etc" \ + --mandir="$prefix/{{mandir}}" \ + --docdir="$prefix/{{docdir}}/{{shortname}}" \ + --datadir="$prefix/{{datadir}}" {% endblock configure %} {%- block build %} @@ -49,7 +49,7 @@ check_dynamic command/dune {% endblock check%} {% block genlinks_begin %} - x["./command/dune"]=1 + x["./{{bindir}}/dune"]=1 {% endblock genlinks_begin %} {% block genlinks_rules %} $2 == "library.ocaml" { link($0); next } diff --git a/templates/pkg/easyseccomp b/templates/pkg/easyseccomp @@ -31,6 +31,6 @@ check_static command/easyseccomp {% endblock check%} {% block genlinks_begin %} - x["./command/seccomp-run"]=1 - x["./command/easyseccomp"]=1 + x["./{{bindir}}/seccomp-run"]=1 + x["./{{bindir}}/easyseccomp"]=1 {% endblock %} diff --git a/templates/pkg/error-standalone b/templates/pkg/error-standalone @@ -10,14 +10,14 @@ {% block build -%} {{make}} PREFIX={{versions}}/$pthbs_package \ DESTDIR="$pthbs_destdir" \ - INCDIR="$prefix/include" \ - LIBDIR="$prefix/library" \ + INCDIR="$prefix/{{includedir}}" \ + LIBDIR="$prefix/{{libdir}}" \ install-static {% endblock %} {% block install -%} {% endblock %} {% block genlinks_begin %} - x["./library/liberror.a"]=1 - x["./include/error.h"]=1 + x["./{{libdir}}/liberror.a"]=1 + x["./{{includedir}}/error.h"]=1 {% endblock %} diff --git a/templates/pkg/execline b/templates/pkg/execline @@ -2,12 +2,12 @@ {% extends "skaware" %} {% block install -%} {{ super() -}} -if ! test -e "${dest}/command/eltest"; then +if ! test -e "${dest}/{{bindir}}/eltest"; then # TODO - printf '%s\n' >"${dest}/command/eltest" \ - "#!$prefix/command/execlineb -S0" \ + printf '%s\n' >"${dest}/{{bindir}}/eltest" \ + "#!$prefix/{{bindir}}/execlineb -S0" \ 's6-test $@' - chmod +x "${dest}/command/eltest" + chmod +x "${dest}/{{bindir}}/eltest" fi {% endblock %} diff --git a/templates/pkg/execline:bootstrap b/templates/pkg/execline:bootstrap @@ -9,24 +9,24 @@ #+{{pkg_install_name("skalibs:bootstrap")}} {% endblock package_deps -%} {% block configure -%} -export CC="$pthbs_build_environment/command/{{triplet}}-gcc" -export CXX="$pthbs_build_environment/command/{{triplet}}-g++" -export LD="$pthbs_build_environment/command/{{triplet}}-ld" -export AR="$pthbs_build_environment/command/{{triplet}}-ar" +export CC="$pthbs_build_environment/{{bindir}}/{{triplet}}-gcc" +export CXX="$pthbs_build_environment/{{bindir}}/{{triplet}}-g++" +export LD="$pthbs_build_environment/{{bindir}}/{{triplet}}-ld" +export AR="$pthbs_build_environment/{{bindir}}/{{triplet}}-ar" export CFLAGS="-O2 -ggdb" ./configure \ --prefix="$prefix" \ --sysdepdir="${prefix}/sysdeps" \ - --binprefix="${prefix}/command" \ - --extbinprefix="${prefix}/command" \ - --dynlibdir="${prefix}/library.so" \ - --libdir="${prefix}/library" \ - --includedir="${prefix}/include" \ + --binprefix="${prefix}/{{bindir}}" \ + --extbinprefix="${prefix}/{{bindir}}" \ + --dynlibdir="${prefix}/{{dynlibdir}}" \ + --libdir="${prefix}/{{libdir}}" \ + --includedir="${prefix}/{{includedir}}" \ --with-sysdeps='{{pkg_install_dir("skalibs:bootstrap")}}/sysdeps' \ - --with-include="$pthbs_build_environment/include" \ - --with-lib="$pthbs_build_environment/library" \ - --with-dynlib="$pthbs_build_environment/library.so" \ + --with-include="$pthbs_build_environment/{{includedir}}" \ + --with-lib="$pthbs_build_environment/{{libdir}}" \ + --with-dynlib="$pthbs_build_environment/{{dynlibdir}}" \ --disable-shared --enable-static --enable-allstatic --enable-static-libc --absolute-paths {% endblock %} diff --git a/templates/pkg/fileset b/templates/pkg/fileset @@ -1,7 +1,7 @@ {%- set pkg_source="git" -%} {% extends "scriptsetup" %} {% block genlinks_begin %} - x["./command/fslist"]=1 - x["./command/fsapply"]=1 - x["./command/fileset"]=1 + x["./{{bindir}}/fslist"]=1 + x["./{{bindir}}/fsapply"]=1 + x["./{{bindir}}/fileset"]=1 {% endblock %} diff --git a/templates/pkg/findutils b/templates/pkg/findutils @@ -10,13 +10,13 @@ check_static command/xargs {% endblock %} {% block genlinks_begin %} - x["./command/find"]=1 - x["./command/xargs"]=1 - x["./command/locate"]=1 - x["./command/updatedb"]=1 - x["./man/man1/find.1"]=1 - x["./man/man1/xargs.1"]=1 - x["./man/man1/locate.1"]=1 - x["./man/man1/updatedb.1"]=1 - x["./man/man5/locatedb.5"]=1 + x["./{{bindir}}/find"]=1 + x["./{{bindir}}/xargs"]=1 + x["./{{bindir}}/locate"]=1 + x["./{{bindir}}/updatedb"]=1 + x["./{{mandir}}/man1/find.1"]=1 + x["./{{mandir}}/man1/xargs.1"]=1 + x["./{{mandir}}/man1/locate.1"]=1 + x["./{{mandir}}/man1/updatedb.1"]=1 + x["./{{mandir}}/man5/locatedb.5"]=1 {% endblock %} diff --git a/templates/pkg/flex b/templates/pkg/flex @@ -13,7 +13,7 @@ check_static command/flex++ {% endblock %} {% block genlinks_begin %} - x["./command/flex"]=1 - x["./command/flex++"]=1 - #x["./command/lex"]=1 + x["./{{bindir}}/flex"]=1 + x["./{{bindir}}/flex++"]=1 + #x["./{{bindir}}/lex"]=1 {% endblock %} diff --git a/templates/pkg/git b/templates/pkg/git @@ -12,18 +12,18 @@ {% endblock %} {% block build_and_install -%} {{make}} \ - LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so" \ - CPATH="$pthbs_build_environment/include" \ - LDFLAGS="-static --static -L$pthbs_build_environment/library" \ + LD_LIBRARY_PATH="$pthbs_build_environment/{{libdir}}:$pthbs_build_environment/{{dynlibdir}}" \ + CPATH="$pthbs_build_environment/{{includedir}}" \ + LDFLAGS="-static --static -L$pthbs_build_environment/{{libdir}}" \ CPPFLAGS="-D_GNU_SOURCE" \ NO_REGEX=NeedsStartEnd \ NO_TCLTK=1 NO_PYTHON=1 NO_EXPAT=1 NO_GETTEXT=1 \ DESTDIR="$pthbs_destdir" \ prefix="$prefix" \ gitexecdir="$prefix"/git-core \ - bindir="$prefix/command" \ - mandir="$prefix/man" \ - infodir="$prefix/info" \ + bindir="$prefix/{{bindir}}" \ + mandir="$prefix/{{mandir}}" \ + infodir="$prefix/{{infodir}}" \ sharedir="$prefix/share" \ gitwebdir="$prefix/gitweb" \ V=1 all install @@ -34,7 +34,7 @@ check_static command/git {% endblock %} {% block genlinks_begin %} - x["./command/git"]=1 - x["./command/git-upload-archive"]=1 - x["./command/git-receive-pack"]=1 + x["./{{bindir}}/git"]=1 + x["./{{bindir}}/git-upload-archive"]=1 + x["./{{bindir}}/git-receive-pack"]=1 {% endblock %} diff --git a/templates/pkg/gnu-make b/templates/pkg/gnu-make @@ -14,6 +14,6 @@ check_static command/make {% endblock %} {% block genlinks_begin %} - x["./command/make"]=1 - x["./man/man1/make.1"]=1 + x["./{{bindir}}/make"]=1 + x["./{{mandir}}/man1/make.1"]=1 {% endblock %} diff --git a/templates/pkg/gnu-make:bootstrap b/templates/pkg/gnu-make:bootstrap @@ -23,6 +23,6 @@ autotools_config --enable-static --disable-shared --disable-nls {% endblock %} {% block genlinks_begin %} - x["./command/make"]=1 - x["./man/man1/make.1"]=1 + x["./{{bindir}}/make"]=1 + x["./{{mandir}}/man1/make.1"]=1 {% endblock %} diff --git a/templates/pkg/gperf b/templates/pkg/gperf @@ -5,5 +5,5 @@ check_static command/gperf {% endblock %} {% block genlinks_begin %} - x["./command/gperf"]=1 + x["./{{bindir}}/gperf"]=1 {% endblock %} diff --git a/templates/pkg/kbd b/templates/pkg/kbd @@ -10,13 +10,13 @@ export LDFLAGS="--static" {% endblock %} {%- block configure_args -%} --disable-nls --disable-vlock --disable-werror --disable-tests \ - --datadir="$prefix/data" --datarootdir="$prefix/data" + --datadir="$prefix/{{datadir}}" --datarootdir="$prefix/{{datarootdir}}" {% endblock %} {% block check -%} check_static command/loadkeys {% endblock %} {% block genlinks_begin %} - x["./command/loadkeys"]=1 - x["./data/keymaps/i386/qwerty/cz.map.gz"]=1 - x["./data/keymaps/i386/qwerty/us.map.gz"]=1 + x["./{{bindir}}/loadkeys"]=1 + x["./{{datadir}}/keymaps/i386/qwerty/cz.map.gz"]=1 + x["./{{datadir}}/keymaps/i386/qwerty/us.map.gz"]=1 {% endblock %} diff --git a/templates/pkg/libarchive b/templates/pkg/libarchive @@ -12,7 +12,7 @@ check_static command/bsdcpio {% endblock %} {% block genlinks_begin %} - x["./command/bsdtar"]=1 - x["./command/bsdcpio"]=1 - x["./library/libarchive.a"]=1 + x["./{{bindir}}/bsdtar"]=1 + x["./{{bindir}}/bsdcpio"]=1 + x["./{{libdir}}/libarchive.a"]=1 {% endblock %} diff --git a/templates/pkg/libbsd b/templates/pkg/libbsd @@ -5,6 +5,6 @@ #+{{pkg_install_name("libmd")}} {% endblock %} {% block genlinks_begin %} - x["./library/libbsd.a"]=1 - x["./include/bsd/bsd.h"]=1 + x["./{{libdir}}/libbsd.a"]=1 + x["./{{includedir}}/bsd/bsd.h"]=1 {% endblock %} diff --git a/templates/pkg/libcap b/templates/pkg/libcap @@ -31,13 +31,13 @@ make -j1 \ lib_prefix="$prefix" \ inc_prefix="$prefix" \ man_prefix="$prefix/share" \ - MANDIR="$prefix/man" \ + MANDIR="$prefix/{{mandir}}" \ sbin=command \ - SBINDIR="$prefix/command" \ - INCDIR="$prefix/include" \ + SBINDIR="$prefix/{{bindir}}" \ + INCDIR="$prefix/{{includedir}}" \ lib=library \ - LIBDIR="$prefix/library" \ - PKGCONFIGDIR="$prefix/library/pkgconfig" \ + LIBDIR="$prefix/{{libdir}}" \ + PKGCONFIGDIR="$prefix/{{pkgconfigdir}}" \ CAPSH_SHELL="'-DSHELL=\"$(which sh)\"'" \ LDFLAGS="$LDFLAGS" \ all install @@ -50,9 +50,9 @@ check_static command/getpcaps {% endblock %} {% block genlinks_begin %} - x["./command/capsh"]=1 - x["./command/getcap"]=1 - x["./command/setcap"]=1 - x["./command/getpcaps"]=1 - x["./library/libcap.a"]=1 + x["./{{bindir}}/capsh"]=1 + x["./{{bindir}}/getcap"]=1 + x["./{{bindir}}/setcap"]=1 + x["./{{bindir}}/getpcaps"]=1 + x["./{{libdir}}/libcap.a"]=1 {% endblock %} diff --git a/templates/pkg/libcap:bootstrap b/templates/pkg/libcap:bootstrap @@ -14,9 +14,9 @@ sed -i "1 s|^#!/bin/bash|#!$(which sh)|" progs/*.sh {% endblock %} {% block configure -%} -export CC="$pthbs_build_environment/command/{{triplet}}-gcc" -export CPATH="$pthbs_build_environment/include" -export LIBRARY_PATH="$pthbs_build_environment/library" +export CC="$pthbs_build_environment/{{bindir}}/{{triplet}}-gcc" +export CPATH="$pthbs_build_environment/{{includedir}}" +export LIBRARY_PATH="$pthbs_build_environment/{{libdir}}" LDFLAGS=--static {% endblock %} @@ -33,23 +33,23 @@ make -j1 \ lib_prefix="$prefix" \ inc_prefix="$prefix" \ man_prefix="$prefix/share" \ - MANDIR="$prefix/man" \ + MANDIR="$prefix/{{mandir}}" \ sbin=command \ - SBINDIR="$prefix/command" \ - INCDIR="$prefix/include" \ + SBINDIR="$prefix/{{sbindir}}" \ + INCDIR="$prefix/{{includedir}}" \ lib=library \ - LIBDIR="$prefix/library" \ - PKGCONFIGDIR="$prefix/library/pkgconfig" \ + LIBDIR="$prefix/{{libdir}}" \ + PKGCONFIGDIR="$prefix/{{pkgconfigdir}}" \ CAPSH_SHELL="'-DSHELL=\"$(which sh)\"'" \ LDFLAGS="$LDFLAGS" \ all install {% endblock %} {% block genlinks_begin %} - x["./command/capsh"]=1 - x["./command/getcap"]=1 - x["./command/setcap"]=1 - x["./command/getpcaps"]=1 - x["./library/libcap.a"]=1 + x["./{{bindir}}/capsh"]=1 + x["./{{bindir}}/getcap"]=1 + x["./{{bindir}}/setcap"]=1 + x["./{{bindir}}/getpcaps"]=1 + x["./{{libdir}}/libcap.a"]=1 {% endblock %} diff --git a/templates/pkg/libcgroup b/templates/pkg/libcgroup @@ -24,6 +24,6 @@ check_static command/cgconfigparser {% endblock %} {% block genlinks_begin %} - x["./command/cgconfigparser"]=1 - x["./man/man8/cgconfigparser.8"]=1 + x["./{{bindir}}/cgconfigparser"]=1 + x["./{{mandir}}/man8/cgconfigparser.8"]=1 {% endblock %} diff --git a/templates/pkg/libelf b/templates/pkg/libelf @@ -11,16 +11,16 @@ build_env_static {{make}} PREFIX="$prefix" \ DESTDIR="$pthbs_destdir" \ - INCDIR="$prefix/include" \ - LIBDIR="$prefix/library" \ + INCDIR="$prefix/{{includedir}}" \ + LIBDIR="$prefix/{{libdir}}" \ install-static -mkdir -p "${dest}/library/pkgconfig" -printf '%s\n' > "${dest}/library/pkgconfig/libelf.pc" \ +mkdir -p "${dest}/{{pkgconfigdir}}" +printf '%s\n' > "${dest}/{{pkgconfigdir}}/libelf.pc" \ "prefix={{versions}}/$pthbs_package" \ 'exec_prefix=${prefix}' \ - 'includedir=${prefix}/include' \ - 'libdir=${exec_prefix}/library' \ + 'includedir=${prefix}/{{includedir}}' \ + 'libdir=${exec_prefix}/{{libdir}}' \ '' \ 'Name: libelf' \ 'Description: standalone libelf' \ @@ -32,9 +32,9 @@ printf '%s\n' > "${dest}/library/pkgconfig/libelf.pc" \ {% endblock %} {% block genlinks_begin %} - x["./library/libelf.a"]=1 - x["./library/pkgconfig/libelf.pc"]=1 - x["./include/libelf.h"]=1 - x["./include/gelf.h"]=1 - x["./include/nlist.h"]=1 + x["./{{libdir}}/libelf.a"]=1 + x["./{{pkgconfigdir}}/libelf.pc"]=1 + x["./{{includedir}}/libelf.h"]=1 + x["./{{includedir}}/gelf.h"]=1 + x["./{{includedir}}/nlist.h"]=1 {% endblock %} diff --git a/templates/pkg/libmd b/templates/pkg/libmd @@ -2,7 +2,7 @@ {%- set pkg_source="tar.xz" -%} {% extends "autotools_static" %} {% block genlinks_begin %} - x["./library/libmd.a"]=1 - x["./include/rmd160.h"]=1 - x["./include/sha512.h"]=1 + x["./{{libdir}}/libmd.a"]=1 + x["./{{includedir}}/rmd160.h"]=1 + x["./{{includedir}}/sha512.h"]=1 {% endblock %} diff --git a/templates/pkg/libressl b/templates/pkg/libressl @@ -9,25 +9,25 @@ export LDFLAGS="--static" {{ super() -}} {% endblock %} -{% block configure_args %}--with-openssldir="$prefix/config/ssl"{% endblock %} +{% block configure_args %}--with-openssldir="$prefix/{{ssldir}}"{% endblock %} {% block build_and_install -%} {{ super() -}} cd .. -gcc ./c_rehash.c -o c_rehash --static -static -I"$pthbs_destdir/$prefix/include" -L"$pthbs_destdir/$prefix/library" -lssl -lcrypto -cp -vs '{{pkg_install_dir("ca-certificates-wip-donotuse")}}/config/ssl/certs'/*.crt "$pthbs_destdir/$prefix/config/ssl/certs/" -./c_rehash "$pthbs_destdir/$prefix/config/ssl/certs/" -cd "$pthbs_destdir/$prefix/config/ssl/" +gcc ./c_rehash.c -o c_rehash --static -static -I"$pthbs_destdir/$prefix/{{includedir}}" -L"$pthbs_destdir/$prefix/{{libdir}}" -lssl -lcrypto +cp -vs '{{pkg_install_dir("ca-certificates-wip-donotuse")}}/{{ssldir}}/certs'/*.crt "$pthbs_destdir/$prefix/{{ssldir}}/certs/" +./c_rehash "$pthbs_destdir/$prefix/{{ssldir}}/certs/" +cd "$pthbs_destdir/$prefix/{{ssldir}}/" mv cert.pem libressl-cert.pem cp -a certs/ca-certificates.crt cert.pem cd "$pthbs_destdir/$prefix/" mkdir -p env # for s6-networking -printf >env/CADIR '%s\n' "$prefix/config/ssl/certs" +printf >env/CADIR '%s\n' "$prefix/{{ssldir}}/certs" # for curl -printf >env/SSL_CERT_DIR '%s\n' "$prefix/config/ssl/certs" +printf >env/SSL_CERT_DIR '%s\n' "$prefix/{{ssldir}}/certs" # for git -printf >env/GIT_SSL_CAPATH '%s\n' "$prefix/config/ssl/certs" +printf >env/GIT_SSL_CAPATH '%s\n' "$prefix/{{ssldir}}/certs" {% endblock %} {% block check -%} @@ -35,12 +35,12 @@ check_static command/openssl check_static command/ocspcheck {% endblock %} {% block genlinks_begin %} - x["./command/openssl"]=1 - x["./command/ocspcheck"]=1 - x["./man/man1/openssl.1"]=1 - x["./library/libssl.a"]=1 - x["./include/tls.h"]=1 - x["./config/ssl/certs/0b9bc432.0"]=1 # ISRG_Root_X2.crt - x["./config/ssl/certs/4042bcee.0"]=1 # ISRG_Root_X1.crt - x["./config/ssl/cert.pem"]=1 # merged bundle + x["./{{bindir}}/openssl"]=1 + x["./{{bindir}}/ocspcheck"]=1 + x["./{{mandir}}/man1/openssl.1"]=1 + x["./{{libdir}}/libssl.a"]=1 + x["./{{includedir}}/tls.h"]=1 + x["./{{ssldir}}/certs/0b9bc432.0"]=1 # ISRG_Root_X2.crt + x["./{{ssldir}}/certs/4042bcee.0"]=1 # ISRG_Root_X1.crt + x["./{{ssldir}}/cert.pem"]=1 # merged bundle {% endblock %} diff --git a/templates/pkg/libretls b/templates/pkg/libretls @@ -7,9 +7,9 @@ export LDFLAGS="--static" {{ super() -}} {% endblock %} {% block genlinks_begin %} - x["./man/man3/tls_connect.3"]=1 - x["./library/libtls.a"]=1 - x["./library/pkgconfig/libtls.pc"]=1 - x["./include/tls.h"]=1 + x["./{{mandir}}/man3/tls_connect.3"]=1 + x["./{{libdir}}/libtls.a"]=1 + x["./{{pkgconfigdir}}/libtls.pc"]=1 + x["./{{includedir}}/tls.h"]=1 {% endblock %} diff --git a/templates/pkg/libseccomp b/templates/pkg/libseccomp @@ -14,7 +14,7 @@ check_static command/scmp_sys_resolver {% endblock %} {% block genlinks_begin %} - x["./command/scmp_sys_resolver"]=1 - x["./library/libseccomp.a"]=1 + x["./{{bindir}}/scmp_sys_resolver"]=1 + x["./{{libdir}}/libseccomp.a"]=1 {% endblock %} diff --git a/templates/pkg/libunwind b/templates/pkg/libunwind @@ -9,7 +9,7 @@ --enable-zlib {% endblock %} {% block genlinks_begin %} - x["./include/libunwind.h"]=1 - x["./include/unwind.h"]=1 - x["./library/libunwind.a"]=1 + x["./{{includedir}}/libunwind.h"]=1 + x["./{{includedir}}/unwind.h"]=1 + x["./{{libdir}}/libunwind.a"]=1 {% endblock %} diff --git a/templates/pkg/lnstools:bootstrap b/templates/pkg/lnstools:bootstrap @@ -11,21 +11,21 @@ #+{{pkg_install_name("libcap:bootstrap")}} {% endblock package_deps -%} {% block configure -%} -export CC="$pthbs_build_environment/command/{{triplet}}-gcc" -export CPATH="$pthbs_build_environment/include" -export LIBRARY_PATH="$pthbs_build_environment/library" -export LDFLAGS="-L$pthbs_build_environment/library" +export CC="$pthbs_build_environment/{{bindir}}/{{triplet}}-gcc" +export CPATH="$pthbs_build_environment/{{includedir}}" +export LIBRARY_PATH="$pthbs_build_environment/{{libdir}}" +export LDFLAGS="-L$pthbs_build_environment/{{libdir}}" sh ./configure --enable-absolute-paths \ --prefix="$prefix" \ - --bindir="${prefix}/command" \ - --includedir="${prefix}/include" \ - --libdir="${prefix}/library" \ - --dynlibdir="${prefix}/library.so" + --bindir="${prefix}/{{bindir}}" \ + --includedir="${prefix}/{{includedir}}" \ + --libdir="${prefix}/{{libdir}}" \ + --dynlibdir="${prefix}/{{dynlibdir}}" {% endblock configure -%} {% block genlinks_begin %} - x["./command/lns-lockdown"]=1 - x["./command/lns-envuidgid"]=1 - x["./command/lns-applyuidgid"]=1 - x["./command/lns-pidns"]=1 + x["./{{bindir}}/lns-lockdown"]=1 + x["./{{bindir}}/lns-envuidgid"]=1 + x["./{{bindir}}/lns-applyuidgid"]=1 + x["./{{bindir}}/lns-pidns"]=1 {% endblock %} diff --git a/templates/pkg/logincaps b/templates/pkg/logincaps @@ -11,15 +11,15 @@ pthbs-banginstall etc/loginexec "${dest}" -cat >"${dest}/command/login-keepenv" <<EOF +cat >"${dest}/{{bindir}}/login-keepenv" <<EOF #!$(which execlineb) -S0 -$prefix/command/login -p \$@ +$prefix/{{bindir}}/login -p \$@ EOF -chmod +x "${dest}/command/login-keepenv" +chmod +x "${dest}/{{bindir}}/login-keepenv" cd login -sh build_static.sh -DLOGINEXEC_PATH="\"$prefix/command/loginexec\"" -cp -a login "${dest}/command/" +sh build_static.sh -DLOGINEXEC_PATH="\"$prefix/{{bindir}}/loginexec\"" +cp -a login "${dest}/{{bindir}}/" {% endblock %} {% block check -%} @@ -27,10 +27,10 @@ check_static command/login {% endblock %} {% block genlinks_begin %} - x["./command/check-root-password.py"]=1 - x["./command/login"]=1 - x["./command/login-keepenv"]=1 - x["./command/login.capability.brightness"]=1 - x["./command/login.capability.service"]=1 - x["./command/logincaps"]=1 + x["./{{bindir}}/check-root-password.py"]=1 + x["./{{bindir}}/login"]=1 + x["./{{bindir}}/login-keepenv"]=1 + x["./{{bindir}}/login.capability.brightness"]=1 + x["./{{bindir}}/login.capability.service"]=1 + x["./{{bindir}}/logincaps"]=1 {% endblock %} diff --git a/templates/pkg/m4 b/templates/pkg/m4 @@ -17,5 +17,5 @@ check_static command/m4 {% endblock %} {% block genlinks_begin %} - x["./command/m4"]=1 + x["./{{bindir}}/m4"]=1 {% endblock %} diff --git a/templates/pkg/mandoc b/templates/pkg/mandoc @@ -8,20 +8,20 @@ #+{{pkg_install_name("busybox-diffutils")}} {% endblock package_deps %} {% block configure -%} -export LD_LIBRARY_PATH="$pthbs_build_environment/library" +export LD_LIBRARY_PATH="$pthbs_build_environment/{{libdir}}" cat >configure.local<<-__EOF__ PREFIX="$prefix" -BINDIR="$prefix/command" -SBINDIR="$prefix/command" +BINDIR="$prefix/{{bindir}}" +SBINDIR="$prefix/{{sbindir}}" BIN_FROM_SBIN=. -MANDIR="$prefix/man" -LIBDIR="$prefix/library" -INCLUDEDIR="$prefix/include" -CFLAGS="-I $pthbs_build_environment/include" -LDFLAGS="-static -L$pthbs_build_environment/library" +MANDIR="$prefix/{{mandir}}" +LIBDIR="$prefix/{{libdir}}" +INCLUDEDIR="$prefix/{{includedir}}" +CFLAGS="-I $pthbs_build_environment/{{includedir}}" +LDFLAGS="-static -L$pthbs_build_environment/{{libdir}}" UTF8_LOCALE="en_US.UTF-8" -MANPATH_DEFAULT=/run/current/man -MANPATH_BASE=/run/current/man +MANPATH_DEFAULT=/run/current/{{mandir}} +MANPATH_BASE=/run/current/{{mandir}} LN="ln -sf" __EOF__ @@ -42,11 +42,11 @@ check_static command/whatis check_static command/makewhatis {% endblock check %} {% block genlinks_begin %} - x["./command/man"]=1 - x["./command/apropos"]=1 - x["./command/whatis"]=1 - x["./command/makewhatis"]=1 - x["./library/libmandoc.a"]=1 - x["./man/man1/man.1"]=1 - x["./man/man3/mandoc.3"]=1 + x["./{{bindir}}/man"]=1 + x["./{{bindir}}/apropos"]=1 + x["./{{bindir}}/whatis"]=1 + x["./{{bindir}}/makewhatis"]=1 + x["./{{libdir}}/libmandoc.a"]=1 + x["./{{mandir}}/man1/man.1"]=1 + x["./{{mandir}}/man3/mandoc.3"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/mlog b/templates/pkg/mlog @@ -12,8 +12,8 @@ make "$name" {% endblock %} {% block install -%} -install -d "$pthbs_destdir/$prefix/command" -install -m 755 "$name" "$pthbs_destdir/$prefix/command" +install -d "$pthbs_destdir/$prefix/{{bindir}}" +install -m 755 "$name" "$pthbs_destdir/$prefix/{{bindir}}" {% endblock %} {% block check -%} @@ -21,6 +21,6 @@ check_static "command/$name" {% endblock %} {% block genlinks_begin %} - x["./command/mlog"]=1 + x["./{{bindir}}/mlog"]=1 {% endblock %} diff --git a/templates/pkg/musl-cross-make b/templates/pkg/musl-cross-make @@ -29,13 +29,13 @@ pkgs="gmp intl mpc mpfr zlib" for pkg in $pkgs; do make -C musl-cross-make/build/local/x86_64-linux-musl/obj_gcc/$pkg prefix=/ DESTDIR="$dest" install done -cp -va musl-cross-make/gcc-*.orig/zlib/zconf.h musl-cross-make/gcc-*.orig/zlib/zlib.h "$dest/include/" -mkdir -p "$dest/library/pkgconfig" -printf '%s\n' > "$dest/library/pkgconfig/zlib.pc" \ +cp -va musl-cross-make/gcc-*.orig/zlib/zconf.h musl-cross-make/gcc-*.orig/zlib/zlib.h "$dest/{{includedir}}/" +mkdir -p "$dest/{{pkgconfigdir}}" +printf '%s\n' > "$dest/{{pkgconfigdir}}/zlib.pc" \ "prefix={{versions}}/$pthbs_package" \ 'exec_prefix=${prefix}' \ - 'includedir=${prefix}/include' \ - 'libdir=${exec_prefix}/library' \ + 'includedir=${prefix}/{{includedir}}' \ + 'libdir=${exec_prefix}/{{libdir}}' \ '' \ 'Name: zlib' \ 'Description: zlib compression library' \ @@ -48,7 +48,7 @@ printf '%s\n' > "$dest/library/pkgconfig/zlib.pc" \ {% endblock %} {% block check -%} # validate zlib -"$dest"'/bin/{{triplet}}-gcc' -I"$dest/include" -L"$dest/lib" -static -o zpipe zpipe.c -lz +"$dest"'/bin/{{triplet}}-gcc' -I"$dest/{{includedir}}" -L"$dest/lib" -static -o zpipe zpipe.c -lz ./zpipe <true.c >true.c.gz ./zpipe -d <true.c.gz >true.c.2 cmp -s true.c true.c.2 @@ -61,12 +61,12 @@ cmp -s true.c true.c.2 x["./lib/libmpfr.a"]=1 x["./lib/libz.a"]=1 - x["./include/gmp.h"]=1 - x["./include/mpc.h"]=1 - x["./include/mpf2mpfr.h"]=1 - x["./include/mpfr.h"]=1 - x["./include/zlib.h"]=1 - x["./include/zconf.h"]=1 + x["./{{includedir}}/gmp.h"]=1 + x["./{{includedir}}/mpc.h"]=1 + x["./{{includedir}}/mpf2mpfr.h"]=1 + x["./{{includedir}}/mpfr.h"]=1 + x["./{{includedir}}/zlib.h"]=1 + x["./{{includedir}}/zconf.h"]=1 - x["./{{triplet}}/include/linux/landlock.h"]=1 + x["./{{triplet}}/{{includedir}}/linux/landlock.h"]=1 {% endblock %} diff --git a/templates/pkg/musl-fts b/templates/pkg/musl-fts @@ -23,14 +23,14 @@ ranlib libfts.a {% endblock build %} {%- block install -%} -mkdir -p "$dest/include" "$dest/library" "$dest/man/man3" -mv libfts.a "$dest/library/" -mv fts.h "$dest/include/" -mv fts.3 "$dest/man/man3" +mkdir -p "$dest/{{includedir}}" "$dest/{{libdir}}" "$dest/{{mandir}}/man3" +mv libfts.a "$dest/{{libdir}}/" +mv fts.h "$dest/{{includedir}}/" +mv fts.3 "$dest/{{mandir}}/man3" {% endblock install %} {% block genlinks_begin %} - x["./library/libfts.a"]=1 - x["./include/fts.h"]=1 - x["./man/man3/fts.3"]=1 + x["./{{libdir}}/libfts.a"]=1 + x["./{{includedir}}/fts.h"]=1 + x["./{{mandir}}/man3/fts.3"]=1 {% endblock %} diff --git a/templates/pkg/nawk b/templates/pkg/nawk @@ -9,11 +9,11 @@ #@untar:-z:sha256:e031b1e1d2b230f276f975bffb923f0ea15f798c839d15a3f26a1a39448e32d7:. {% endblock %} {%- block install -%} -install -Dm755 a.out "${dest}"/command/awk -install -Dm644 awk.1 "${dest}"/man/man1/awk.1 -install -Dm644 LICENSE FIXES FIXES.1e README.md TODO -t "${dest}"/doc/ +install -Dm755 a.out "${dest}"/{{bindir}}/awk +install -Dm644 awk.1 "${dest}"/{{mandir}}/man1/awk.1 +install -Dm644 LICENSE FIXES FIXES.1e README.md TODO -t "${dest}"/{{docdir}}/ {% endblock %} {%- block genlinks_begin -%} - x["./command/awk"]=1 - x["./man/man1/awk.1"]=1 + x["./{{bindir}}/awk"]=1 + x["./{{mandir}}/man1/awk.1"]=1 {% endblock %} diff --git a/templates/pkg/netbsd-curses b/templates/pkg/netbsd-curses @@ -5,20 +5,20 @@ #+{{pkg_install_name("musl-cross-make")}} {% endblock %} {% block configure -%} -export CFLAGS="-L$pthbs_build_environment/library -L$pthbs_build_environment/library.so" -export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" -export LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so" -export CPATH="$pthbs_build_environment/include" +export CFLAGS="-L$pthbs_build_environment/{{libdir}} -L$pthbs_build_environment/{{dynlibdir}}" +export LDFLAGS="-static -L$pthbs_build_environment/{{libdir}} $LDFLAGS" +export LD_LIBRARY_PATH="$pthbs_build_environment/{{libdir}}:$pthbs_build_environment/{{dynlibdir}}" +export CPATH="$pthbs_build_environment/{{includedir}}" {% endblock %} {% block install -%} cat << EOF > config.mak PREFIX=$prefix PREFIX="$prefix" -BINDIR="$prefix/command" -INCDIR="$prefix/include" -LIBDIR="$prefix/library" -MANDIR="$prefix/man" +BINDIR="$prefix/{{bindir}}" +INCDIR="$prefix/{{includedir}}" +LIBDIR="$prefix/{{libdir}}" +MANDIR="$prefix/{{mandir}}" DESTDIR="$pthbs_destdir" EOF @@ -26,5 +26,5 @@ EOF make install-static {% endblock %} {% block genlinks_begin %} - x["./library/libncurses.a"]=1 + x["./{{libdir}}/libncurses.a"]=1 {% endblock %} diff --git a/templates/pkg/ocaml b/templates/pkg/ocaml @@ -2,14 +2,14 @@ {% do skip("static compiler unused as some libraries require dynload") %} {%- set pkg_source="tar.xz" -%} {% extends "autotools_static" %} -{% do setitem(env_template, "OCAMLPATH", "@ENVROOT@/library.ocaml") %} -{%- block configure_args %}--enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs --libdir="$prefix/library.ocaml"{% endblock %} +{% do setitem(env_template, "OCAMLPATH", "@ENVROOT@/"~ocamldir) %} +{%- block configure_args %}--enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs --libdir="$prefix/{{ocamldir}}"{% endblock %} {% block check -%} check_static command/ocamlopt {% endblock check %} {% block genlinks_begin %} - x["./command/ocamlopt"]=1 + x["./{{bindir}}/ocamlopt"]=1 {% endblock genlinks_begin %} {% block genlinks_rules %} $2 == "library.ocaml" { link($0); next } diff --git a/templates/pkg/ocaml-base b/templates/pkg/ocaml-base @@ -11,7 +11,7 @@ sed -i 's/(bash /(run sh -c /' src/dune {% endblock prepare %} {% block genlinks_begin %} - x["./library.ocaml/base/base.ml"]=1 - x["./library.ocaml/base/base.cma"]=1 - x["./library.ocaml/base/base.cmi"]=1 + x["./{{ocamldir}}/base/base.ml"]=1 + x["./{{ocamldir}}/base/base.cma"]=1 + x["./{{ocamldir}}/base/base.cmi"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/ocaml-compiler-libs b/templates/pkg/ocaml-compiler-libs @@ -5,8 +5,8 @@ #@untar:-z:{{downloads["https://github.com/janestreet/"~upstream_name~"/archive/refs/tags/v"~pkg_version~".tar.gz"]}}:. {% endblock package_deps %} {% block genlinks_begin %} - x["./library.ocaml/{{upstream_name}}/META"]=1 - x["./library.ocaml/{{upstream_name}}/common/ocaml_common.a"]=1 - x["./library.ocaml/{{upstream_name}}/common/ocaml_common.cma"]=1 - x["./library.ocaml/{{upstream_name}}/common/ocaml_common.ml"]=1 + x["./{{ocamldir}}/{{upstream_name}}/META"]=1 + x["./{{ocamldir}}/{{upstream_name}}/common/ocaml_common.a"]=1 + x["./{{ocamldir}}/{{upstream_name}}/common/ocaml_common.cma"]=1 + x["./{{ocamldir}}/{{upstream_name}}/common/ocaml_common.ml"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/ocaml-findlib b/templates/pkg/ocaml-findlib @@ -15,10 +15,10 @@ {%- block configure %} ./configure -h || true ./configure \ - -bindir "$prefix/command" \ - -mandir "$prefix/man" \ - -sitelib "$prefix/library.ocaml" \ - -config "$prefix/config/etc/findlib.conf" \ + -bindir "$prefix/{{bindir}}" \ + -mandir "$prefix/{{mandir}}" \ + -sitelib "$prefix/{{ocamldir}}" \ + -config "$prefix/{{configdir}}/etc/findlib.conf" \ -no-camlp4 {% endblock configure %} @@ -39,20 +39,20 @@ check_dynamic command/ocamlfind {% endblock check %} {% block genlinks_begin %} - x["./command/ocamlfind"]=1 - x["./library.ocaml/findlib/topfind.mli"]=1 - x["./library.ocaml/findlib/topfind.cmi"]=1 - x["./library.ocaml/findlib/META"]=1 - x["./library.ocaml/topfind"]=1 - # x["./library.ocaml/bigarray/META"]=1 - x["./library.ocaml/bytes/META"]=1 - # x["./library.ocaml/compiler-libs/META"]=1 - # x["./library.ocaml/dynlink/META"]=1 - # x["./library.ocaml/ocamldoc/META"]=1 - # x["./library.ocaml/stdlib/META"]=1 - # x["./library.ocaml/str/META"]=1 - # x["./library.ocaml/threads/META"]=1 - # x["./library.ocaml/unix/META"]=1 + x["./{{bindir}}/ocamlfind"]=1 + x["./{{ocamldir}}/findlib/topfind.mli"]=1 + x["./{{ocamldir}}/findlib/topfind.cmi"]=1 + x["./{{ocamldir}}/findlib/META"]=1 + x["./{{ocamldir}}/topfind"]=1 + # x["./{{ocamldir}}/bigarray/META"]=1 + x["./{{ocamldir}}/bytes/META"]=1 + # x["./{{ocamldir}}/compiler-libs/META"]=1 + # x["./{{ocamldir}}/dynlink/META"]=1 + # x["./{{ocamldir}}/ocamldoc/META"]=1 + # x["./{{ocamldir}}/stdlib/META"]=1 + # x["./{{ocamldir}}/str/META"]=1 + # x["./{{ocamldir}}/threads/META"]=1 + # x["./{{ocamldir}}/unix/META"]=1 {% endblock %} {% block genlinks_rules %} $2 == "library.ocaml" { link($0); next } diff --git a/templates/pkg/ocaml-ppxlib b/templates/pkg/ocaml-ppxlib @@ -13,11 +13,11 @@ {% block dune_install_args %}-p {{upstream_name}}{% endblock %} {% block check %}{% endblock %} {% block genlinks_begin %} - x["./library.ocaml/{{upstream_name}}/META"]=1 - x["./library.ocaml/{{upstream_name}}/{{upstream_name}}.a"]=1 - x["./library.ocaml/{{upstream_name}}/{{upstream_name}}.cma"]=1 - x["./library.ocaml/{{upstream_name}}/{{upstream_name}}.cmi"]=1 - x["./library.ocaml/{{upstream_name}}/{{upstream_name}}.cmx"]=1 - x["./library.ocaml/{{upstream_name}}/{{upstream_name}}.cmxa"]=1 - x["./library.ocaml/{{upstream_name}}/{{upstream_name}}.ml"]=1 + x["./{{ocamldir}}/{{upstream_name}}/META"]=1 + x["./{{ocamldir}}/{{upstream_name}}/{{upstream_name}}.a"]=1 + x["./{{ocamldir}}/{{upstream_name}}/{{upstream_name}}.cma"]=1 + x["./{{ocamldir}}/{{upstream_name}}/{{upstream_name}}.cmi"]=1 + x["./{{ocamldir}}/{{upstream_name}}/{{upstream_name}}.cmx"]=1 + x["./{{ocamldir}}/{{upstream_name}}/{{upstream_name}}.cmxa"]=1 + x["./{{ocamldir}}/{{upstream_name}}/{{upstream_name}}.ml"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/ocaml-sexplib0 b/templates/pkg/ocaml-sexplib0 @@ -3,8 +3,8 @@ {%- set pkg_source="tar.gz" -%} {% extends "dune" %} {% block genlinks_begin %} - x["./library.ocaml/sexplib0/sexplib0.a"]=1 - x["./library.ocaml/sexplib0/sexplib0.ml"]=1 - x["./library.ocaml/sexplib0/sexplib0.cma"]=1 - x["./library.ocaml/sexplib0/sexplib0.cmi"]=1 + x["./{{ocamldir}}/sexplib0/sexplib0.a"]=1 + x["./{{ocamldir}}/sexplib0/sexplib0.ml"]=1 + x["./{{ocamldir}}/sexplib0/sexplib0.cma"]=1 + x["./{{ocamldir}}/sexplib0/sexplib0.cmi"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/ocaml-stdlib-shims b/templates/pkg/ocaml-stdlib-shims @@ -6,7 +6,7 @@ #@untar:-j:{{downloads["https://github.com/ocaml/"~upstream_name~"/releases/download/"~pkg_version~"/"~upstream_name~"-"~pkg_version~".tbz"]}}:. {% endblock package_deps %} {% block genlinks_begin %} - x["./library.ocaml/{{upstream_name}}/META"]=1 - x["./library.ocaml/{{upstream_name}}/stdlib_shims.cma"]=1 - x["./library.ocaml/{{upstream_name}}/stdlib_shims.cmxa"]=1 + x["./{{ocamldir}}/{{upstream_name}}/META"]=1 + x["./{{ocamldir}}/{{upstream_name}}/stdlib_shims.cma"]=1 + x["./{{ocamldir}}/{{upstream_name}}/stdlib_shims.cmxa"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/ocaml:dynlink b/templates/pkg/ocaml:dynlink @@ -2,14 +2,14 @@ {%- set pkg_source="tar.xz" -%} {% extends "autotools" %} {%- do import_functions.update(["build_env_dynamic"]) %} -{% do setitem(env_template, "OCAMLPATH", "@ENVROOT@/library.ocaml") %} +{% do setitem(env_template, "OCAMLPATH", "@ENVROOT@/"~ocamldir) %} {%- block configure %} build_env_dynamic -autotools_config --enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs --libdir="$prefix/library.ocaml" +autotools_config --enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs --libdir="$prefix/{{ocamldir}}" {% endblock configure %} {% block genlinks_begin %} - x["./command/ocamlopt"]=1 + x["./{{bindir}}/ocamlopt"]=1 {% endblock %} {% block genlinks_rules %} $2 == "library.ocaml" { link($0); next } diff --git a/templates/pkg/ocaml_intrinsics_kernel b/templates/pkg/ocaml_intrinsics_kernel @@ -16,13 +16,13 @@ dune install \ --destdir="$pthbs_destdir" \ --prefix="$prefix" \ - --libdir="$prefix/library.ocaml" \ - --bindir="$prefix/command" \ - --sbindir="$prefix/command" \ - --etcdir="$prefix/config/etc" \ - --mandir="$prefix/man" \ - --docdir="$prefix/doc/{{shortname}}" \ - --datadir="$prefix/data" \ + --libdir="$prefix/{{ocamldir}}" \ + --bindir="$prefix/{{bindir}}" \ + --sbindir="$prefix/{{sbindir}}" \ + --etcdir="$prefix/{{configdir}}/etc" \ + --mandir="$prefix/{{mandir}}" \ + --docdir="$prefix/{{docdir}}/{{shortname}}" \ + --datadir="$prefix/{{datadir}}" \ {% endblock %} {% block check -%} @@ -30,7 +30,7 @@ dune runtest --build-dir=.testenv --verbose {% endblock %} {% block genlinks_begin %} - x["./library.ocaml/ocaml_intrinsics_kernel/ocaml_intrinsics_kernel.ml"]=1 + x["./{{ocamldir}}/ocaml_intrinsics_kernel/ocaml_intrinsics_kernel.ml"]=1 {% endblock %} {% block genlinks_rules %} $2 == "library.ocaml" { link($0); next } diff --git a/templates/pkg/ocamlbuild b/templates/pkg/ocamlbuild @@ -13,8 +13,8 @@ make configure \ PREFIX="$prefix" \ OCAML_NATIVE=true \ - OCAMLBUILD_BINDIR="$prefix/command" \ - OCAMLBUILD_LIBDIR="$prefix/library.ocaml" + OCAMLBUILD_BINDIR="$prefix/{{bindir}}" \ + OCAMLBUILD_LIBDIR="$prefix/{{ocamldir}}" {% endblock configure %} {% block install -%} @@ -30,8 +30,8 @@ check_dynamic command/ocamlbuild {% endblock check %} {% block genlinks_begin %} - x["./command/ocamlbuild"]=1 - x["./man/man1/ocamlbuild.1"]=1 + x["./{{bindir}}/ocamlbuild"]=1 + x["./{{mandir}}/man1/ocamlbuild.1"]=1 {% endblock genlinks_begin %} {% block genlinks_rules %} $2 == "library.ocaml" { link($0); next } diff --git a/templates/pkg/opam b/templates/pkg/opam @@ -16,17 +16,17 @@ export DUNE_CACHE=disabled ./configure \ --prefix="$prefix" \ - --libdir="$prefix/library.ocaml" \ - --bindir="$prefix/command" \ - --sbindir="$prefix/command" \ - --mandir="$prefix/man" \ - --docdir="$prefix/doc/{{shortname}}" \ - --datadir="$prefix/data" \ - --datarootdir="$prefix/data" \ - --infodir="$prefix/info" \ - --localedir="$prefix/locale" \ + --libdir="$prefix/{{ocamldir}}" \ + --bindir="$prefix/{{bindir}}" \ + --sbindir="$prefix/{{sbindir}}" \ + --mandir="$prefix/{{mandir}}" \ + --docdir="$prefix/{{docdir}}/{{shortname}}" \ + --datadir="$prefix/{{datadir}}" \ + --datarootdir="$prefix/{{datarootdir}}" \ + --infodir="$prefix/{{infodir}}" \ + --localedir="$prefix/{{localedir}}" \ --localstatedir='{{var_dir}}' \ - --with-dune='{{pkg_install_dir("dune")}}/command/dune' \ + --with-dune='{{pkg_install_dir("dune")}}/{{bindir}}/dune' \ --with-mccs \ --with-vendored-deps \ --enable-static diff --git a/templates/pkg/openssl b/templates/pkg/openssl @@ -18,9 +18,9 @@ check_static command/ocspcheck {% endblock %} {% block genlinks_begin %} - x["./command/openssl"]=1 - x["./command/ocspcheck"]=1 - x["./man/man1/openssl.1"]=1 - x["./library/libssl.a"]=1 - x["./include/tls.h"]=1 + x["./{{bindir}}/openssl"]=1 + x["./{{bindir}}/ocspcheck"]=1 + x["./{{mandir}}/man1/openssl.1"]=1 + x["./{{libdir}}/libssl.a"]=1 + x["./{{includedir}}/tls.h"]=1 {% endblock %} diff --git a/templates/pkg/patch b/templates/pkg/patch @@ -7,5 +7,5 @@ check_static command/patch {% endblock %} {% block genlinks_begin %} - x["./command/patch"]=1 + x["./{{bindir}}/patch"]=1 {% endblock %} diff --git a/templates/pkg/patchelf:bootstrap b/templates/pkg/patchelf:bootstrap @@ -13,6 +13,6 @@ autotools_config_static . --disable-nls check_static command/patchelf {% endblock %} {% block genlinks_begin %} - x["./command/patchelf"]=1 - x["./man/man1/patchelf.1"]=1 + x["./{{bindir}}/patchelf"]=1 + x["./{{mandir}}/man1/patchelf.1"]=1 {% endblock %} diff --git a/templates/pkg/pkgconf b/templates/pkg/pkgconf @@ -1,7 +1,7 @@ {%- set pkg_version="2.1.1" -%} {%- set pkg_source="tar.xz" -%} {% extends "autotools_static" %} -{% do setitem(env_template, "PKG_CONFIG_LIBDIR", "@ENVROOT@/library/pkgconfig") %} +{% do setitem(env_template, "PKG_CONFIG_LIBDIR", "@ENVROOT@/"~pkgconfigdir) %} {% block configure %} export LDFLAGS=--static autotools_config_static --with-pkg-config-dir= @@ -12,7 +12,7 @@ check_static command/pkgconf {% endblock check %} {% block genlinks_begin %} - x["./command/pkgconf"]=1 + x["./{{bindir}}/pkgconf"]=1 {% endblock genlinks_begin %} {% block genlinks_rules %} $2 == ".env-template" { link($0); next } diff --git a/templates/pkg/pkgconf-pkg-config b/templates/pkg/pkgconf-pkg-config @@ -10,8 +10,8 @@ exe=$(realpath "$(which pkgconf)") mkdir command ln -sf "$exe" command/pkg-config mkdir -p ".env-template" -printf '%s' >".env-template/PKG_CONFIG_LIBDIR" "@ENVROOT@/library/pkgconfig" -printf '%s\t%s\n' "./command/pkg-config" "./command/pkg-config" >>.install-links.new +printf '%s' >".env-template/PKG_CONFIG_LIBDIR" "@ENVROOT@/{{pkgconfigdir}}" +printf '%s\t%s\n' "./{{bindir}}/pkg-config" "./{{bindir}}/pkg-config" >>.install-links.new printf '%s\t%s\n' "./.env-template/PKG_CONFIG_LIBDIR" "./.env-template/PKG_CONFIG_LIBDIR" >>.install-links.new mv .install-links.new .install-links {% endblock %} diff --git a/templates/pkg/popt b/templates/pkg/popt @@ -3,6 +3,6 @@ {% extends "autotools_static" %} {% block configure_args %}--disable-nls{% endblock %} {% block genlinks_begin %} - x["./include/popt.h"]=1 - x["./library/libpopt.a"]=1 + x["./{{includedir}}/popt.h"]=1 + x["./{{libdir}}/libpopt.a"]=1 {% endblock %} diff --git a/templates/pkg/pthbs-banginstall b/templates/pkg/pthbs-banginstall @@ -5,10 +5,10 @@ #@sha256:{{files["pthbs-banginstall"]}}:pthbs-banginstall {% endblock %} {% block build_and_install -%} -mkdir -p "${dest}/command" +mkdir -p "${dest}/{{bindir}}" chmod +x pthbs-banginstall zsh -x pthbs-banginstall pthbs-banginstall "${dest}" {% endblock %} {% block genlinks_begin %} - x["./command/pthbs-banginstall"]=1 + x["./{{bindir}}/pthbs-banginstall"]=1 {% endblock %} diff --git a/templates/pkg/rsync b/templates/pkg/rsync @@ -28,6 +28,6 @@ check_static command/rsync {% endblock %} {% block genlinks_begin %} - x["./command/rsync"]=1 - x["./man/man1/rsync.1"]=1 + x["./{{bindir}}/rsync"]=1 + x["./{{mandir}}/man1/rsync.1"]=1 {% endblock %} diff --git a/templates/pkg/s6-networking b/templates/pkg/s6-networking @@ -8,8 +8,8 @@ {% endblock %} {%- block configure_args %}--enable-ssl=libtls{% endblock %} {% block genlinks_begin %} - x["./command/s6-tcpclient"]=1 - x["./command/s6-tcpserver"]=1 - x["./command/s6-tlsclient"]=1 - x["./command/s6-tlsserver"]=1 + x["./{{bindir}}/s6-tcpclient"]=1 + x["./{{bindir}}/s6-tcpserver"]=1 + x["./{{bindir}}/s6-tlsclient"]=1 + x["./{{bindir}}/s6-tlsserver"]=1 {% endblock -%} diff --git a/templates/pkg/skalibs b/templates/pkg/skalibs @@ -5,20 +5,20 @@ #+{{pkg_install_name("gnu-make")}} {% endblock %} {% block configure -%} -export CC="$pthbs_build_environment/command/{{triplet}}-gcc" -export CXX="$pthbs_build_environment/command/{{triplet}}-g++" -export LD="$pthbs_build_environment/command/{{triplet}}-ld" -export AR="$pthbs_build_environment/command/{{triplet}}-ar" +export CC="$pthbs_build_environment/{{bindir}}/{{triplet}}-gcc" +export CXX="$pthbs_build_environment/{{bindir}}/{{triplet}}-g++" +export LD="$pthbs_build_environment/{{bindir}}/{{triplet}}-ld" +export AR="$pthbs_build_environment/{{bindir}}/{{triplet}}-ar" export CFLAGS="-O2 -ggdb" ./configure \ --prefix="$prefix" \ --sysdepdir="${prefix}/sysdeps" \ - --binprefix="${prefix}/command" \ - --extbinprefix="${prefix}/command" \ - --dynlibdir="${prefix}/library.so" \ - --libdir="${prefix}/library" \ - --includedir="${prefix}/include" \ + --binprefix="${prefix}/{{bindir}}" \ + --extbinprefix="${prefix}/{{bindir}}" \ + --dynlibdir="${prefix}/{{dynlibdir}}" \ + --libdir="${prefix}/{{libdir}}" \ + --includedir="${prefix}/{{includedir}}" \ --disable-shared --enable-static {% endblock %} {% block genlinks_begin %} diff --git a/templates/pkg/skalibs:bootstrap b/templates/pkg/skalibs:bootstrap @@ -8,19 +8,19 @@ #+{{pkg_install_name("busybox:bootstrap")}} {% endblock package_deps -%} {% block configure -%} -export CC="$pthbs_build_environment/command/{{triplet}}-gcc" -export CXX="$pthbs_build_environment/command/{{triplet}}-g++" -export LD="$pthbs_build_environment/command/{{triplet}}-ld" -export AR="$pthbs_build_environment/command/{{triplet}}-ar" +export CC="$pthbs_build_environment/{{bindir}}/{{triplet}}-gcc" +export CXX="$pthbs_build_environment/{{bindir}}/{{triplet}}-g++" +export LD="$pthbs_build_environment/{{bindir}}/{{triplet}}-ld" +export AR="$pthbs_build_environment/{{bindir}}/{{triplet}}-ar" export CFLAGS="-O2 -ggdb" ./configure \ --prefix="$prefix" \ --sysdepdir="${prefix}/sysdeps" \ - --binprefix="${prefix}/command" \ - --extbinprefix="${prefix}/command" \ - --dynlibdir="${prefix}/library.so" \ - --libdir="${prefix}/library" \ - --includedir="${prefix}/include" \ + --binprefix="${prefix}/{{bindir}}" \ + --extbinprefix="${prefix}/{{bindir}}" \ + --dynlibdir="${prefix}/{{dynlibdir}}" \ + --libdir="${prefix}/{{libdir}}" \ + --includedir="${prefix}/{{includedir}}" \ --disable-shared --enable-static {% endblock %} diff --git a/templates/pkg/snaprep b/templates/pkg/snaprep @@ -1,6 +1,6 @@ {%- set pkg_source="git" -%} {% extends "scriptsetup" %} {% block genlinks_begin %} - x["./command/snap.push"]=1 - x["./command/snap.lvm2"]=1 + x["./{{bindir}}/snap.push"]=1 + x["./{{bindir}}/snap.lvm2"]=1 {% endblock %} diff --git a/templates/pkg/squashfs-tools b/templates/pkg/squashfs-tools @@ -24,8 +24,8 @@ m() { XATTR_DEFAULT=1 \ USE_PREBUILT_MANPAGES=y \ INSTALL_PREFIX="$prefix" \ - INSTALL_DIR="$dest/command" \ - INSTALL_MANPAGES_DIR="$dest/man/man1" \ + INSTALL_DIR="$dest/{{bindir}}" \ + INSTALL_MANPAGES_DIR="$dest/{{mandir}}/man1" \ "$@" } @@ -46,5 +46,5 @@ m install check_static command/mksquashfs {% endblock check %} {% block genlinks_begin %} - x["./command/mksquashfs"]=1 + x["./{{bindir}}/mksquashfs"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/strace b/templates/pkg/strace @@ -17,8 +17,8 @@ check_static command/strace {% endblock %} {% block genlinks_begin %} - x["./command/strace"]=1 - x["./command/strace-log-merge"]=1 - x["./man/man1/strace.1"]=1 - x["./man/man1/strace-log-merge.1"]=1 + x["./{{bindir}}/strace"]=1 + x["./{{bindir}}/strace-log-merge"]=1 + x["./{{mandir}}/man1/strace.1"]=1 + x["./{{mandir}}/man1/strace-log-merge.1"]=1 {% endblock %} diff --git a/templates/pkg/system-config b/templates/pkg/system-config @@ -37,19 +37,19 @@ linkdep() { if ! test -x "$exe"; then printf 'Error: executable not found: %s\n' "$1" fi - mkdir -p "$dest/deps/command" - ln -sf $exe "$dest/deps/command/$name" + mkdir -p "$dest/deps/{{bindir}}" + ln -sf $exe "$dest/deps/{{bindir}}/$name" } -printf '%s\n' >config/etc/motd \ - "Welcome to $(cat ./config/hostname)!" \ +printf '%s\n' >{{configdir}}/etc/motd \ + "Welcome to $(cat ./{{configdir}}/hostname)!" \ 'Current running configuration was generated from {{name}}:{{submodule.current[name]}}' \ 'Last change on {{submodule.commit_info(submodule.current[name])}}' -printf '%s\n' >config/etc/skel/loginexec \ +printf '%s\n' >{{configdir}}/etc/skel/loginexec \ "#!$(which execlineb) -S0" \ 'user_loginexec $@' -chmod +x config/etc/skel/loginexec +chmod +x {{configdir}}/etc/skel/loginexec env 'pthbs_path_{{name}}'="$prefix" \ 'pthbs_path_containers={{pkg_install_dir("containers.environment")}}' \ @@ -60,26 +60,26 @@ sort -u build/execfile | while IFS= read exename; do linkdep "$exename" done -mkdir "$dest/command" -awk -v "zsh=$(which zsh)" <./postinstall >"$dest/command/install-as-current-environment.postinstall" ' +mkdir "$dest/{{bindir}}" +awk -v "zsh=$(which zsh)" <./postinstall >"$dest/{{bindir}}/install-as-current-environment.postinstall" ' NR==1 { print "#!" zsh; next } /@@current@@/ { print "current=/run/current"; next } /@@versions@@/ { print "versions='{{versions}}'"; next } 1 ' -chmod +x "$dest/command/install-as-current-environment.postinstall" +chmod +x "$dest/{{bindir}}/install-as-current-environment.postinstall" -mkdir -p "$dest/config/" -rsync -ai ./config/ "$dest/config/" -rsync -ai ./out/ "$dest/config/" +mkdir -p "$dest/{{configdir}}/" +rsync -ai ./{{configdir}}/ "$dest/{{configdir}}/" +rsync -ai ./out/ "$dest/{{configdir}}/" mv -v keys "$dest/" {% endblock -%} {% block genlinks_begin %} - x["./command/install-as-current-environment.postinstall"]=1 - x["./config/etc/fstab"]=1 - x["./config/etc/motd"]=1 - x["./config/etc/skel/loginexec"]=1 - x["./config/hostname"]=1 - x["./keys/ssh/authorized_keys/root"]=1 + x["./{{bindir}}/install-as-current-environment.postinstall"]=1 + x["./{{configdir}}/etc/fstab"]=1 + x["./{{configdir}}/etc/motd"]=1 + x["./{{configdir}}/etc/skel/loginexec"]=1 + x["./{{configdir}}/hostname"]=1 + x["./{{keysdir}}/ssh/authorized_keys/root"]=1 {% endblock %} diff --git a/templates/pkg/system-config-init b/templates/pkg/system-config-init @@ -12,13 +12,13 @@ #+{{pkg_install_name("system-config-rc")}} {% endblock %} {% block build_and_install -%} -s6rcdb={{pkg_install_dir("system-config-rc")}}/config/s6-rc-db +s6rcdb={{pkg_install_dir("system-config-rc")}}/{{configdir}}/s6-rc-db # Generate init (${dest} must not exist but parent dir does) mkdir -p "$pthbs_destdir/{{versions}}" s6-linux-init-maker \ - -p "/run/current/command:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ - -G "$(q "$prefix/deps/command/env") TERM=linux $(q "$prefix/deps/command/getty") 38400 tty9" \ + -p "/run/current/{{bindir}}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + -G "$(q "$prefix/deps/{{bindir}}/env") TERM=linux $(q "$prefix/deps/{{bindir}}/getty") 38400 tty9" \ -t 1 \ -N \ -c "$prefix" \ @@ -31,7 +31,7 @@ qx getty # Link execlineb - can't quote shebang qx execlineb -el=$prefix/deps/command/$name +el=$prefix/deps/{{bindir}}/$name # Rewrite bin/init as it fails finding it's own s6-linux-init s6-cat >"${dest}/bin/init.new" <<EOF || exit $? diff --git a/templates/pkg/system-config-rc b/templates/pkg/system-config-rc @@ -7,9 +7,9 @@ #+{{pkg_install_name("system-config")}} {% endblock %} {% block build_and_install -%} -src={{pkg_install_dir("system-config")}}/config/s6-rc-source +src={{pkg_install_dir("system-config")}}/{{configdir}}/s6-rc-source s6-rc-compile ./s6-rc-db "$src" -mkdir -p "$dest/config" -mv -v s6-rc-db "$dest/config/" +mkdir -p "$dest/{{configdir}}" +mv -v s6-rc-db "$dest/{{configdir}}/" {% endblock -%} diff --git a/templates/pkg/system-config-scripts b/templates/pkg/system-config-scripts @@ -1,6 +1,6 @@ {%- set pkg_source="git" -%} {% extends "scriptsetup" %} {% block genlinks_begin %} - x["./command/s"]=1 - x["./command/issue-gen"]=1 + x["./{{bindir}}/s"]=1 + x["./{{bindir}}/issue-gen"]=1 {% endblock %} diff --git a/templates/pkg/system-config-zsh b/templates/pkg/system-config-zsh @@ -4,7 +4,7 @@ #+{{pkg_install_name("zsh")}} {% endblock %} {% block build_and_install -%} -mkdir -p "$dest/zsh" -mv -v zsh-functions "$dest/zsh/site-functions" +mkdir -p "$dest/{{zshdir}}" +mv -v zsh-functions "$dest/{{zshdir}}/site-functions" {% endblock %} diff --git a/templates/pkg/tinyssh b/templates/pkg/tinyssh @@ -9,7 +9,7 @@ {% endblock package_deps %} {% block prepare -%} {{ super() -}} -sed -i 's|/sbin|/command|; s|/share/man/|/man/|' Makefile +sed -i 's|/sbin|/{{sbindir}}|; s|/share/man/|/{{mandir}}/|' Makefile {% endblock prepare %} {% block build -%} @@ -27,10 +27,10 @@ check_static command/tinysshd-makekey check_static command/tinysshd-printkey {% endblock check %} {% block genlinks_begin %} - x["./command/tinysshd"]=1 - x["./command/tinysshd-makekey"]=1 - x["./command/tinysshd-printkey"]=1 - x["./man/man8/tinysshd.8"]=1 - x["./man/man8/tinysshd-makekey.8"]=1 - x["./man/man8/tinysshd-printkey.8"]=1 + x["./{{sbindir}}/tinysshd"]=1 + x["./{{sbindir}}/tinysshd-makekey"]=1 + x["./{{sbindir}}/tinysshd-printkey"]=1 + x["./{{mandir}}/man8/tinysshd.8"]=1 + x["./{{mandir}}/man8/tinysshd-makekey.8"]=1 + x["./{{mandir}}/man8/tinysshd-printkey.8"]=1 {% endblock genlinks_begin %} diff --git a/templates/pkg/user-env b/templates/pkg/user-env @@ -6,11 +6,11 @@ #@sha256:{{ files[shortname] }}:{{ shortname }} {% endblock %} {% block build_and_install -%} -mkdir -p "${dest}/command" +mkdir -p "${dest}/{{bindir}}" chmod +x user-env pthbs-banginstall user-env "${dest}" {% endblock %} {% block genlinks_begin %} - x["./command/user-env"]=1 + x["./{{bindir}}/user-env"]=1 {% endblock %} diff --git a/templates/pkg/xbps b/templates/pkg/xbps @@ -21,10 +21,10 @@ find lib bin -name '*.c' -exec sed -iEe '/#.*_GNU_SOURCE/d' '{}' \; --prefix="$prefix" \ --build="$(${CC:-gcc} -dumpmachine)" \ --datadir="$prefix" \ - --bindir="$prefix/command" \ - --infodir="$prefix/info" \ - --mandir="$prefix/man" \ - --libdir="$prefix/library" \ + --bindir="$prefix/{{bindir}}" \ + --infodir="$prefix/{{infodir}}" \ + --mandir="$prefix/{{mandir}}" \ + --libdir="$prefix/{{libdir}}" \ --localstatedir=/var \ --enable-static @@ -35,12 +35,12 @@ find lib bin -name '*.c' -exec sed -iEe '/#.*_GNU_SOURCE/d' '{}' \; {% endblock %} {% block install -%} -install -d "$dest/library" -install -m 644 lib/libxbps.a "$dest/library" -install -d "$dest/command" +install -d "$dest/{{libdir}}" +install -m 644 lib/libxbps.a "$dest/{{libdir}}" +install -d "$dest/{{bindir}}" for cmd in xbps-alternatives xbps-create xbps-dgraph xbps-install xbps-pkgdb xbps-query xbps-reconfigure xbps-remove xbps-rindex xbps-uhelper xbps-checkvers xbps-fbulk xbps-digest xbps-fetch xbps-uchroot xbps-uunshare; do {{make}} -C "bin/$cmd" "$cmd.static" - install -m 755 "bin/$cmd/$cmd.static" "$pthbs_destdir/$prefix/command" + install -m 755 "bin/$cmd/$cmd.static" "$pthbs_destdir/$prefix/{{bindir}}" done {{make}} -C data {{make}} -C data install DESTDIR="$pthbs_destdir" @@ -48,12 +48,12 @@ done {% endblock %} {% block check -%} check_static command/xbps-install.static -mkdir -p "$dest/keys" -mv -v "$pthbs_destdir/var/db/xbps/keys" "$dest/keys/void" +mkdir -p "$dest/{{keysdir}}" +mv -v "$pthbs_destdir/var/db/xbps/{{keysdir}}" "$dest/{{keysdir}}/void" {% endblock %} {% block genlinks_begin %} - x["./command/xbps-install.static"]=1 + x["./{{bindir}}/xbps-install.static"]=1 {% endblock %} {% block genlinks_rules %} $2 == "keys" { link($0); next } diff --git a/templates/pkg/zsh b/templates/pkg/zsh @@ -1,7 +1,7 @@ {%- set pkg_version="5.9" -%} {%- set pkg_source="tar.xz" -%} {% extends "autotools_static" %} -{% do setitem(env_template, "FPATH", "@ENVROOT@/zsh/site-functions:@ENVROOT@/zsh/functions") %} +{% do setitem(env_template, "FPATH", "@ENVROOT@/"~zshdir~"/site-functions:@ENVROOT@/"~zshdir~"/functions") %} {% block package_deps -%} #+{{pkg_install_name("netbsd-curses")}} #+{{pkg_install_name("libbsd")}} @@ -12,11 +12,11 @@ autotools_config \ --enable-datadir="${prefix}" \ --enable-datarootdir="${prefix}" \ --enable-etcdir="${prefix}/etc" \ - --enable-scriptdir="${prefix}/zsh/scripts" \ - --enable-site-scriptdir="${prefix}/zsh/site-scripts" \ - --enable-fndir="${prefix}/zsh/functions" \ - --enable-site-fndir="${prefix}/zsh/site-functions" \ - --enable-runhelpdir="${prefix}/zsh/help" \ + --enable-scriptdir="${prefix}/{{zshdir}}/scripts" \ + --enable-site-scriptdir="${prefix}/{{zshdir}}/site-scripts" \ + --enable-fndir="${prefix}/{{zshdir}}/functions" \ + --enable-site-fndir="${prefix}/{{zshdir}}/site-functions" \ + --enable-runhelpdir="${prefix}/{{zshdir}}/help" \ --disable-dynamic \ --disable-restricted-r \ --enable-locale \ @@ -52,9 +52,9 @@ check_static command/zsh {% endblock %} {% block genlinks_begin %} - x["./command/zsh"]=1 - x["./man/man1/zsh.1"]=1 - x["./man/man1/zshall.1"]=1 + x["./{{bindir}}/zsh"]=1 + x["./{{mandir}}/man1/zsh.1"]=1 + x["./{{mandir}}/man1/zshall.1"]=1 {% endblock %} {% block genlinks_rules %} $2 == "zsh" { link($0); next } diff --git a/templates/pkg/zstd b/templates/pkg/zstd @@ -15,9 +15,9 @@ build_env_static DESTDIR="$pthbs_destdir" \ prefix="{{versions}}/$pthbs_package" \ datarootdir="{{versions}}/$pthbs_package" \ - bindir="{{versions}}/$pthbs_package/command" \ - libdir="{{versions}}/$pthbs_package/library" -rm -v "$pthbs_destdir/{{versions}}/$pthbs_package/library"/*.so* + bindir="{{versions}}/$pthbs_package/{{bindir}}" \ + libdir="{{versions}}/$pthbs_package/{{libdir}}" +rm -v "$pthbs_destdir/{{versions}}/$pthbs_package/{{libdir}}"/*.so* {% endblock %} {% block check -%} @@ -25,6 +25,6 @@ check_static command/zstd {% endblock %} {% block genlinks_begin %} - x["./command/zstd"]=1 - x["./library/libzstd.a"]=1 + x["./{{bindir}}/zstd"]=1 + x["./{{libdir}}/libzstd.a"]=1 {% endblock %} diff --git a/templates/scriptsetup b/templates/scriptsetup @@ -21,8 +21,8 @@ if test -d vim; then fi if test -d zsh-functions; then - mkdir -p "${dest}/zsh" - mv -v zsh-functions "${dest}/zsh/site-functions" + mkdir -p "${dest}/{{zshdir}}" + mv -v zsh-functions "${dest}/{{zshdir}}/site-functions" fi {% endblock %} diff --git a/templates/single_static_c b/templates/single_static_c @@ -17,8 +17,8 @@ gcc ${CFLAGS} -o "$name" "$name.c" $LDFLAGS {% endblock %} {% block install -%} -install -d "$pthbs_destdir/$prefix/command" -install -m 755 "$name" "$pthbs_destdir/$prefix/command" +install -d "$pthbs_destdir/$prefix/{{bindir}}" +install -m 755 "$name" "$pthbs_destdir/$prefix/{{bindir}}" {% endblock %} {% block check -%} @@ -26,5 +26,5 @@ check_static "command/$name" {% endblock %} {% block genlinks_begin %} - x["./command/{{name}}"]=1 + x["./{{bindir}}/{{name}}"]=1 {%- endblock %} diff --git a/templates/skaware b/templates/skaware @@ -8,14 +8,14 @@ {%- block configure %} ./configure {% block configure_args %}{% endblock %} \ --prefix="$prefix" \ - --dynlibdir="${prefix}/library.so" \ - --bindir="${prefix}/command" \ - --libdir="${prefix}/library" \ - --shebangdir="${prefix}/command" \ + --dynlibdir="${prefix}/{{dynlibdir}}" \ + --bindir="${prefix}/{{bindir}}" \ + --libdir="${prefix}/{{libdir}}" \ + --shebangdir="${prefix}/{{bindir}}" \ --with-sysdeps='{{pkg_install_dir("skalibs")}}/sysdeps' \ - --with-include="$pthbs_build_environment/include" \ - --with-lib="$pthbs_build_environment/library" \ - --with-dynlib="$pthbs_build_environment/library.so" \ + --with-include="$pthbs_build_environment/{{includedir}}" \ + --with-lib="$pthbs_build_environment/{{libdir}}" \ + --with-dynlib="$pthbs_build_environment/{{dynlibdir}}" \ --disable-shared --enable-static --enable-allstatic --enable-static-libc --absolute-paths {% endblock %} diff --git a/templates/topkg b/templates/topkg @@ -16,9 +16,9 @@ ocaml -I "$OCAMLPATH" pkg/pkg.ml build {% block topkg_build_args %}{% endblock % {%- block install %} opam-installer -i \ --prefix="$dest" \ - --libdir="$dest/library.ocaml" \ - --mandir="$dest/man" \ - --docdir="$dest/doc/{{shortname}}" + --libdir="$dest/{{ocamldir}}" \ + --mandir="$dest/{{mandir}}" \ + --docdir="$dest/{{docdir}}/{{shortname}}" {% endblock install %} {% block genlinks_rules %} diff --git a/variants/ccx-x86_64.yaml b/variants/ccx-x86_64.yaml @@ -5,3 +5,27 @@ make: "make -j${JOBS:-1} -l$((1+${JOBS:-1}))" #etc_dir: /home/ccx/.local/etc var_dir: /var/pthbs kernel: linux-qemu-guest + +configdir: "config" +bindir: "command" +sbindir: "command" +infodir: "info" +localedir: "locale" +mandir: "man" +libdir: "library" +dynlibdir: "library.so" +pkgconfigdir: "library/pkgconfig" +docdir: "doc" +datadir: "data" +datarootdir: "data" +includedir: "include" +keysdir: "keys" +ssldir: "config/ssl" + +kernel_mod_path: "kernel" +kernel_image_path: "boot" +kernel_dtbs_path: "boot/dtbs" + +ocamldir: "library.ocaml" +zshdir: "zsh" +vimdir: "vimfiles" diff --git a/variants/root-x86_64.yaml b/variants/root-x86_64.yaml @@ -4,3 +4,27 @@ versions: /versions make: "make -j${JOBS:-1} -l$((1+${JOBS:-1}))" #etc_dir: /home/ccx/.local/etc var_dir: /var/pthbs + +configdir: "config" +bindir: "command" +sbindir: "command" +infodir: "info" +localedir: "locale" +mandir: "man" +libdir: "library" +dynlibdir: "library.so" +pkgconfigdir: "library/pkgconfig" +docdir: "doc" +datadir: "data" +datarootdir: "data" +includedir: "include" +keysdir: "keys" +ssldir: "config/ssl" + +kernel_mod_path: "kernel" +kernel_image_path: "boot" +kernel_dtbs_path: "boot/dtbs" + +ocamldir: "library.ocaml" +zshdir: "zsh" +vimdir: "vimfiles"