summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0x221E <0x221E@0xinfinity.dev>2026-06-02 15:36:20 +0200
committer0x221E <0x221E@0xinfinity.dev>2026-06-02 15:38:37 +0200
commit51179eb02f2b2c4cf1c4ae31eee0a57dcbc78c03 (patch)
tree7c86b41f63cad2038d298ec4d7188f16dd8f5fe3
downloadbootstrap-master.tar.gz
initial commitHEADmaster
-rw-r--r--.gitignore2
-rw-r--r--README.md11
-rwxr-xr-xsetup194
-rw-r--r--templates/autoconf/template26
-rw-r--r--templates/bash/template30
-rw-r--r--templates/binutils/template33
-rw-r--r--templates/bison/template27
-rw-r--r--templates/cmake/template15
-rw-r--r--templates/coreutils/template38
-rw-r--r--templates/diffutils/template25
-rw-r--r--templates/file/template25
-rw-r--r--templates/findutils/template26
-rw-r--r--templates/gawk/template26
-rw-r--r--templates/gcc/template55
-rw-r--r--templates/gettext/template26
-rw-r--r--templates/glibc/template36
-rw-r--r--templates/grep/template26
-rw-r--r--templates/gzip/template25
-rw-r--r--templates/m4/template25
-rw-r--r--templates/make/template25
-rw-r--r--templates/meson/template11
-rw-r--r--templates/ncurses/template34
-rw-r--r--templates/ninja/template11
-rw-r--r--templates/patch/template25
-rw-r--r--templates/perl/template24
-rw-r--r--templates/python/template26
-rw-r--r--templates/readline/template25
-rw-r--r--templates/sed/template25
-rw-r--r--templates/tar/template25
-rw-r--r--templates/texinfo/template25
-rw-r--r--templates/util-linux/template49
-rw-r--r--templates/xz/template27
-rw-r--r--templates/zlib/template25
33 files changed, 1028 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0d19e7a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+bootstrap/
+tmp/
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..96a9739
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+# masterdir bootstrap image setup
+This repository contains scripts to create the masterdir initial bootstrap
+file. The aim of this project is to create a bare-minimum environment that
+can install other packages within. Cross-compilation is required.
+
+## Requirements
+- cross-compiler [https://universe.0xinfinity.dev/distro/cross.git](https://universe.0xinfinity.dev/distro/cross.git)
+
+## Caution!
+Changing contents of master file requires all packages in the mirror to be
+re-installed.
diff --git a/setup b/setup
new file mode 100755
index 0000000..1c60151
--- /dev/null
+++ b/setup
@@ -0,0 +1,194 @@
+#!/bin/bash
+
+TEMPLATE_DIR="templates"
+
+TMP_DIR_PREFIX="$(pwd)/tmp"
+rm -rf "${TMP_DIR_PREFIX}"/* # ?? Could be vulnerable
+
+if [ -z "${DISTRO_TC}" ]
+then
+ DISTRO_TC=x86_64-x221e-linux-gnu
+fi
+
+if [ -z "${CROSS_TC}" ]
+then
+ CROSS_TC=${HOME}/opt/cross
+fi
+
+if [ -z "${CC}" ]
+then
+ CC=x86_64-x221e-linux-gnu-gcc
+fi
+
+if [ -z "${MASTERDIR}" ]
+then
+ MASTERDIR="$(pwd)/bootstrap"
+fi
+
+mkdir -p "${MASTERDIR}"
+touch "${MASTERDIR}/packages"
+
+if [ -z "${CROSS_ENV_ROOT}" ]
+then
+ CROSS_ENV_ROOT="${HOME}/opt/cross/"
+fi
+
+MIRROR_GNU_FTP="https://ftp.gnu.org/gnu/"
+
+function download_source {
+ upstream="$1"
+ out_name="$2"
+
+ curl -L --output-dir=${TMP_DIR_PREFIX} "${upstream}" -o "${out_name}"
+
+ if [ $? -ne 0 ]
+ then
+ echo -e "error: failed to download '${out_name}' from '${upstream}'"
+ fi
+}
+
+function unpack_source {
+ file="$1"
+
+ currdir="$(pwd)"
+
+ cd "${TMP_DIR_PREFIX}"
+
+ if [[ ! -e "${file}" || ! -f "${file}" ]]
+ then
+ echo -e "error: unpack_source: file '${file}' does not exist."
+ exit 1
+ fi
+
+ tar -xf "${file}"
+
+ if [ $? -ne 0 ]
+ then
+ echo -e "error: unpack_source: tar failed with error code: ${?}"
+ fi
+
+ cd "${currdir}"
+}
+
+function handle_configure {
+ pkg_dir="$1"
+
+ if [[ "$(type -t 'do_configure')" == "function" ]]
+ then
+ if [[ ! -e "${pkg_dir}" || ! -d "${pkg_dir}" ]]
+ then
+ echo -e "error: pkg_install: could not find: '${pkg_dir}'"
+ exit 1
+ fi
+
+ cd "${pkg_dir}"
+
+ do_configure
+
+ cd "${currdir}"
+ fi
+
+}
+
+function handle_build {
+ pkg_dir="$1"
+
+ if [[ "$(type -t 'do_build')" == "function" ]]
+ then
+ if [[ ! -e "${pkg_dir}" || ! -d "${pkg_dir}" ]]
+ then
+ echo -e "error: pkg_install: could not find: '${pkg_dir}'"
+ exit 1
+ fi
+
+ cd "${pkg_dir}"
+
+ do_build
+
+ cd "${currdir}"
+ fi
+
+}
+
+function handle_install {
+ pkg_dir="$1"
+
+ if [[ "$(type -t 'do_install')" == "function" ]]
+ then
+ if [[ ! -e "${pkg_dir}" || ! -d "${pkg_dir}" ]]
+ then
+ echo -e "error: pkg_install: could not find: '${pkg_dir}'"
+ exit 1
+ fi
+
+ cd "${pkg_dir}"
+
+ do_install
+
+ cd "${currdir}"
+ fi
+}
+
+function pkg_install {
+ pkg="$1"
+
+ pkg_file="${TEMPLATE_DIR}/${pkg}/template"
+
+ if [[ ! -e "${pkg_file}" || ! -f "${pkg_file}" ]]
+ then
+ echo -e "error: template '${pkg_file}' does not exist!"
+ exit 1
+ fi
+
+ currdir=$(pwd)
+ source "${pkg_file}"
+
+ if [ "${#dependson[@]}" -gt 0 ]
+ then
+ for i in "${dependson[@]}"
+ do
+ if [[ "$(sed -n /${i}/p ${MASTERDIR}/packages)" != "$i" ]]
+ then
+ echo -e "'${i}' must be installed before you can install '${pkgname}'"
+ exit 1
+ fi
+ done
+ fi
+
+ pkg_dir_name="${pkgname}-${version}"
+ archive_name="${pkg_dir_name}.tar"
+
+ download_source "${upstream}" "${archive_name}"
+ unpack_source "${archive_name}"
+
+ handle_configure "${TMP_DIR_PREFIX}/${pkg_dir_name}"
+ handle_build "${TMP_DIR_PREFIX}/${pkg_dir_name}"
+ handle_install "${TMP_DIR_PREFIX}/${pkg_dir_name}"
+
+ echo "${pkgname}=${version}" >> "${MASTERDIR}/packages"
+}
+
+function bootstrap {
+ for i in $(ls templates/)
+ do
+ pkg_install "${i}"
+ done
+}
+
+function requirements {
+ ncurses_lib_loc="${CROSS_TC}/usr/lib/libncursesw_g.a"
+ echo -e "Checking the existence of ncursesw in the cross-toolchain environment."
+ if [[ ! -e "${ncurses_lib_loc}" || ! -f "${ncurses_lib_loc}" ]]
+ then
+ MASTERDIR="${CROSS_TC}"
+ pkg_install "ncurses"
+ fi
+ echo -e "requirement met: ncurses"
+}
+
+case "$1" in
+ "pkg") pkg_install "${@:2}" ;;
+ "bootstrap") bootstrap "${@:2}" ;;
+ "requirements") requirements "${@:2}" ;;
+ *) echo -e "error: invalid command" && exit 1 ;;
+esac
diff --git a/templates/autoconf/template b/templates/autoconf/template
new file mode 100644
index 0000000..e03079b
--- /dev/null
+++ b/templates/autoconf/template
@@ -0,0 +1,26 @@
+pkgname=autoconf
+version=2.73
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --docdir=/usr/share/doc/bison-3.8.2
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/bash/template b/templates/bash/template
new file mode 100644
index 0000000..b5bea31
--- /dev/null
+++ b/templates/bash/template
@@ -0,0 +1,30 @@
+pkgname=bash
+version=5.3
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --disable-nls
+ --disable-werror
+ --with-build-sysroot=${CROSS_ENV_ROOT}
+ --enable-stack-protector=strong
+ --without-bash-malloc
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/binutils/template b/templates/binutils/template
new file mode 100644
index 0000000..49949b6
--- /dev/null
+++ b/templates/binutils/template
@@ -0,0 +1,33 @@
+pkgname=binutils
+version=2.46.0
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p ../${pkgname}
+ cd ../${pkgname}
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --enable-shared
+ --disable-multilib
+ --disable-nls
+ --disable-werror
+ --with-build-sysroot=${CROSS_ENV_ROOT}
+ )
+
+ ../${pkgname}-${version}/configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd ..
+ cd ${pkgname}/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd ..
+ cd ${pkgname}/
+
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/bison/template b/templates/bison/template
new file mode 100644
index 0000000..63c524a
--- /dev/null
+++ b/templates/bison/template
@@ -0,0 +1,27 @@
+pkgname=bison
+version=3.8
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --docdir=/usr/share/doc/bison-3.8.2
+ M4=/usr/bin/m4
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/cmake/template b/templates/cmake/template
new file mode 100644
index 0000000..1646c82
--- /dev/null
+++ b/templates/cmake/template
@@ -0,0 +1,15 @@
+pkgname=cmake
+version=4.3.3
+upstream="https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}.tar.gz"
+
+function do_configure {
+ ./bootstrap
+}
+
+function do_build {
+ make
+}
+
+function do_install {
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/coreutils/template b/templates/coreutils/template
new file mode 100644
index 0000000..d965314
--- /dev/null
+++ b/templates/coreutils/template
@@ -0,0 +1,38 @@
+pkgname=coreutils
+version=9.11
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p ../${pkgname}
+ cd ../${pkgname}
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --enable-shared
+ --enable-threads=posix
+ --disable-multilib
+ --disable-nls
+ --disable-werror
+ --with-build-sysroot=${CROSS_ENV_ROOT}
+ --enable-stack-protector=strong
+ --disable-acl
+ --disable-libsmack
+ --disable-libcap
+ --disable-systemd
+ )
+
+ ../${pkgname}-${version}/configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd ..
+ cd ${pkgname}/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd ..
+ cd ${pkgname}/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/diffutils/template b/templates/diffutils/template
new file mode 100644
index 0000000..492b23e
--- /dev/null
+++ b/templates/diffutils/template
@@ -0,0 +1,25 @@
+pkgname=diffutils
+version=3.12
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/file/template b/templates/file/template
new file mode 100644
index 0000000..02729f6
--- /dev/null
+++ b/templates/file/template
@@ -0,0 +1,25 @@
+pkgname=file
+version=5.47
+upstream="https://astron.com/pub/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/findutils/template b/templates/findutils/template
new file mode 100644
index 0000000..43fad95
--- /dev/null
+++ b/templates/findutils/template
@@ -0,0 +1,26 @@
+pkgname=findutils
+version=4.10.0
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.xz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --localstatedir=/var/lib/locate
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/gawk/template b/templates/gawk/template
new file mode 100644
index 0000000..0291275
--- /dev/null
+++ b/templates/gawk/template
@@ -0,0 +1,26 @@
+pkgname=gawk
+version=5.4.0
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --localstatedir=/var/lib/locate
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/gcc/template b/templates/gcc/template
new file mode 100644
index 0000000..4d8081b
--- /dev/null
+++ b/templates/gcc/template
@@ -0,0 +1,55 @@
+pkgname=gcc
+version=16.1.0
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ ./contrib/download_prerequisites
+ mkdir -p build/
+ cd build/
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --target=${DISTRO_TC}
+ --enable-shared
+ --enable-threads=posix
+ --enable-languages=c,c++
+ --disable-multilib
+ --disable-nls
+ --disable-werror
+ --with-build-sysroot=${CROSS_ENV_ROOT}
+ --enable-stack-protector=strong
+ )
+
+ ../configure "${conf_flags[@]}"
+
+ cd ..
+ mkdir -p buildlib/
+ cd buildlib
+
+ libconf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --disable-multilib
+ --disable-nls
+ --disable-libstdcxx-pch
+ )
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+
+ cd ..
+ cd buildlib/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+
+ cd ..
+ cd buildlib/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/gettext/template b/templates/gettext/template
new file mode 100644
index 0000000..66597cc
--- /dev/null
+++ b/templates/gettext/template
@@ -0,0 +1,26 @@
+pkgname=gettext
+version=1.0
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --disable-shared
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/glibc/template b/templates/glibc/template
new file mode 100644
index 0000000..65194d5
--- /dev/null
+++ b/templates/glibc/template
@@ -0,0 +1,36 @@
+pkgname=glibc
+version=2.43
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p ../${pkgname}
+ cd ../${pkgname}
+
+ echo "rootsbindir=/usr/sbin" > configparms
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --enable-shared
+ --disable-multilib
+ --disable-nls
+ --disable-werror
+ --with-build-sysroot=${CROSS_ENV_ROOT}
+ --enable-stack-protector=strong
+ libc_cv_slibdir=/usr/lib
+ )
+
+ ../${pkgname}-${version}/configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd ..
+ cd ${pkgname}/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd ..
+ cd ${pkgname}/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/grep/template b/templates/grep/template
new file mode 100644
index 0000000..40fa6f3
--- /dev/null
+++ b/templates/grep/template
@@ -0,0 +1,26 @@
+pkgname=grep
+version=3.12
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --localstatedir=/var/lib/locate
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/gzip/template b/templates/gzip/template
new file mode 100644
index 0000000..fcb8563
--- /dev/null
+++ b/templates/gzip/template
@@ -0,0 +1,25 @@
+pkgname=gzip
+version=1.14
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/m4/template b/templates/m4/template
new file mode 100644
index 0000000..aa19975
--- /dev/null
+++ b/templates/m4/template
@@ -0,0 +1,25 @@
+pkgname=m4
+version=1.4.21
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/make/template b/templates/make/template
new file mode 100644
index 0000000..66eea42
--- /dev/null
+++ b/templates/make/template
@@ -0,0 +1,25 @@
+pkgname=make
+version=4.4.1
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/meson/template b/templates/meson/template
new file mode 100644
index 0000000..1c67add
--- /dev/null
+++ b/templates/meson/template
@@ -0,0 +1,11 @@
+pkgname=meson
+version=1.11.1
+upstream="https://github.com/mesonbuild/meson/releases/download/${version}/meson-${version}.tar.gz"
+
+function do_configure {
+ ./packaging/create_zipapp.py --outfile meson.pyz --interpreter '/usr/bin/env python3'
+}
+
+function do_install {
+ cp meson.pyz "${MATERDIR}/usr/bin/meson"
+}
diff --git a/templates/ncurses/template b/templates/ncurses/template
new file mode 100644
index 0000000..3f723a6
--- /dev/null
+++ b/templates/ncurses/template
@@ -0,0 +1,34 @@
+pkgname=ncurses
+version=6.6
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --with-shared
+ --mandir=/usr/share/man
+ --without-normal
+ --with-cxx-shared
+ --disable-stripping
+ --enable-widec
+ --with-build-sysroot=${CROSS_ENV_ROOT}
+ --enable-stack-protector=strong
+ AWK=gawk
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/ninja/template b/templates/ninja/template
new file mode 100644
index 0000000..7259d33
--- /dev/null
+++ b/templates/ninja/template
@@ -0,0 +1,11 @@
+pkgname=ninja
+version=1.13.2
+upstream="https://github.com/ninja-build/ninja/archive/refs/tags/v${version}.tar.gz"
+
+function do_configure {
+ ./configure.py --bootstrap
+}
+
+function do_install {
+ cp ninja "${MATERDIR}/usr/bin/meson"
+}
diff --git a/templates/patch/template b/templates/patch/template
new file mode 100644
index 0000000..3c4a352
--- /dev/null
+++ b/templates/patch/template
@@ -0,0 +1,25 @@
+pkgname=patch
+version=2.8
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/perl/template b/templates/perl/template
new file mode 100644
index 0000000..f73a88f
--- /dev/null
+++ b/templates/perl/template
@@ -0,0 +1,24 @@
+pkgname=perl
+version=5.42.0
+upstream="https://www.cpan.org/src/5.0/${pkgname}-${version}.tar.xz"
+
+function do_configure {
+ sh Configure -des \
+ -D prefix=/usr \
+ -D vendorprefix=/usr \
+ -D useshrplib \
+ -D privlib=/usr/lib/perl5/5.42/core_perl \
+ -D archlib=/usr/lib/perl5/5.42/core_perl \
+ -D sitelib=/usr/lib/perl5/5.42/site_perl \
+ -D sitearch=/usr/lib/perl5/5.42/site_perl \
+ -D vendorlib=/usr/lib/perl5/5.42/vendor_perl \
+ -D vendorarch=/usr/lib/perl5/5.42/vendor_perl
+}
+
+function do_build {
+ make -j$(nproc)
+}
+
+function do_install {
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/python/template b/templates/python/template
new file mode 100644
index 0000000..5101086
--- /dev/null
+++ b/templates/python/template
@@ -0,0 +1,26 @@
+pkgname=Python
+version=3.14.3
+upstream="https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --without-static-libpython
+ --enable-shared
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/readline/template b/templates/readline/template
new file mode 100644
index 0000000..207762f
--- /dev/null
+++ b/templates/readline/template
@@ -0,0 +1,25 @@
+pkgname=readline
+version=8.3
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/sed/template b/templates/sed/template
new file mode 100644
index 0000000..f84fefe
--- /dev/null
+++ b/templates/sed/template
@@ -0,0 +1,25 @@
+pkgname=sed
+version=4.9
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/tar/template b/templates/tar/template
new file mode 100644
index 0000000..cf7ba93
--- /dev/null
+++ b/templates/tar/template
@@ -0,0 +1,25 @@
+pkgname=tar
+version=1.35
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/texinfo/template b/templates/texinfo/template
new file mode 100644
index 0000000..8fd48b7
--- /dev/null
+++ b/templates/texinfo/template
@@ -0,0 +1,25 @@
+pkgname=texinfo
+version=7.2
+upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/util-linux/template b/templates/util-linux/template
new file mode 100644
index 0000000..c248afa
--- /dev/null
+++ b/templates/util-linux/template
@@ -0,0 +1,49 @@
+pkgname=util-linux
+version=2.42.1
+upstream="https://github.com/${pkgname}/${pkgname}/archive/refs/tags/v${version}.tar.gz"
+
+function do_configure {
+## These are flags from LFS, I have not reviewed this package yet.
+ ./autogen.sh
+
+ conf_flags=(
+ --prefix=/usr
+ --exec-prefix=/usr
+ --bindir=/usr/bin
+ --sbindir=/usr/sbin
+ --libdir=/usr/lib
+ --includedir=/usr/include
+ --host=${DISTRO_TC}
+ --runstatedir=/run
+ --disable-chfn-chsh
+ --disable-login
+ --disable-nologin
+ --disable-su
+ --disable-setpriv
+ --disable-runuser
+ --disable-pylibmount
+ --disable-static
+ --disable-liblastlog2
+ --without-python
+ --without-systemd
+ --without-ncurses
+ --disable-use-tty-group
+ --disable-makeinstall-chown
+ --disable-makeinstall-setuid
+ --disable-makeinstall-tty-setgid
+ ADJTIME_PATH=/var/lib/hwclock/adjtime
+ --docdir=/usr/share/doc/util-linux-${version}
+ --with-build-sysroot="${CROSS_TC}"
+ )
+
+ ./configure "${conf_flags[@]}"
+}
+
+function do_build {
+ make -j$(nproc)
+}
+
+function do_install {
+ mkdir -pv "${MASTERDIR}/var/lib/hwclock"
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/xz/template b/templates/xz/template
new file mode 100644
index 0000000..8d59052
--- /dev/null
+++ b/templates/xz/template
@@ -0,0 +1,27 @@
+pkgname=xz
+version=5.8.3
+upstream="https://github.com/tukaani-project/xz/releases/download/v${version}/xz-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ --disable-static
+ --docdir=/usr/share/doc/xz-5.8.2
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}
diff --git a/templates/zlib/template b/templates/zlib/template
new file mode 100644
index 0000000..d75f415
--- /dev/null
+++ b/templates/zlib/template
@@ -0,0 +1,25 @@
+pkgname=zlib
+version=1.3.2
+upstream="https://zlib.net/${pkgname}-${version}.tar.gz"
+
+function do_configure {
+ mkdir -p build
+ cd build
+
+ conf_flags=(
+ --prefix=/usr
+ --host=${DISTRO_TC}
+ )
+
+ ../configure "${conf_flags[@]}"
+}
+
+function do_build {
+ cd build/
+ make -j$(nproc)
+}
+
+function do_install {
+ cd build/
+ make DESTDIR="${MASTERDIR}" install
+}