diff options
Diffstat (limited to 'debian/_buildscripts/local/internals')
6 files changed, 292 insertions, 281 deletions
diff --git a/debian/_buildscripts/local/internals/_build_common.sh b/debian/_buildscripts/local/internals/_build_common.sh index 105134084..0a17cb700 100755 --- a/debian/_buildscripts/local/internals/_build_common.sh +++ b/debian/_buildscripts/local/internals/_build_common.sh @@ -42,177 +42,197 @@ set +a # $3 - if "y" create a new file. function echo_and_tee() { - if [ "$3" = "y" ]; then - echo -e "$1" | tee /dev/tty | sed -r "s|\x1b\[[0-9]+(;[0-9]+)?m||g" >"$2" - else - echo -e "$1" | tee /dev/tty | sed -r "s|\x1b\[[0-9]+(;[0-9]+)?m||g" >>"$2" - fi + if [ "$3" = "y" ]; then + echo -e "$1" | tee /dev/tty | sed -r "s|\x1b\[[0-9]+(;[0-9]+)?m||g" >"$2" + else + echo -e "$1" | tee /dev/tty | sed -r "s|\x1b\[[0-9]+(;[0-9]+)?m||g" >>"$2" + fi } #---------------------------- function _set_path_variables() { - # Set useful path variables - set -a - - #-- get desired distribution and architecture - [[ "$DISTRO" = "" ]] && DISTRO=$(lsb_release -is | sed -e 's/\(.*\)/\L\1/') - [[ "$DISTRO_NAME" = "" ]] && DISTRO_NAME=$(lsb_release -cs | sed -e 's/\(.*\)/\L\1/') - [[ "$ARCHITECTURE" = "" ]] && ARCHITECTURE=$(dpkg --print-architecture) - - REPO_DIR="$TDE_DIR/$CFG_GIT_DIR" - REPO_TDE="$TDE_DIR/$CFG_GIT_DIR/tde" - REPO_TDE_MAIN="$REPO_TDE/main" - REPO_TDE_PACKAGING="$TDE_DIR/$CFG_GIT_DIR/tde/packaging/$DISTRO/$DISTRO_NAME" - REPO_EXTRA_DEPENDENCIES="$TDE_DIR/$CFG_GIT_DIR/$CFG_EXTRA_DEPS_DIR" - - BUILD_DIR="$TDE_DIR/$CFG_BUILD_DIR" - TDE_BUILD_DIR="$TDE_DIR/$CFG_BUILD_DIR/build" - TDE_DEBS_DIR="$TDE_DIR/$CFG_BUILD_DIR/debs" - - HOOK_DIR="$TDE_DIR/$CFG_GIT_DIR/$CFG_HOOKS_DIR" - + # Set useful path variables + set -a + + #-- get desired distribution and architecture + [[ "$DISTRO" = "" ]] && DISTRO=$(lsb_release -is | sed -e 's/\(.*\)/\L\1/') + [[ "$DISTRO_NAME" = "" ]] && DISTRO_NAME=$(lsb_release -cs | sed -e 's/\(.*\)/\L\1/') + [[ "$ARCHITECTURE" = "" ]] && ARCHITECTURE=$(dpkg --print-architecture) + + REPO_DIR="$TDE_DIR/$CFG_GIT_DIR" + if [ "${USE_GIT_WORKTREES}" = "y" ]; then + REPOS_DIR="$TDE_DIR/$CFG_GIT_DIR/repos" + WORKTREES_DIR="$TDE_DIR/$CFG_GIT_DIR/worktrees" + REPO_TDE="$WORKTREES_DIR/master/tde" + REPO_EXTRA_DEPENDENCIES="$WORKTREES_DIR/master/$CFG_EXTRA_DEPS_DIR" + else + REPO_TDE="$TDE_DIR/$CFG_GIT_DIR/tde" + REPO_EXTRA_DEPENDENCIES="$TDE_DIR/$CFG_GIT_DIR/$CFG_EXTRA_DEPS_DIR" + fi + REPO_TDE_MAIN="$REPO_TDE/main" + REPO_TDE_PACKAGING="$REPO_TDE/packaging/$DISTRO/$DISTRO_NAME" + + BUILD_DIR="$TDE_DIR/$CFG_BUILD_DIR" + TDE_BUILD_DIR="$BUILD_DIR/build" + TDE_DEBS_DIR="$BUILD_DIR/debs" + + HOOK_DIR="$TDE_DIR/$CFG_GIT_DIR/$CFG_HOOKS_DIR" + SCRIPT_LOG_DIR="$TDE_DIR/$CFG_SCRIPT_LOG_DIR" - LOG_BUILD_RESULT_FILENAME="$SCRIPT_LOG_DIR/build_result.log" # Common build logfile - LOG_UPDATE_REPO_FILENAME="$SCRIPT_LOG_DIR/update_repo.log" # Update repository logfile - set +a + LOG_BUILD_RESULT_FILENAME="$SCRIPT_LOG_DIR/build_result.log" # Common build logfile + LOG_UPDATE_REPO_FILENAME="$SCRIPT_LOG_DIR/update_repo.log" # Update repository logfile + + set +a } #---------------------------- function init_common() { - # Check script folder - export SCRIPT_DIR=$(dirname $(readlink -f "$0")) - - # Prevent the script to be run from TDE packaging repo - REPO_URL=$(git config --get remote.origin.url 2>/dev/null) - if [ ! -z "$REPO_URL" ] && [ -z "${REPO_URL##*tde/packaging}" ]; then - echo -e "${CLightRed} --- ERROR ---${CNone}" - echo "This script cannot be run from the TDE packaging repository." - echo "Please follow the instructions provided, then rerun this script." - exit 1 - fi - - # Read config settings - CFG_FILE=$SCRIPT_DIR/_config.sh - if [ -f "$CFG_FILE" ]; then - . "$CFG_FILE" - _set_path_variables - else - echo -e "${CLightRed} --- NOTE ---${CNone}" - echo -e "Creating TDE build configuration file from template as ${CLightPurple}$CFG_FILE${CNone}." - echo "Please check and modify as required, then rerun this script." - cp "$SCRIPT_DIR/internals/_config_template.sh" "$CFG_FILE" - exit 2 - fi - - # Make sure we have selected a supported distribution - DISTROS_FILE="$SCRIPT_DIR/internals/distro_list.txt" - if [ ! -f "$DISTROS_FILE" ]; then - echo -e "${CLightRed} --- ERROR ---${CNone}" - echo "Could not find the list of supported distributions." - echo -e "Please check the file ${CLightPurple}$DISTROS_FILE${CNone} exists, then rerun this script." - exit 3 - fi - # -- Need to use a "here string" otherwise if the DISTRO_FOUND value is modified - # -- inside the while loop, this would not remember after the loop. - DISTRO_FOUND="n" - OLD_IFS=$IFS && IFS=$' \t' - while read l_distro l_version l_name l_rel_suffix l_packaging_path; do - if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then - DISTRO_FOUND="y" - l_rel_suffix=`echo "$l_rel_suffix" | perl -pe "s|^[\"-]?(.*?)[\"]?$|\1|g"` - l_packaging_path=`echo "$l_packaging_path" | perl -pe "s|^[\"-]?(.*?)[\"]?$|\1|g"` - export DISTRO_VERSION="$l_version" - export REL_SUFFIX="$l_rel_suffix" - if [[ ! -z "$l_packaging_path" ]]; then - REPO_TDE_PACKAGING="$TDE_DIR/$CFG_GIT_DIR/tde/packaging/$l_packaging_path" - fi - break - fi - done <<< $(sed -n "s|\(^[\s]*[^#\s]\+.*$\)|\1|p" < $DISTROS_FILE) - IFS=$OLD_IFS - if [ "$DISTRO_FOUND" != "y" ]; then - echo -e "${CLightRed} --- ERROR ---${CNone}" - echo -e "The specified distribution (${CYellow}$DISTRO $DISTRO_NAME${CNone}) is not supported." - echo -e "Something is wrong with your configuration (${CLightPurple}$CFG_FILE${CNone})" - echo -e "or with the list of supported distributions (${CLightPurple}$DISTROS_FILE${CNone})." - echo -e "Please check the ${CLightCyan}DISTRO${CNone} and ${CLightCyan}DISTRO_NAME${CNone} variables, then rerun this script." - exit 4 - fi - - # TDE root folder must exist - if [ ! -d "$TDE_DIR" ]; then - echo -e "${CLightRed} --- ERROR ---${CNone}" - echo "A valid TDE root folder could not be located. Something is wrong with your configuration" - echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" - echo -e "Please check and modify the ${CLightCyan}TDE_DIR${CNone} variable as required, then rerun this script." - exit 5 - fi - - # Search for main TDE repo - CURR_DIR="" - [ -d "$REPO_TDE_MAIN" ] && cd "$REPO_TDE_MAIN" &>/dev/null && \ - CURR_DIR=$(git rev-parse --show-toplevel 2>/dev/null) - if [ -z "$CURR_DIR" ]; then - echo -e "${CLightRed} --- ERROR ---${CNone}" - echo "The main TDE repo could not be located. Something is wrong with your configuration" - echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" - echo -e "Please check and modify the ${CLightCyan}TDE_DIR${CNone} variable as required, then rerun this script." - exit 6 - fi - - # Check branch configuration - # - branch existance - UPDATE_BRANCHES="${OVERRIDE_UPDATE_BRANCHES:-$UPDATE_BRANCHES}" - cd "$REPO_TDE" - BRANCHES=() - REMOTE_BRANCHES=(`git branch --remote | grep -v "HEAD" | sed "s|origin/||g"`) - for br in $UPDATE_BRANCHES; do - branch=`echo "$br" | sed -e "s|^[[:space:]]*||" -e "s|[[:space:]]*$||"` - found=0 - for rem_br in "${REMOTE_BRANCHES[@]}"; do + local CURR_DIR=`pwd` + + # Check script folder + export SCRIPT_DIR=$(dirname $(readlink -f "$0")) + + # Prevent the script to be run from TDE packaging repo + REPO_URL=$(git config --get remote.origin.url 2>/dev/null) + if [ ! -z "$REPO_URL" ] && [ -z "${REPO_URL##*tde/packaging}" ]; then + echo -e "${CLightRed} --- ERROR ---${CNone}" + echo "This script cannot be run from the TDE packaging repository." + echo "Please follow the instructions provided, then rerun this script." + exit 1 + fi + + # Read config settings + CFG_FILE=$SCRIPT_DIR/_config.sh + if [ -f "$CFG_FILE" ]; then + . "$CFG_FILE" + _set_path_variables + else + echo -e "${CLightRed} --- NOTE ---${CNone}" + echo -e "Creating TDE build configuration file from template as ${CLightPurple}$CFG_FILE${CNone}." + echo "Please check and modify as required, then rerun this script." + cp "$SCRIPT_DIR/internals/_config_template.sh" "$CFG_FILE" + exit 2 + fi + + # Make sure we have selected a supported distribution + DISTROS_FILE="$SCRIPT_DIR/internals/distro_list.txt" + if [ ! -f "$DISTROS_FILE" ]; then + echo -e "${CLightRed} --- ERROR ---${CNone}" + echo "Could not find the list of supported distributions." + echo -e "Please check the file ${CLightPurple}$DISTROS_FILE${CNone} exists, then rerun this script." + exit 3 + fi + # -- Need to use a "here string" otherwise if the DISTRO_FOUND value is modified + # -- inside the while loop, this would not remember after the loop. + DISTRO_FOUND="n" + OLD_IFS=$IFS && IFS=$' \t' + while read l_distro l_version l_name l_rel_suffix l_packaging_path; do + if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then + DISTRO_FOUND="y" + l_rel_suffix=`echo "$l_rel_suffix" | perl -pe "s|^[\"-]?(.*?)[\"]?$|\1|g"` + l_packaging_path=`echo "$l_packaging_path" | perl -pe "s|^[\"-]?(.*?)[\"]?$|\1|g"` + export DISTRO_VERSION="$l_version" + export REL_SUFFIX="$l_rel_suffix" + if [[ ! -z "$l_packaging_path" ]]; then + REPO_TDE_PACKAGING="$TDE_DIR/$CFG_GIT_DIR/tde/packaging/$l_packaging_path" + fi + break + fi + done <<< $(sed -n "s|\(^[\s]*[^#\s]\+.*$\)|\1|p" < $DISTROS_FILE) + IFS=$OLD_IFS + if [ "$DISTRO_FOUND" != "y" ]; then + echo -e "${CLightRed} --- ERROR ---${CNone}" + echo -e "The specified distribution (${CYellow}$DISTRO $DISTRO_NAME${CNone}) is not supported." + echo -e "Something is wrong with your configuration (${CLightPurple}$CFG_FILE${CNone})" + echo -e "or with the list of supported distributions (${CLightPurple}$DISTROS_FILE${CNone})." + echo -e "Please check the ${CLightCyan}DISTRO${CNone} and ${CLightCyan}DISTRO_NAME${CNone} variables, then rerun this script." + exit 4 + fi + + # TDE root folder must exist + if [ ! -d "$TDE_DIR" ]; then + echo -e "${CLightRed} --- ERROR ---${CNone}" + echo "A valid TDE root folder could not be located. Something is wrong with your configuration" + echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" + echo -e "Please check and modify the ${CLightCyan}TDE_DIR${CNone} variable as required, then rerun this script." + exit 5 + fi + + # Search for TDE repo + found=0 + tde_config_file="" + if [ "${USE_GIT_WORKTREES}" = "y" ]; then + tde_config_file="$REPOS_DIR/tde.git/config" + else + tde_config_file="${REPO_TDE}/.git/config" + fi + [ -f "${tde_config_file}" ] && [ "`grep \"\\[core\\]\" ${tde_config_file}`" = "[core]" ] && found=1 + if [[ found -ne 1 ]]; then + echo -e "${CLightRed} --- ERROR ---${CNone}" + echo "The main TDE repo could not be located. Something is wrong with your configuration" + echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" + echo -e "Please check and modify the ${CLightCyan}TDE_DIR${CNone} and ${CLightCyan}USE_GIT_WORKTREES${CNone} variables as required." + echo -e "Then rerun this script." + exit 6 + fi + + # Check branch configuration + # - branch existance + UPDATE_BRANCHES="${OVERRIDE_UPDATE_BRANCHES:-$UPDATE_BRANCHES}" + if [ "${USE_GIT_WORKTREES}" = "y" ]; then + cd "$REPOS_DIR/tde.git" + else + cd "$REPO_TDE" + fi + BRANCHES=() + local REMOTE_BRANCHES=(`git branch --remote | grep -v "HEAD" | sed "s|origin/||g"`) + for br in $UPDATE_BRANCHES; do + branch=`echo "$br" | sed -e "s|^[[:space:]]*||" -e "s|[[:space:]]*$||"` + found=0 + for rem_br in "${REMOTE_BRANCHES[@]}"; do if [[ "$rem_br" == "$branch" ]]; then found=1 break fi done - if [[ found -eq 1 ]]; then - BRANCHES+=($branch) - else - echo -e "${CLightRed} --- ERROR ---${CNone}" - echo -e "Invalid branch specified (${CYellow}$branch${CNone}). Something is wrong with your configuration" - echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" - echo -e "Please check and modify the ${CLightCyan}UPDATE_BRANCHES${CNone} variable as required, then rerun this script." - exit 8 - fi - done - if [ ${#BRANCHES[@]} -eq 0 ]; then - echo -e "${CLightRed} --- ERROR ---${CNone}" - echo -e "No valid branch was specified. Something is wrong with your configuration" - echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" - echo -e "Please check and modify the ${CLightCyan}UPDATE_BRANCHES${CNone} variable as required, then rerun this script." - exit 9 - fi - export BRANCHES - # - default branch - DEFAULT_REPO_BRANCH=${OVERRIDE_DEFAULT_REPO_BRANCH:-"$DEFAULT_REPO_BRANCH"} - found=0 - for branch in "${BRANCHES[@]}"; do - if [[ "$DEFAULT_REPO_BRANCH" == "$branch" ]]; then - found=1 - break - fi - done - if [[ found -ne 1 ]]; then - echo -e "${CLightRed} --- ERROR ---${CNone}" - echo -e "Invalid default repo branch specified (${CYellow}$DEFAULT_REPO_BRANCH${CNone}). Something is wrong with your configuration" - echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" - echo -e "Please check and modify the ${CLightCyan}DEFAULT_REPO_BRANCH${CNone} variable as required, then rerun this script." - exit 10 - fi - - cd "$SCRIPT_DIR" + if [[ found -eq 1 ]]; then + BRANCHES+=($branch) + else + echo -e "${CLightRed} --- ERROR ---${CNone}" + echo -e "Invalid branch specified (${CYellow}$branch${CNone}). Something is wrong with your configuration" + echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" + echo -e "Please check and modify the ${CLightCyan}UPDATE_BRANCHES${CNone} variable as required, then rerun this script." + exit 8 + fi + done + if [ ${#BRANCHES[@]} -eq 0 ]; then + echo -e "${CLightRed} --- ERROR ---${CNone}" + echo -e "No valid branch was specified. Something is wrong with your configuration" + echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" + echo -e "Please check and modify the ${CLightCyan}UPDATE_BRANCHES${CNone} variable as required, then rerun this script." + exit 9 + fi + export BRANCHES + # - default branch + DEFAULT_REPO_BRANCH=${OVERRIDE_DEFAULT_REPO_BRANCH:-"$DEFAULT_REPO_BRANCH"} + found=0 + for branch in "${BRANCHES[@]}"; do + if [[ "$DEFAULT_REPO_BRANCH" == "$branch" ]]; then + found=1 + break + fi + done + if [[ found -ne 1 ]]; then + echo -e "${CLightRed} --- ERROR ---${CNone}" + echo -e "Invalid default repo branch specified (${CYellow}$DEFAULT_REPO_BRANCH${CNone}). Something is wrong with your configuration" + echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}" + echo -e "Please check and modify the ${CLightCyan}DEFAULT_REPO_BRANCH${CNone} variable as required, then rerun this script." + exit 10 + fi + + cd "${CURR_DIR}" } diff --git a/debian/_buildscripts/local/internals/_build_set_common.sh b/debian/_buildscripts/local/internals/_build_set_common.sh index 4bc1ea3e8..82e7e8bba 100755 --- a/debian/_buildscripts/local/internals/_build_set_common.sh +++ b/debian/_buildscripts/local/internals/_build_set_common.sh @@ -1,7 +1,8 @@ #!/bin/bash # Load common code and initialization -. ./internals/_build_common.sh +export SCRIPT_DIR=$(dirname $(readlink -f "$0")) +. ${SCRIPT_DIR}/internals/_build_common.sh init_common _BUILDSET_TIMER=1 @@ -52,7 +53,7 @@ function build_module() if [ $parm_SKIP_N -gt 0 -a $SKIP_cnt -lt $parm_SKIP_N ]; then SKIP_cnt=$((SKIP_cnt+1)) else - ./build_module.sh "$BUILD_DEFAULT_OPTIONS $@" + ./build_module.sh ${BUILD_DEFAULT_OPTIONS} "$@" echo fi } diff --git a/debian/_buildscripts/local/internals/_config_template.sh b/debian/_buildscripts/local/internals/_config_template.sh index 232d99799..7c1e929c6 100644 --- a/debian/_buildscripts/local/internals/_config_template.sh +++ b/debian/_buildscripts/local/internals/_config_template.sh @@ -5,8 +5,8 @@ set -a #---------------------------- # Repo information #---------------------------- -TDE_DIR="" # TDE root folder -UPDATE_BRANCHES="master" # Space separated list. Available choices: master, r14.0.x +TDE_DIR="" # TDE root folder +UPDATE_BRANCHES="master" # Space separated list. Available choices: master, r14.1.x DEFAULT_REPO_BRANCH="master" # After update in completed, switch repo to this branch. Must be # one of the branches specified in UPDATE_BRANCHES @@ -14,12 +14,12 @@ DEFAULT_REPO_BRANCH="master" # After update in completed, switch repo to th # Build information #---------------------------- TDE_RELEASE="14.1.0" # TDE release number -DISTRO="" # Distro family (leave empty for auto-detection). For ex. debian -DISTRO_NAME="" # Distro name of specific version (leave empty for auto-detection). For ex. buster -ARCHITECTURE="" # Build for this architecture (leave empty for auto-detection). For ex. amd64 +DISTRO="" # Distro family (leave empty for auto-detection). For ex. debian +DISTRO_NAME="" # Distro name of specific version (leave empty for auto-detection). For ex. buster +ARCHITECTURE="" # Build for this architecture (leave empty for auto-detection). For ex. amd64 USE_PREBUILD_EXTRA_DEPS="y" # If == "y", use pre-built extra dependency packages BUILD_DEFAULT_OPTIONS="-g -lr" # Default building options (pbuilder) -GPG_SIGN_KEYID="" # Use this GPG key to sign packages. If null, packages will not be signed +GPG_SIGN_KEYID="" # Use this GPG key to sign packages. If null, packages will not be signed #---------------------------- # Base directories @@ -28,7 +28,7 @@ CFG_SCRIPT_LOG_DIR="0_logs" CFG_GIT_DIR="1_git" CFG_BUILD_DIR="2_build" CFG_REPO_DIR="3_repo" -CFG_EXTRA_DEPS_DIR="edeps" # Relative to CFG_GIT_DIR folder. Only required if USE_PREBUILD_EXTRA_DEPS != "y" -CFG_HOOKS_DIR="hooks" # Relative to CFG_GIT_DIR folder +CFG_EXTRA_DEPS_DIR="edeps" # Relative to CFG_GIT_DIR folder. Only required if USE_PREBUILD_EXTRA_DEPS != "y" +CFG_HOOKS_DIR="hooks" # Relative to CFG_GIT_DIR folder set +a diff --git a/debian/_buildscripts/local/internals/_pbuilder.sh b/debian/_buildscripts/local/internals/_pbuilder.sh index 870758df0..b520a93af 100755 --- a/debian/_buildscripts/local/internals/_pbuilder.sh +++ b/debian/_buildscripts/local/internals/_pbuilder.sh @@ -2,110 +2,104 @@ function run_pdebuild() { - # pbuilder absolute paths - PBUILDER_HOOK_DIR="/var/cache/pbuilder/hooks" - PBUILDER_SHELL_HOOK_TEMPLATE="$SCRIPT_DIR/internals/C10shell" - PBUILDER_SHELL_HOOK="$PBUILDER_HOOK_DIR/C10shell" - PBUILDER_DEPS_HOOK="$PBUILDER_HOOK_DIR/D05deps" - - # Local option variables - # - internal pbuilder - OPT_INTERNAL_PBUILDER="" - if [ "$bool_INTERNAL_PBUILDER" = "y" ]; then - OPT_INTERNAL_PBUILDER="--use-pdebuild-internal" - fi - # Sign packages optino - OPT_SIGN_PKG_PBUILDER="" - if [ ! -z "$GPG_SIGN_KEYID" ]; then - OPT_SIGN_PKG_LOCAL="-k$GPG_SIGN_KEYID" - OPT_SIGN_PKG_PBUILDER="--auto-debsign --debsign-k $GPG_SIGN_KEYID" - fi - - ## Build module in a clean chroot environment using pbuilder - # Install/remove shell hook - if [ ! -d "$PBUILDER_HOOK_DIR" ]; then - mkdir -p "$PBUILDER_HOOK_DIR" - fi - if [ "$bool_SHELL_HOOK" = "y" ]; then - cp "$PBUILDER_SHELL_HOOK_TEMPLATE" "$PBUILDER_SHELL_HOOK" - chmod a+x "$PBUILDER_SHELL_HOOK" - else - if [ -x "$PBUILDER_SHELL_HOOK" ]; then - rm "$PBUILDER_SHELL_HOOK" - fi - fi - # Build using pbuilder - echo -e "${CYellow}> Building using pbuilder${CNone}" - # Create pbuilder hook to make sure all available packages are scanned - # Store any existing D05 hook as a temporary file, this will be reinstated at the end - cat <<END_D05_01 > "$PBUILDER_DEPS_HOOK" + # pbuilder absolute paths + PBUILDER_HOOK_DIR="/var/cache/pbuilder/hooks" + PBUILDER_SHELL_HOOK_TEMPLATE="$SCRIPT_DIR/internals/C10shell" + PBUILDER_SHELL_HOOK="$PBUILDER_HOOK_DIR/C10shell" + PBUILDER_DEPS_HOOK="$PBUILDER_HOOK_DIR/D05deps" + + # Sign packages optino + OPT_SIGN_PKG_PBUILDER="" + if [ ! -z "$GPG_SIGN_KEYID" ]; then + OPT_SIGN_PKG_LOCAL="-k$GPG_SIGN_KEYID" + OPT_SIGN_PKG_PBUILDER="--auto-debsign --debsign-k $GPG_SIGN_KEYID" + fi + + ## Build module in a clean chroot environment using pbuilder + # Install/remove shell hook + if [ ! -d "$PBUILDER_HOOK_DIR" ]; then + mkdir -p "$PBUILDER_HOOK_DIR" + fi + if [ "$bool_SHELL_HOOK" = "y" ]; then + cp "$PBUILDER_SHELL_HOOK_TEMPLATE" "$PBUILDER_SHELL_HOOK" + chmod a+x "$PBUILDER_SHELL_HOOK" + else + if [ -x "$PBUILDER_SHELL_HOOK" ]; then + rm "$PBUILDER_SHELL_HOOK" + fi + fi + # Build using pbuilder + echo -e "${CYellow}> Building using pbuilder${CNone}" + # Create pbuilder hook to make sure all available packages are scanned + # Store any existing D05 hook as a temporary file, this will be reinstated at the end + cat <<END_D05_01 > "$PBUILDER_DEPS_HOOK" #!/bin/sh (cd "$TDE_DEBS_DIR"; apt-ftparchive packages . > Packages) echo "deb [trusted=yes] file:$TDE_DEBS_DIR ./" >> /etc/apt/sources.list END_D05_01 - if [[ "$USE_PREBUILD_EXTRA_DEPS" = "y" ]]; then - # Get building branch from .tdescminfo file - if [[ -f "$MOD_BUILD_PATH/.tdescminfo" ]]; then - BUILD_BRANCH=`sed -n -r "s/^Revision: ([^-]+)-.*/\1/p" "$MOD_BUILD_PATH/.tdescminfo"` - bool_EDEPS_FOUND="n" - OLD_IFS=$IFS && IFS=$' \t' - while read l_branch l_repo l_component; do - if [ "$l_branch" = "$BUILD_BRANCH" ]; then - bool_EDEPS_FOUND="y" - cat <<END_D05_02 >> "$PBUILDER_DEPS_HOOK" + if [[ "$USE_PREBUILD_EXTRA_DEPS" = "y" ]]; then + # Get building branch from .tdescminfo file + if [[ -f "$MOD_BUILD_PATH/.tdescminfo" ]]; then + BUILD_BRANCH=`sed -n -r "s/^Revision: ([^-]+)-.*/\1/p" "$MOD_BUILD_PATH/.tdescminfo"` + bool_EDEPS_FOUND="n" + OLD_IFS=$IFS && IFS=$' \t' + while read l_branch l_repo l_component; do + if [ "$l_branch" = "$BUILD_BRANCH" ]; then + bool_EDEPS_FOUND="y" + cat <<END_D05_02 >> "$PBUILDER_DEPS_HOOK" echo "deb [trusted=yes] $l_repo $DISTRO_NAME $l_component" >> /etc/apt/sources.list END_D05_02 - break - fi - done <<< $(cat "$SCRIPT_DIR/internals/extra_deps.txt" | grep -E "^[[:space:]]*[^#[:space:]]+[[:space:]]+[^[:space:]]+.*$") - if [ "$bool_EDEPS_FOUND" != "y" ]; then - # EDEPS repository not found, use default. This could happen when building from sub branches of the main package repo - while read l_branch l_repo l_component; do - if [ "$l_branch" = "default" ]; then - bool_EDEPS_FOUND="y" - cat <<END_D05_02 >> "$PBUILDER_DEPS_HOOK" + break + fi + done <<< $(cat "$SCRIPT_DIR/internals/extra_deps.txt" | grep -E "^[[:space:]]*[^#[:space:]]+[[:space:]]+[^[:space:]]+.*$") + if [ "$bool_EDEPS_FOUND" != "y" ]; then + # EDEPS repository not found, use default. This could happen when building from sub branches of the main package repo + while read l_branch l_repo l_component; do + if [ "$l_branch" = "default" ]; then + bool_EDEPS_FOUND="y" + cat <<END_D05_03 >> "$PBUILDER_DEPS_HOOK" echo "deb [trusted=yes] $l_repo $DISTRO_NAME $l_component" >> /etc/apt/sources.list -END_D05_02 - break - fi - done <<< $(cat "$SCRIPT_DIR/internals/extra_deps.txt" | grep -E "^[[:space:]]*[^#[:space:]]+[[:space:]]+[^[:space:]]+.*$") - fi - IFS=$OLD_IFS - fi - fi - cat <<END_D05_03 >> "$PBUILDER_DEPS_HOOK" -apt-get update END_D05_03 - chmod a+x "$PBUILDER_DEPS_HOOK" - # Build - OPT_BUILD_PARALLEL="" - if [ ${DEB_BUILD_PARALLEL+x} ]; then - OPT_BUILD_PARALLEL="DEB_BUILD_PARALLEL=$DEB_BUILD_PARALLEL" - fi - eval pdebuild $OPT_INTERNAL_PBUILDER $OPT_SIGN_PKG_PBUILDER \ - --architecture $ARCHITECTURE \ - --buildresult \"$MOD_DEB_PATH\" \ - --pbuilderroot \"sudo $OPT_BUILD_PARALLEL DISTRO_NAME=$DISTRO_NAME ARCHITECTURE=$ARCHITECTURE\" \ - --logfile \"$BUILDING_LOG_FILE\" \ - -- \ - --bindmounts \"$TDE_DEBS_DIR\" \ - --hookdir \"$PBUILDER_HOOK_DIR\" \ - $OPT_SHOW_LOGS\"$BUILDING_LOG_FILE\" - PBUILDER_RETVAL=$? - # Remove shell hook if it was installed before the build - if [ -x "$PBUILDER_SHELL_HOOK" ]; then - rm "$PBUILDER_SHELL_HOOK" - fi - # Remove deps hook - if [ -x "$PBUILDER_DEPS_HOOK" ]; then - rm "$PBUILDER_DEPS_HOOK" - fi - # Return pdebuild return value to calling function - return $PBUILDER_RETVAL + break + fi + done <<< $(cat "$SCRIPT_DIR/internals/extra_deps.txt" | grep -E "^[[:space:]]*[^#[:space:]]+[[:space:]]+[^[:space:]]+.*$") + fi + IFS=$OLD_IFS + fi + fi + cat <<END_D05_04 >> "$PBUILDER_DEPS_HOOK" +apt-get update +END_D05_04 + chmod a+x "$PBUILDER_DEPS_HOOK" + # Build + OPT_BUILD_PARALLEL="" + if [ ${DEB_BUILD_PARALLEL+x} ]; then + OPT_BUILD_PARALLEL="DEB_BUILD_PARALLEL=$DEB_BUILD_PARALLEL" + fi + eval pdebuild $OPT_SIGN_PKG_PBUILDER \ + --architecture $ARCHITECTURE \ + --buildresult \"$MOD_DEB_PATH\" \ + --pbuilderroot \"sudo $OPT_BUILD_PARALLEL DISTRO_NAME=$DISTRO_NAME ARCHITECTURE=$ARCHITECTURE\" \ + --logfile \"$BUILDING_LOG_FILE\" \ + -- \ + --bindmounts \"$TDE_DEBS_DIR\" \ + --hookdir \"$PBUILDER_HOOK_DIR\" \ + $OPT_SHOW_LOGS\"$BUILDING_LOG_FILE\" + PBUILDER_RETVAL=$? + # Remove shell hook if it was installed before the build + if [ -x "$PBUILDER_SHELL_HOOK" ]; then + rm "$PBUILDER_SHELL_HOOK" + fi + # Remove deps hook + if [ -x "$PBUILDER_DEPS_HOOK" ]; then + rm "$PBUILDER_DEPS_HOOK" + fi + # Return pdebuild return value to calling function + return $PBUILDER_RETVAL } #---------------------------- # The actual code is inside a function to allow the pdebuild return value to be # correctly passed back to the calling script in all cases (root and non root users) -run_pdebuild
\ No newline at end of file +run_pdebuild diff --git a/debian/_buildscripts/local/internals/distro_list.txt b/debian/_buildscripts/local/internals/distro_list.txt index 84184c1b0..ba1dab204 100644 --- a/debian/_buildscripts/local/internals/distro_list.txt +++ b/debian/_buildscripts/local/internals/distro_list.txt @@ -10,31 +10,27 @@ # # debian -debian 7.0 wheezy - - -debian 8.0 jessie - - -debian 9.0 stretch - - -debian 10.0 buster - - -debian 11.0 bullseye ~a - -debian 12.0 sid ~b - +debian 10.0 buster - - +debian 11.0 bullseye - - +debian 12.0 bookworm - - +debian 13.0 trixie ~a - +debian 14.0 sid ~b - # devuan -devuan 1.0 jessie - debian/jessie -devuan 2.0 ascii - debian/stretch -devuan 3.0 beowulf - debian/buster -devuan 4.0 chimaera ~a debian/bullseye -devuan 5.0 ceres ~b debian/sid +devuan 3.0 beowulf - debian/buster +devuan 4.0 chimaera - debian/bullseye +devuan 5.0 daedalus ~a debian/bookwork +devuan 6.0 ceres ~b debian/sid # raspbian -raspbian 8.0 raspbian-jessie - - -raspbian 9.0 raspbian-stretch - - -raspbian 10.0 raspbian-buster - - -raspbian 11.0 raspbian-bullseye ~a - +raspbian 10.0 raspbian-buster - - +raspbian 11.0 raspbian-bullseye - - +raspbian 12.0 raspbian-bookworm ~a - # ubuntu -ubuntu 14.04 trusty - - -ubuntu 16.04 xenial - - -ubuntu 18.04 bionic - - -ubuntu 19.04 disco - - -ubuntu 19.10 eoan - - -ubuntu 20.04 focal - - -ubuntu 20.10 groovy ~a - +ubuntu 18.04 bionic - - +ubuntu 20.04 focal - - +ubuntu 22.04 jammy - - +ubuntu 22.10 kinetic - - +ubuntu 23.04 lunar - - +ubuntu 23.10 mantic ~a - diff --git a/debian/_buildscripts/local/internals/extra_deps.txt b/debian/_buildscripts/local/internals/extra_deps.txt index b19514d84..521b16d0c 100644 --- a/debian/_buildscripts/local/internals/extra_deps.txt +++ b/debian/_buildscripts/local/internals/extra_deps.txt @@ -5,5 +5,5 @@ EDEPS_REPO=" default http://mirror.ppa.trinitydesktop.org/trinity-testing deps master http://mirror.ppa.trinitydesktop.org/trinity-testing deps - r14.0.x http://mirror.ppa.trinitydesktop.org/trinity-sb deps-r14 + r14.1.x http://mirror.ppa.trinitydesktop.org/trinity-sb deps-r14 " |