DEB build script: user is now required to copy the build scripts to a

local folder

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/3/head
Michele Calgaro 7 years ago
parent 1da1d03f8d
commit f7fed43409

@ -12,9 +12,7 @@ C) How to use the scripts
* You can use the file ".pbuilderrc" from following point 2) - it is recommended to update the mirror to use * You can use the file ".pbuilderrc" from following point 2) - it is recommended to update the mirror to use
with one near you. with one near you.
* Create the folder "/var/cache/pbuilder/repo" * Create the folder "/var/cache/pbuilder/repo"
* Create base package with the command: 2) copy files from "additional files" folder to respectivily named folder.
DIST=<your distro> pbuilder --create
2) copy files from "additional files" folder to respective folder.
"user_home_folder" is the user home folder path. "user_home_folder" is the user home folder path.
3) Create base package with the command: 3) Create base package with the command:
DIST=<your distro> pbuilder --create DIST=<your distro> pbuilder --create
@ -24,6 +22,7 @@ C) How to use the scripts
1_git : contains the git repo clones and build hook scripts 1_git : contains the git repo clones and build hook scripts
2_build: folder used for build preparation and for local builds 2_build: folder used for build preparation and for local builds
3_repo : local repo for package installation (to be configured in /etc/apt/sources.list) 3_repo : local repo for package installation (to be configured in /etc/apt/sources.list)
buildscripts: contains a local copy of the build scripts, which can be modified as required
- in TDE_SRC/1_git: - in TDE_SRC/1_git:
== SKIP TEMPORARILY == == SKIP TEMPORARILY ==
edeps : contains extra dependency modules necessary to build TDE edeps : contains extra dependency modules necessary to build TDE
@ -52,9 +51,12 @@ C) How to use the scripts
TDE_SRC/2_build/debs/edeps/<MODULE NAME>/ TDE_SRC/2_build/debs/edeps/<MODULE NAME>/
== TEMPORARILY ONLY END == == TEMPORARILY ONLY END ==
7) cd "TDE_SRC/1_git/tde-packaging/debian/_buildscripts/local/scripts/" 7) - copy build scripts from "TDE_SRC/1_git/tde-packaging/debian/_buildscripts/local/scripts" to
./update_git_repository.sh -> the very first time this will create the TDE_SRC/build_config.sh file. "TDE_SRC/buildscripts"
Edit the file to match your preferences. - cd "TDE_SRC/buildscripts"
- ./update_git_repository.sh
-> the very first time this will create the TDE_SRC/buildscripts/build_config.sh file.
Edit the file to match your preferences and make sure to set TDE_DIR to your TDE_SRC folder.
B) Notes about scripts B) Notes about scripts
@ -145,7 +147,7 @@ To use a hook, just create an executable pre_build.sh and/or post_build.sh scrip
C) How to use the scripts C) How to use the scripts
--------------------------- ---------------------------
1) Follow the steps in section "A) Environment preparation" (only required the first time) 1) Follow the steps in section "A) Environment preparation" (only required the first time)
2) cd "TDE_SRC/1_git/tde-packaging/debian/_buildscripts/local/scripts/" 2) cd "TDE_SRC/buildscripts"
3) ./update_git_repository.sh -> update git repository, wait until "Update completed" is printed out. 3) ./update_git_repository.sh -> update git repository, wait until "Update completed" is printed out.
Check log in TDE_SRC/0_logs/ if you wish Check log in TDE_SRC/0_logs/ if you wish
4) Run "pbuilder update" at the beginning of the day to update the base package to the latest version. This will speed up 4) Run "pbuilder update" at the beginning of the day to update the base package to the latest version. This will speed up

@ -37,28 +37,9 @@ function init_common()
{ {
# Check script folder # Check script folder
SCRIPT_DIR=$(dirname $(readlink -f "$0")) SCRIPT_DIR=$(dirname $(readlink -f "$0"))
cd $SCRIPT_DIR
BASE_DIR=${PWD##*/}
if [ "$BASE_DIR" != "scripts" ]; then
echo "This script can only be run from the script directory."
exit 1
fi
#----------------------------
# TDE source folder
cd `git rev-parse --show-toplevel`
CURR_DIR=${PWD##*/}
if [ "$CURR_DIR" != "tde-packaging" ]; then
echo "Something wrong with folder structure.\nThis script should be located in the tde-packaging directory."
exit 1
fi
cd ../..
TDE_DIR=$PWD
cd $SCRIPT_DIR
#----------------------------
# Read config settings # Read config settings
CFG_FILE=$TDE_DIR/build_config.sh CFG_FILE=$SCRIPT_DIR/build_config.sh
if [ -f "$CFG_FILE" ]; then if [ -f "$CFG_FILE" ]; then
. "$CFG_FILE" . "$CFG_FILE"
else else
@ -66,8 +47,38 @@ function init_common()
echo "Creating TDE build configuration file from template as $CFG_FILE." echo "Creating TDE build configuration file from template as $CFG_FILE."
echo "Please check and modify as required, then rerun this script." echo "Please check and modify as required, then rerun this script."
cp "$SCRIPT_DIR/_build_config_template.sh" "$CFG_FILE" cp "$SCRIPT_DIR/_build_config_template.sh" "$CFG_FILE"
exit 0 exit 1
fi fi
# TDE root folder must exist
if [ ! -d "$TDE_DIR" ]; then
echo -e "${CYellow} --- ERROR ---${CNone}"
echo "A valid TDE root folder could not be located. Something is wrong with your configuration"
echo "in the config file $CFG_FILE"
echo "Please check and modify the TDE_DIR variable as required, then rerun this script."
exit 2
fi
# Search for main TDE repo
cd "$TDE_DIR/$CFG_GIT_TDE_MAIN" &>/dev/null
CURR_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
if [ -z "$CURR_DIR" ]; then
echo -e "${CYellow} --- ERROR ---${CNone}"
echo "Main TDE repo could not be located. Something is wrong with your configuration"
echo "in the config file $CFG_FILE"
echo "Please check and modify the TDE_DIR variable as required, then rerun this script."
exit 3
fi
# Search for TDE packaging repo
cd "$TDE_DIR/$CFG_GIT_TDE_PACKAGING" &>/dev/null
CURR_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
if [ -z "$CURR_DIR" ]; then
echo -e "${CYellow} --- ERROR ---${CNone}"
echo "TDE packaging repo could not be located. Something is wrong with your configuration"
echo "in the config file $CFG_FILE"
echo "Please check and modify the TDE_DIR variable as required, then rerun this script."
exit 4
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

@ -16,6 +16,8 @@ BUILD_DEFAULT_OPTIONS="-g -lr" # default building options (pbuilder)
#---------------------------- #----------------------------
# Base directories # Base directories
#---------------------------- #----------------------------
# TDE root folder
TDE_DIR=""
# Relative paths # Relative paths
CFG_SCRIPT_LOG_DIR="0_logs" CFG_SCRIPT_LOG_DIR="0_logs"
CFG_GIT_DIR="1_git" CFG_GIT_DIR="1_git"

Loading…
Cancel
Save