DEB build scripts: fixed version numbering scheme. Added check to make

sure the selected distro and version is supported.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/3/head
Michele Calgaro 7 years ago
parent 80b6864a4c
commit 38aaa2667f

@ -90,6 +90,36 @@ function init_common()
exit 5 exit 5
fi fi
# Make sure we have selected a supported distribution
DISTS_FILE=$SCRIPT_DIR/distro_list.txt
if [ ! -f "$DISTS_FILE" ]; then
echo -e "${CYellow} --- NOTE ---${CNone}"
echo "Could not find the list of supported distributions."
echo "Please check the file $DISTS_FILE exists, then rerun this script."
exit 6
fi
export DISTRO_FOUND=${DISTRO_FOUND:-"n"}
if [ "$DISTRO_FOUND" != "y" ]; then
# 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.
while read l_distro l_version l_name l_rel_suffix; do
if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then
export DISTRO_FOUND="y"
export DISTRO_VERSION="$l_version"
export REL_SUFFIX="$l_rel_suffix"
break
fi
done <<< $(cat $DISTS_FILE | grep -E "^(\s*[^#\s]+\s+[^\s]+.*)$")
fi
if [ "$DISTRO_FOUND" != "y" ]; then
echo -e "${CYellow} --- NOTE ---${CNone}"
echo "The specified distribution ($DISTRO $DISTRO_NAME) is not supported."
echo "Something is wrong with your configuration ($CFG_FILE)"
echo "or with the list of supported distributions ($DISTS_FILE)."
echo "Please check the DISTRO and DISTRO_NAME variables, then rerun this script."
exit 7
fi
SCRIPT_LOG_DIR=$TDE_DIR/$CFG_SCRIPT_LOG_DIR SCRIPT_LOG_DIR=$TDE_DIR/$CFG_SCRIPT_LOG_DIR
LOG_RESULT_FILENAME="$SCRIPT_LOG_DIR/build_result.log" # Log result into the common build logfile LOG_RESULT_FILENAME="$SCRIPT_LOG_DIR/build_result.log" # Log result into the common build logfile

@ -4,9 +4,8 @@
# Build information # Build information
#---------------------------- #----------------------------
TDE_RELEASE="14.1.0" # TDE release number TDE_RELEASE="14.1.0" # TDE release number
DISTRO="debian" # Build for this distro DISTRO="debian" # Distro family
D_VERSION="buster" # Build for this distro version DISTRO_NAME="buster" # Distro name of specific version
REL_SUFFIX="~a" # Relative suffix for packages
ARCHITECTURE="amd64" # Build for this architecture ARCHITECTURE="amd64" # Build for this architecture
USE_LOCAL_BUILD_NUMBER="n" # If == "y", use local build numbering for modules USE_LOCAL_BUILD_NUMBER="n" # If == "y", use local build numbering for modules
BUILD_NUMBER="b001" # TDE build number BUILD_NUMBER="b001" # TDE build number
@ -24,7 +23,7 @@ CFG_GIT_DIR="1_git"
CFG_BUILD_DIR="2_build" CFG_BUILD_DIR="2_build"
CFG_REPO_DIR="3_repo" CFG_REPO_DIR="3_repo"
CFG_GIT_TDE_MAIN="$CFG_GIT_DIR/tde/main" CFG_GIT_TDE_MAIN="$CFG_GIT_DIR/tde/main"
CFG_GIT_TDE_PACKAGING="$CFG_GIT_DIR/tde-packaging/$DISTRO/$D_VERSION" CFG_GIT_TDE_PACKAGING="$CFG_GIT_DIR/tde-packaging/$DISTRO/$DISTRO_NAME"
CFG_GIT_EXTRA_DEPENDENCIES="$CFG_GIT_DIR/edeps" CFG_GIT_EXTRA_DEPENDENCIES="$CFG_GIT_DIR/edeps"
CFG_HOOK_DIR="$CFG_GIT_DIR/hooks" CFG_HOOK_DIR="$CFG_GIT_DIR/hooks"
#Absolute paths #Absolute paths

@ -286,7 +286,7 @@ if [ "$bool_EXTRADEP_MOD" != "y" -a "$bool_COPY_PKGING_FILES" = "y" ]; then
DATE=$(date -R) DATE=$(date -R)
GITUSER="$(git config --get user.name) <$(git config --get user.email)>" GITUSER="$(git config --get user.name) <$(git config --get user.email)>"
echo "$PKG_NAME ($REL-0$DISTRO$D_VERSION.$ADD_REL+$PKG_REL) $D_VERSION; urgency=low" > "$MOD_BUILD_PKGING_PATH/changelog" echo "$PKG_NAME ($REL-0$DISTRO$DISTRO_VERSION.$ADD_REL+$PKG_REL) $DISTRO_NAME; urgency=low" > "$MOD_BUILD_PKGING_PATH/changelog"
echo -e "\n * Automated git build\n\n -- $GITUSER $DATE\n" >> "$MOD_BUILD_PKGING_PATH/changelog" echo -e "\n * Automated git build\n\n -- $GITUSER $DATE\n" >> "$MOD_BUILD_PKGING_PATH/changelog"
cat "$GIT_TDE_PACKAGING/$MOD_NAME/debian/changelog" >> "$MOD_BUILD_PKGING_PATH/changelog" cat "$GIT_TDE_PACKAGING/$MOD_NAME/debian/changelog" >> "$MOD_BUILD_PKGING_PATH/changelog"
else else
@ -294,8 +294,8 @@ if [ "$bool_EXTRADEP_MOD" != "y" -a "$bool_COPY_PKGING_FILES" = "y" ]; then
if [ "$BUILD_DATE" = "" ]; then if [ "$BUILD_DATE" = "" ]; then
BUILD_DATE=`date +%Y%m%d+%H%M` BUILD_DATE=`date +%Y%m%d+%H%M`
fi fi
BUILD_VERSION="4:$TDE_RELEASE-${BUILD_NUMBER}+$BUILD_DATE" # Module build version number (quilt format) BUILDISTRO_NAME="4:$TDE_RELEASE-${BUILD_NUMBER}+$BUILD_DATE" # Module build version number (quilt format)
dch -b -v "$BUILD_VERSION" -D "$D_VERSION" -c "$MOD_BUILD_PKGING_PATH/changelog" "Autogenerated by building script" &>/dev/null dch -b -v "$BUILDISTRO_NAME" -D "$DISTRO_NAME" -c "$MOD_BUILD_PKGING_PATH/changelog" "Autogenerated by building script" &>/dev/null
fi fi
fi fi
@ -400,15 +400,15 @@ else
echo -e "${CYellow}> Building using pbuilder${CNone}" echo -e "${CYellow}> Building using pbuilder${CNone}"
if [ "$bool_SHOW_BUILD_LOGS" = "y" ]; then if [ "$bool_SHOW_BUILD_LOGS" = "y" ]; then
if [ "$bool_INTERNAL_PBUILDER" = "y" ]; then if [ "$bool_INTERNAL_PBUILDER" = "y" ]; then
pdebuild --use-pdebuild-internal --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$D_VERSION ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" pdebuild --use-pdebuild-internal --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$DISTRO_NAME ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE"
else else
pdebuild --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$D_VERSION ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" pdebuild --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$DISTRO_NAME ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE"
fi fi
else else
if [ "$bool_INTERNAL_PBUILDER" = "y" ]; then if [ "$bool_INTERNAL_PBUILDER" = "y" ]; then
pdebuild --use-pdebuild-internal --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$D_VERSION ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" &>"$BUILDING_LOG_FILE" pdebuild --use-pdebuild-internal --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$DISTRO_NAME ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" &>"$BUILDING_LOG_FILE"
else else
pdebuild --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$D_VERSION ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" &>"$BUILDING_LOG_FILE" pdebuild --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$DISTRO_NAME ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" &>"$BUILDING_LOG_FILE"
fi fi
fi fi
build_retval=$? build_retval=$?

@ -20,7 +20,7 @@ done
#---------------------------- #----------------------------
# Create/update TDE local debian repository # Create/update TDE local debian repository
echo -e "${CLightCyan}#### TDE local repository creation begin ####${CNone}" echo -e "${CLightCyan}#### TDE local repository creation begin ####${CNone}"
ARCH_PATH="dists/$D_VERSION/main/binary-$ARCHITECTURE" ARCH_PATH="dists/$DISTRO_NAME/main/binary-$ARCHITECTURE"
REPO_DIR="$TDE_DIR/$CFG_REPO_DIR" REPO_DIR="$TDE_DIR/$CFG_REPO_DIR"
REPO_DIR_BACKUP="$REPO_DIR.backup" REPO_DIR_BACKUP="$REPO_DIR.backup"
REPO_PKG_DIR="$REPO_DIR/$ARCH_PATH" REPO_PKG_DIR="$REPO_DIR/$ARCH_PATH"

@ -0,0 +1,31 @@
#!/bin/bash
# List of supported distributions
DISTROS="
debian 5.0 lenny
debian 6.0 squeeze
debian 7.0 wheezy
debian 8.0 jessie
debian 9.0 stretch
debian 10.0 buster ~a
debian 10.0 sid ~b
raspbian 7.0 raspbian-wheezy
raspbian 8.0 raspbian-jessie
ubuntu 10.04 lucid
ubuntu 10.10 maverick
ubuntu 11.04 natty
ubuntu 11.10 oneiric
ubuntu 12.04 precise
ubuntu 12.10 quantal
ubuntu 13.04 raring
ubuntu 13.10 saucy
ubuntu 14.04 trusty
ubuntu 14.10 utopic
ubuntu 15.04 vivid
ubuntu 15.10 wily
ubuntu 16.04 xenial
ubuntu 16.10 yakkety
ubuntu 17.04 zesty
ubuntu 17.10 artful
ubuntu 18.04 bionic ~a
"
Loading…
Cancel
Save