now has grub - up through 8.60

master
phanes 2023-03-13 02:11:02 -04:00
parent eb6f5acfd5
commit 0117cd3cb2
26 changed files with 4820 additions and 21 deletions

View File

@ -32,3 +32,4 @@ systemd-oom:x:81:
wheel:x:97:
users:x:999:
nogroup:x:65534:
dummy:x:102:tester

3
configs/etc_pip.conf Normal file
View File

@ -0,0 +1,3 @@
[global]
root-user-action = ignore
disable-pip-version-check = true

View File

@ -0,0 +1,216 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="autoconf"
# the version of this application
VERSION="2.71"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Prework"
# TODO turn this into a patch
sed -e 's/SECONDS|/&SHLVL|/' \
-e '/BASH_ARGV=/a\ /^SHLVL=/ d' \
-i.orig tests/local.at
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure --prefix=/usr
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make check
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,208 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="automake"
# the version of this application
VERSION="1.16.5"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure --prefix=/usr --docdir=/usr/share/doc/${APPNAME}-${VERSION}
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make check
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,214 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
set -u
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="check"
# the version of this application
VERSION="0.15.2"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure \
--prefix=/usr \
--disable-static
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make check
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make \
docdir=/usr/share/doc/${APPNAME}-${VERSION} \
install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,233 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="coreutils"
# the version of this application
VERSION="9.1"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Pre-install patching..."
patch -Np1 -i ${PATCHES_DIR}/coreutils-9.1-i18n-1.patch
assert_zero $?
logprint "Preconfiguring ${APPNAME}..."
autoreconf -fiv
assert_zero $?
logprint "Configuring ${APPNAME}..."
FORCE_UNSAFE_CONFIGURE=1 ./configure \
--prefix=/usr \
--enable-no-install-program=kill,uptime
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
# TODO: reflow this so a separate process is running the tests as
# the tester user. needs far less fuckery.
logprint "Checking"
make NON_ROOT_USERNAME=tester check-root
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "FHS cleanup..."
mv -v /usr/bin/chroot /usr/sbin/
assert_zero $?
logprint "Updating manpage..."
mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
assert_zero $?
logprint "Updating manpage..."
sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,209 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="diffutils"
# the version of this application
VERSION="3.9"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure --prefix=/usr
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make check
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,219 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="elfutils"
# the version of this application
VERSION="0.188"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure \
--prefix=/usr \
--disable-debuginfod \
--enable-libdebuginfod=dummy
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make check
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing libelf only..."
make -C libelf install
assert_zero $?
install -vm644 config/libelf.pc /usr/lib/pkgconfig
assert_zero $?
logprint "Cleaning up..."
rm /usr/lib/libelf.a
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,218 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="findutils"
# the version of this application
VERSION="4.9.0"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
# using a more compliant FHS path
# - one option is /var/lib/findutils
# this is better than /var/lib/locate as it uses the real package
# name
# the FHS 3.0 standard explicitly states it expects /var/lib/misc to
# contain the locate.database however
# using the FHS 3.0 spec for now, but this could easily become:
# /var/lib/findutils
logprint "Configuring ${APPNAME}..."
./configure \
--prefix=/usr \
--localstatedir=/var/lib/misc
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
# TODO reflow this to do testing as test user
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,214 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="gawk"
# the version of this application
VERSION="5.2.1"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
# TODO turn this into a patch
logprint "Prework"
sed -i 's/extras//' Makefile.in
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure --prefix=/usr
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make check
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make LN='ln -f' install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,205 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="groff"
# the version of this application
VERSION="1.22.4"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
PAGE=letter ./configure --prefix=/usr
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,221 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# TODO integrate BLFS instructions for UEFI support for grub
# as this will not provide that:
# https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/grub-efi.html
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="grub"
# the version of this application
VERSION="2.06"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Unsetting some vars..."
unset {C,CPP,CXX,LD}FLAGS
unset MAKEFLAGS
logprint "Configuring ${APPNAME}..."
CC=gcc ./configure \
--prefix=/usr \
--sysconfdir=/etc \
--disable-efiemu \
--disable-werror
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Installing bash completion profile..."
mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions/
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,218 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="intltool"
# the version of this application
VERSION="0.51.0"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprin "Prework"
# TODO turn this into a patch
sed -i 's:\\\${:\\\$\\{:' intltool-update.in
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure --prefix=/usr
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make check
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Installing docs..."
install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/${APPNAME}-${VERSION}/I18N-HOWTO
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,222 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="kmod"
# the version of this application
VERSION="30"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-openssl \
--with-xz \
--with-zstd \
--with-zlib
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
# this ordering needs reflowed at some point to have the raw kernel headers present so the test suite can run
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Post-install Legacy Compatibility (Module-Init-Tools)"
for target in depmod insmod modinfo modprobe rmmod; do
ln -sfv ../bin/kmod /usr/sbin/$target
assert_zero $?
done
ln -sfv kmod /usr/bin/lsmod
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,213 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="libffi"
# the version of this application
VERSION="3.4.4"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
# TODO For target systems that differ from host/build arch, --with-gcc-arch= value needs parameterized
logprint "Configuring ${APPNAME}..."
./configure \
--prefix=/usr \
--disable-static \
--with-gcc-arch=native
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make check
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,212 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="meson"
# the version of this application
VERSION="1.0.0"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
pip3 wheel -w dist --no-build-isolation --no-deps $PWD
assert_zero $?
# TODO rework ordering so the test suites can be executed
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
pip3 install --no-index --find-links dist meson
assert_zero $?
logprint "Installing bash completion profile..."
install -vDm644 data/shell-completions/bash/meson /usr/share/bash-completion/completions/meson
assert_zero $?
logprint "Installing zsh completion profile..."
install -vDm644 data/shell-completions/zsh/_meson /usr/share/zsh/site-functions/_meson
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,227 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="ninja"
# the version of this application
VERSION="1.11.1"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Prework..."
NINJAJOBS=$(nproc)
sed -i '/int Guess/a \
int j = 0;\
char* jobs = getenv( "NINJAJOBS" );\
if ( jobs != NULL ) j = atoi( jobs );\
if ( j > 0 ) return j;\
' src/ninja.cc
assert_zero $?
logprint "Building ${APPNAME}..."
python3 configure.py --bootstrap
assert_zero $?
logprint "Testing..."
./ninja ninja_test
logprint "Check compilation exited with '$?'. "
logprint "Testing..."
./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
logprint "Check compilation exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
install -vm755 ninja /usr/bin/
assert_zero $?
logprint "Installing bash completion profile..."
install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
assert_zero $?
logprint "Installing zsh completion profile..."
install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,226 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="openssl"
# the version of this application
VERSION="3.0.8"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
./config \
--prefix=/usr \
--openssldir=/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make test
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Pre-install adjustment to Makefile"
# The reasoning for this change needs explicitly called out
sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile
assert_zero $?
logprint "Installing..."
make MANSUFFIX=ssl install
assert_zero $?
logprint "Moving docs to standardized dir structure..."
mv -v /usr/share/doc/${APPNAME} /usr/share/doc/${APPNAME}-${VERSION}
logprint "Installing additional optional documentation..."
cp -vfr doc/* /usr/share/doc/${APPNAME}-${VERSION}
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,225 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="perl"
# the version of this application
VERSION="5.36.0"
SVERSION="$(cut -d '.' -f 1 <<< "$VERSION")"."$(cut -d '.' -f 2 <<< "$VERSION")"
BUILD_ZLIB=False
BUILD_BZIP2=0
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
sh Configure -des \
-Dprefix=/usr \
-Dvendorprefix=/usr \
-Dprivlib=/usr/lib/perl5/${SVERSION}/core_perl \
-Darchlib=/usr/lib/perl5/${SVERSION}/core_perl \
-Dsitelib=/usr/lib/perl5/${SVERSION}/site_perl \
-Dsitearch=/usr/lib/perl5/${SVERSION}/site_perl \
-Dvendorlib=/usr/lib/perl5/${SVERSION}/vendor_perl \
-Dvendorarch=/usr/lib/perl5/${SVERSION}/vendor_perl \
-Dman1dir=/usr/share/man/man1 \
-Dman3dir=/usr/share/man/man3 \
-Dpager="/usr/bin/less -isR" \
-Duseshrplib \
-Dusethreads
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make test
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,225 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="Python"
# the version of this application
VERSION="3.11.2"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
./configure \
--prefix=/usr \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--enable-optimizations
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Configuring pip to suppress some warnings"
cp -vf ${CONFIGS_DIR}/etc_pip.conf /etc/pip.conf
assert_zero $?
logprint "Installing documentation..."
install -v -dm755 /usr/share/doc/python-${VERSION}/html
tar \
--strip-components=1 \
--no-same-owner \
--no-same-permissions \
-C /usr/share/doc/python-${VERSION}/html \
-xvf ${SOURCES_DIR}/python-${VERSION}-docs-html.tar.*
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,201 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="wheel"
# the version of this application
VERSION="0.38.4"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Compiling..."
PYTHONPATH=src pip3 wheel -w dist --no-build-isolation --no-deps $PWD
assert_zero $?
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
pip3 install --no-index --find-links=dist wheel
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -0,0 +1,209 @@
#!/bin/bash
# desc:
# stages, builds, installs
# make variables persist in subprocesses for logging function
set -a
# ----------------------------------------------------------------------
# Configuration:
# ----------------------------------------------------------------------
# the name of this application
APPNAME="XML-Parser"
# the version of this application
VERSION="2.46"
# ----------------------------------------------------------------------
# Variables and functions sourced from Environment:
# ----------------------------------------------------------------------
# assert_zero()
# Checks if $1 is 0. If non-0 value, halts the execution of the script.
#
# LOGS_ROOT
# The parent directory where logs from this project will go.
#
# TEMP_STAGE_DIR
# The parent directory of where source archives are extracted to.
# register mode selections
ARGUMENT_LIST=(
"stage"
"build"
"install"
"all"
"help"
)
# modes to associate with switches
# assumes you want nothing done unless you ask for it.
MODE_STAGE=false
MODE_BUILD=false
MODE_INSTALL=false
MODE_ALL=false
MODE_HELP=false
# the file to log to
LOGFILE="${APPNAME}.log"
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
# the path where logs are written to
# note: LOGS_ROOT is sourced from environment
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
# the path where the source will be located when complete
# note: TEMP_STAGE_DIR is sourced from environment
T_SOURCE_DIR="${TEMP_STAGE_DIR}/${APPNAME}"
# read defined arguments
opts=$(getopt \
--longoptions "$(printf "%s," "${ARGUMENT_LIST[@]}")" \
--name "$APPNAME" \
--options "" \
-- "$@"
)
# process supplied arguments into flags that enable execution modes
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--stage)
MODE_STAGE=true
shift 1
;;
--build)
MODE_BUILD=true
shift 1
;;
--install)
MODE_INSTALL=true
shift 1
;;
--all)
MODE_ALL=true
shift 1
;;
--help)
MODE_HELP=true
shift 1
;;
*)
break
;;
esac
done
# print to stdout, print to log
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
# Tell the user we're alive...
logprint "Initializing the ${APPNAME} utility..."
# when the stage mode is enabled, this will execute
mode_stage() {
logprint "Starting stage of ${APPNAME}..."
logprint "Removing any pre-existing staging for ${APPNAME}."
rm -Rf "${T_SOURCE_DIR}"*
logprint "Extracting ${APPNAME}-${VERSION} source archive to ${TEMP_STAGE_DIR}"
tar xf "${SOURCES_DIR}/${APPNAME}-${VERSION}.tar."* -C "${TEMP_STAGE_DIR}"
assert_zero $?
# conditionally rename if it needs it
stat "${T_SOURCE_DIR}-"* && mv "${T_SOURCE_DIR}-"* "${T_SOURCE_DIR}"
logprint "Staging operation complete."
}
# when the build_pass1 mode is enabled, this will execute
mode_build() {
# patch, configure and build
logprint "Starting build of ${APPNAME}..."
logprint "Entering build dir."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Configuring ${APPNAME}..."
perl Makefile.PL
assert_zero $?
logprint "Compiling..."
make
assert_zero $?
logprint "Checking"
make test
logprint "Checks exited with '$?'. "
logprint "Build operation complete."
}
mode_install() {
logprint "Starting install of ${APPNAME}..."
pushd "${T_SOURCE_DIR}"
assert_zero $?
logprint "Installing..."
make install
assert_zero $?
logprint "Install operation complete."
}
mode_help() {
echo "${APPNAME} [ --stage ] [ --build_temp ] [ --install_temp ] [ --all_temp ] [ --help ]"
exit 1
}
if [ "$MODE_ALL" = "true" ]; then
MODE_STAGE=true
MODE_BUILD=true
MODE_INSTALL=true
fi
# if no options were selected, then show help and exit
if \
[ "$MODE_HELP" != "true" ] && \
[ "$MODE_STAGE" != "true" ] && \
[ "$MODE_BUILD" != "true" ] && \
[ "$MODE_INSTALL" != "true" ]
then
logprint "No option selected during execution."
mode_help
fi
# if help was supplied at all, show help and exit
if [ "$MODE_HELP" = "true" ]; then
logprint "Help option selected. Printing options and exiting."
mode_help
fi
if [ "$MODE_STAGE" = "true" ]; then
logprint "Staging option selected."
mode_stage
assert_zero $?
fi
if [ "$MODE_BUILD" = "true" ]; then
logprint "Build of ${APPNAME} selected."
mode_build
assert_zero $?
fi
if [ "$MODE_INSTALL" = "true" ]; then
logprint "Install of ${APPNAME} selected."
mode_install
assert_zero $?
fi
logprint "Execution of ${APPNAME} completed."

View File

@ -5,6 +5,56 @@
"name": "welcome master",
"dependencies": [ null ],
"comment": "greet the user"
},
{
"name": "wheel",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.51"
},
{
"name": "ninja",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.52"
},
{
"name": "meson",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.53"
},
{
"name": "coreutils pass 2",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.54"
},
{
"name": "check",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.55"
},
{
"name": "diffutils",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.56"
},
{
"name": "gawk pass 2",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.57"
},
{
"name": "findutils pass 2",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.58"
},
{
"name": "groff",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.59"
},
{
"name": "grub",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.60"
}
]
}

View File

@ -200,6 +200,56 @@
"name": "less",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.40"
},
{
"name": "perl pass 2",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.41"
},
{
"name": "xml parser",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.42"
},
{
"name": "intltool",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.43"
},
{
"name": "autoconf",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.44"
},
{
"name": "automake",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.45"
},
{
"name": "openssl",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.46"
},
{
"name": "kmod",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.47"
},
{
"name": "elfutils",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.48"
},
{
"name": "libffi",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.49"
},
{
"name": "python pass 2",
"dependencies": [ null ],
"comment": "LFS 11.3-systemd-rc1 Ch. 8.50"
}
]
}

View File

@ -1,22 +1,202 @@
{
"units": [
{
"name": "welcome master",
"target": "components/master/welcome.bash",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
}
]
"units": [
{
"name": "welcome master",
"target": "components/master/welcome.bash",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "wheel",
"target": "components/stage4/wheel.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "ninja",
"target": "components/stage4/ninja.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "meson",
"target": "components/stage4/meson.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "coreutils pass 2",
"target": "components/stage4/coreutils.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "check",
"target": "components/stage4/check.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "diffutils",
"target": "components/stage4/diffutils.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "gawk pass 2",
"target": "components/stage4/gawk.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "findutils pass 2",
"target": "components/stage4/findutils.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "groff",
"target": "components/stage4/groff.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "grub",
"target": "components/stage4/grub.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
}
]
}

View File

@ -719,6 +719,186 @@
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
}
},
{
"name": "perl pass 2",
"target": "components/stage4/perl.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "xml parser",
"target": "components/stage4/xml-parser.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "intltool",
"target": "components/stage4/intltool.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "autoconf",
"target": "components/stage4/autoconf.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "automake",
"target": "components/stage4/automake.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "openssl",
"target": "components/stage4/openssl.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "kmod",
"target": "components/stage4/kmod.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "elfutils",
"target": "components/stage4/elfutils.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "libffi",
"target": "components/stage4/libffi.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
},
{
"name": "python pass 2",
"target": "components/stage4/python.bash --all",
"is_shell_command": true,
"shell_definition": "bash",
"force_pty": true,
"set_working_directory": false,
"working_directory": "",
"rectify": false,
"rectifier": "",
"active": true,
"required": true,
"set_user_context": true,
"user": "root",
"group": "root",
"supply_environment": true,
"environment": "environments/stage4.env.bash"
}
]
}