From 10a972bbd7ab75c6d3cd68ec3e30b8a70bf3b168 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 30 Jul 2018 22:49:19 +0900 Subject: DEB build scripts: - fixed support for Devuan Jessie. - dropped Sarge, Etch, Lenny, Lucid from list of supported distros. - added auto detection of distro, distro name and architecture. Signed-off-by: Michele Calgaro --- debian/_buildscripts/local/internals/_build_common.sh | 8 ++++++++ debian/_buildscripts/local/internals/_config_template.sh | 6 +++--- debian/_buildscripts/local/internals/_pbuilder.sh | 4 +++- debian/_buildscripts/local/internals/distro_list.txt | 6 ++---- 4 files changed, 16 insertions(+), 8 deletions(-) (limited to 'debian/_buildscripts/local/internals') diff --git a/debian/_buildscripts/local/internals/_build_common.sh b/debian/_buildscripts/local/internals/_build_common.sh index 8b048a635..28f3fb2bf 100755 --- a/debian/_buildscripts/local/internals/_build_common.sh +++ b/debian/_buildscripts/local/internals/_build_common.sh @@ -54,6 +54,12 @@ 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" @@ -111,6 +117,7 @@ function init_common() # -- 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" @@ -124,6 +131,7 @@ function init_common() break fi done <<< $(cat $DISTS_FILE | grep -E "^(\s*[^#\s]+\s+[^\s]+.*)$") + 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." diff --git a/debian/_buildscripts/local/internals/_config_template.sh b/debian/_buildscripts/local/internals/_config_template.sh index 00d25e315..232d99799 100644 --- a/debian/_buildscripts/local/internals/_config_template.sh +++ b/debian/_buildscripts/local/internals/_config_template.sh @@ -14,9 +14,9 @@ DEFAULT_REPO_BRANCH="master" # After update in completed, switch repo to th # Build information #---------------------------- TDE_RELEASE="14.1.0" # TDE release number -DISTRO="debian" # Distro family -DISTRO_NAME="buster" # Distro name of specific version -ARCHITECTURE="amd64" # Build for this architecture +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 diff --git a/debian/_buildscripts/local/internals/_pbuilder.sh b/debian/_buildscripts/local/internals/_pbuilder.sh index 931fba56f..d2b176ded 100755 --- a/debian/_buildscripts/local/internals/_pbuilder.sh +++ b/debian/_buildscripts/local/internals/_pbuilder.sh @@ -47,7 +47,8 @@ END_D05_01 # Get building branch from .tdescmrevision file if [[ -f "$MOD_BUILD_PATH/.tdescmrevision" ]]; then BUILD_BRANCH=`sed -r "s/([^-]+)-.*/\1/" "$MOD_BUILD_PATH/.tdescmrevision"` - while read l_branch l_repo l_component; do + OLD_IFS=$IFS && IFS=$' \t' + while read l_branch l_repo l_component; do if [ "$l_branch" = "$BUILD_BRANCH" ]; then cat <> "$PBUILDER_DEPS_HOOK" echo "deb [trusted=yes] $l_repo $DISTRO_NAME $l_component" >> /etc/apt/sources.list @@ -55,6 +56,7 @@ END_D05_02 break fi done <<< $(cat "$SCRIPT_DIR/internals/extra_deps.txt" | grep -E "^[[:space:]]*[^#[:space:]]+[[:space:]]+[^[:space:]]+.*$") + IFS=$OLD_IFS fi fi cat <> "$PBUILDER_DEPS_HOOK" diff --git a/debian/_buildscripts/local/internals/distro_list.txt b/debian/_buildscripts/local/internals/distro_list.txt index 9d2707e7b..3d6eb05ef 100644 --- a/debian/_buildscripts/local/internals/distro_list.txt +++ b/debian/_buildscripts/local/internals/distro_list.txt @@ -11,8 +11,7 @@ # DISTROS=" # -- debian -- - debian 5.0 lenny '' '' - debian 6.0 squeeze '' '' + debian 6.0 squeeze '' '' debian 7.0 wheezy '' '' debian 8.0 jessie '' '' debian 9.0 stretch '' '' @@ -28,8 +27,7 @@ DISTROS=" raspbian 8.0 raspbian-jessie '' '' raspbian 9.0 raspbian-stretch '' '' # -- ubuntu -- - ubuntu 10.04 lucid '' '' - ubuntu 10.10 maverick '' '' + ubuntu 10.10 maverick '' '' ubuntu 11.04 natty '' '' ubuntu 11.10 oneiric '' '' ubuntu 12.04 precise '' '' -- cgit v1.2.3