- copy build scripts from "TDE_SRC/1_git/tde-packaging/debian/_buildscripts/local/scripts" to "TDE_SRC/buildscripts"
- copy build scripts from "TDE_DIR/1_git/tde-packaging/debian/_buildscripts/local/buildscripts" to "TDE_DIR/buildscripts"
- cd "TDE_SRC/buildscripts"
and make sure all shell scripts are executable
- cp _build_config_template.sh build_config.sh
- cd "TDE_DIR/buildscripts"
- edit "build_config.sh" to set your preferences and check that the various folder names match the structure on your disk.
- cp ./internals/_config_template.sh _config.sh
Make sure to set the variable TDE_SRC to the correct path and the variables DISTRO, DISTRO_NAME and ARCHITECTURE to
- edit "_config.sh" to set your preferences and check that the various folder names match the structure on your disk.
Make sure to set the variable TDE_DIR to the correct path and the variables DISTRO, DISTRO_NAME and ARCHITECTURE to
match the distro and architecture you want to build for.
match the distro and architecture you want to build for.
@ -81,52 +84,46 @@ A) Environment preparation
B) Notes about scripts
B) Notes about scripts
----------------------
----------------------
1) * Notes *
1) * Notes *
Modules are built using the build_module.sh script. After the build is completed, the installation .deb files are located in TDE_SRC/2_build/debs/<MODULE NAME>/ and the source code and build reports in TDE_SRC/2_build/debs/<MODULE NAME>/src/
Modules are built using the build_module.sh script. After the build is completed, the installation .deb files are located in TDE_DIR/2_build/debs/<MODULE NAME>/ and the source code and build reports in TDE_DIR/2_build/debs/<MODULE NAME>/src/
The source code can be either the git repo or a local copy in TDE_SRC/2_build/build/<MODULE NAME>.
The source code can be either the git repo or a local copy in TDE_DIR/2_build/build/<MODULE NAME>.
A module can be built in a clean chroot environment using pbuilder (default option) or locally using dpkg-buildpackage (useful for quick debugging/developing).
A module can be built in a clean chroot environment using pbuilder (default option) or locally using dpkg-buildpackage (useful for quick debugging/developing).
When using pbuilder, a hook can be used to invoke a shell when the build fails.
When using pbuilder, a hook can be used to invoke a shell when the build fails.
Build logs are automatically stored to files, but can also be displayed during the build process.
Build logs are automatically stored to files, but can also be displayed during the build process.
The default location of a module build log is TDE_SRC/2_build/debs/<MODULE NAME>/src/__build__.log
The default location of a module build log is TDE_DIR/2_build/debs/<MODULE NAME>/src/__build__.log
When building sets of modules or the whole TDE, a global build summary is automatically stored to TDE_SRC/0_logs/build_result.log to quickly check what built and what failed. It is recommended to delete that file before starting a new TDE build (if not, build results will be appended at the end of the file).
When building sets of modules or the whole TDE, a global build summary is automatically stored to TDE_DIR/0_logs/build_result.log to quickly check what built and what failed. It is recommended to delete that file before starting a new TDE build (if not, build results will be appended at the end of the file).
2) * Scripts description *
2) * Scripts description *
- scripts in 'internals' folder
Scripts used intenally by other scripts. No need for invoking these directly.
- update_git_repository.sh:
- update_git_repository.sh:
Scripts used to update the local clone of the git repositories.
Scripts used to update the local clone of the git repositories.
Usage:
Usage:
update_git_repository.sh
update_git_repository.sh
- build_module.sh: build a single module
- build_module.sh
Build a single module.
Usage:
Usage:
build_module.sh [options] module_name
build_module.sh [options] module_name
Options:
Options:
-g (Git) : build from git repo sources. If missing, build from the local copy in build folder.
-g (Git) : build from git repo sources. If missing, build from the local copy in build folder.
-l (Local) : build the module locally. If missing, build in a clean chroot environment
-l (Local) : build the module locally. If missing, build in a clean chroot environment
-sl (Show Log) : output the building logs to terminal while the build is ongoing
-sl (Show Log) : output the building logs to terminal while the build is ongoing
-lr (Log Result) : log (append) build result (OK, FAILED) to TDE_SRC/0_logs/build_result.log file
-lr (Log Result) : log (append) build result (OK, FAILED) to TDE_DIR/0_logs/build_result.log file
-sh (Shell Hook) : use a shell hook for failing builds, only valid if building using pbuilder (clean chroot environment)
-sh (Shell Hook) : use a shell hook for failing builds, only valid if building using pbuilder (clean chroot environment)
-po (Prepare Only): only prepare the source folder but do not build the module. Useful to prepare the source code before
-po (Prepare Only): only prepare the source folder but do not build the module. Useful to prepare the source code before
doing local changes/development. The module can then be built from the modified local folder
doing local changes/development. The module can then be built from the modified local folder
-d (Debug) : enable debug symbols if possible (debian/rules file must contain "RelWithDebInfo" for this to work)
-d (Debug) : enable debug symbols if possible (debian/rules file must contain "RelWithDebInfo" for this to work)
-ip (Internal Pbuilder): build using internal pbuilder mode (experimental)
-ip (Internal Pbuilder): build using internal pbuilder mode (experimental)
- _build_config_template.sh
Template file for building configuration. Will be copied into TDE_SRC/build_config.sh upon first execution, if not already
done when the environment was set up.
- _build_common.sh
Utility script containing common code. No need for invoking this directly.
- _build_set_common.sh
Utility script used to build sets of modules. No need for invoking this directly.
- <dd>_<set_name>.sh
- <dd>_<set_name>.sh
A number of scripts used to build sets of modules. Each script builds an individual set.
A number of scripts used to build sets of modules. Each script builds an individual set.
Modules are built from the git sources and the build result is automatically appended to
Modules are built from the git sources and the build result is automatically appended to
TDE_SRC/0_logs/build_result.log.
TDE_DIR/0_logs/build_result.log.
Usage:
Usage:
<dd>_<set_name>.sh [options] set_name
<dd>_<set_name>.sh [options] set_name
Options:
Options:
@ -141,7 +138,7 @@ The sets are logically grouped as "base system", "applications" and "others"
92_build_applications.sh : all TDE applications in 04_application_01.sh - 08_application_05.sh
92_build_applications.sh : all TDE applications in 04_application_01.sh - 08_application_05.sh
93_build_others.sh : all modules in 09_others_01.sh - 10_others_02.sh
93_build_others.sh : all modules in 09_others_01.sh - 10_others_02.sh
- build_TDE.sh
- 99_build_TDE.sh
Script used to build the whole TDE at once. Calls the dd_setname.sh set scripts in order.
Script used to build the whole TDE at once. Calls the dd_setname.sh set scripts in order.
Usage:
Usage:
build_TDE.sh [options]
build_TDE.sh [options]
@ -149,11 +146,11 @@ Script used to build the whole TDE at once. Calls the dd_setname.sh set scripts
-s N: if specified, skip first N sets from the list of sets
-s N: if specified, skip first N sets from the list of sets
- create_repo.sh
- create_repo.sh
Creates a local repository from the .deb files currently stored in TDE_SRC/2_build/debs. This repo can be used as installation repository, just add the following lines to /etc/apt/sources.list
Creates a local repository from the .deb files currently stored in TDE_DIR/2_build/debs.
# --- LOCAL TDE REPOSITORY ---
Usage:
deb [arch=<YOUR ARCH> trusted=yes] file:TDE_SRC/3_repo <YOUR DISTRO> main
create_repo.sh [options]
For example:
Options:
deb [arch=amd64 trusted=yes] file:/home/tde_src/3_repo/ buster main
-b (Backup) : create a backup of the existing repository in TDE_DIR/CFG_REPO_DIR.backup
3) * Building hooks *
3) * Building hooks *
@ -161,7 +158,7 @@ Hooks are available to execute ad-hoc code before and after the build process. F
There are two type of hooks:
There are two type of hooks:
- pre_build : applied before switching the module to quilt format and build
- pre_build : applied before switching the module to quilt format and build
- post_build: applied after the build (dpkg-buildpackage or pbuilder) has terminated
- post_build: applied after the build (dpkg-buildpackage or pbuilder) has terminated
To use a hook, create an executable script (pre_build.sh and/or post_build.sh) in the TDE_SRC/1_git/hooks/<MODULE NAME> folder. The scripts are executed in the build_module.sh environment, so have access to all the variables defined in that file. See the files in the "hook examples" folder for real usage samples.
To use a hook, create an executable script (pre_build.sh and/or post_build.sh) in the TDE_DIR/1_git/hooks/<MODULE NAME> folder. The scripts are executed in the build_module.sh environment, so have access to all the variables defined in that file. See the files in the "hook examples" folder for real usage samples.
@ -169,36 +166,42 @@ To use a hook, create an executable script (pre_build.sh and/or post_build.sh) i
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/buildscripts"
2) cd "TDE_DIR/buildscripts"
3) Update to latest git repository using
3) Update to latest git repository using
./update_git_repository.sh
./update_repositories.sh
Wait until "Update completed" is printed out. Check log in TDE_SRC/0_logs/ if you wish.
Wait until "Update completed" is printed out. Check log in TDE_DIR/0_logs/ if you wish.
4) Run "sudo pbuilder update" at the beginning of the day to update the base package to the latest version. This will speed up
4) Run "sudo pbuilder update" at the beginning of the day to update the base package to the latest version. This will speed up
the process when building several modules in sequence.
the process when building several modules in sequence.
5) Build modules as per your needs.
5) Build modules as per your needs. You don't need to use "sudo" directly since the scripts will do that automatically if
- If you are not root, you need to use sudo in front of each command.
required. Just type your sudo password when prompted to do so.
6) Create a local repository from the packages you have just built, to be used as installation repository.
Add the following lines to /etc/apt/sources.list and follow the usual way to install TDE.
# --- LOCAL TDE REPOSITORY ---
deb [arch=<YOUR ARCH> trusted=yes] file:TDE_DIR/3_repo <YOUR DISTRO> main
For example:
deb [arch=amd64 trusted=yes] file:/home/tde_src/3_repo buster main
Examples of real usage:
Examples of real usage:
4.1) build a single module
1) build a single module
- [sudo] ./build_module.sh -g -sl "dependencies/libr" -> build libr package. This is a good test to check
- ./build_module.sh -g -sl "dependencies/libr" -> build libr package. This is a good test to check
whether everything is working fine
whether everything is working fine
- [sudo] ./build_module.sh -g "tdelibs" -> build "tdelibs" from git sources in a clean chroot environment
- ./build_module.sh -g "tdelibs" -> build "tdelibs" from git sources in a clean chroot environment
- [sudo] ./build_module.sh -g -l -sl "applications/amarok" -> build "amarok" locally from git sources and
- ./build_module.sh -g -l -sl "applications/amarok" -> build "amarok" locally from git sources and
display building logs during building
display building logs during building
- [sudo] ./build_module.sh -sh -lr "tdebase" -> build "tdebase" from the local sources (in TDE_SRC/2_build/build/tdebase)
- ./build_module.sh -sh -lr "tdebase" -> build "tdebase" from the local sources (in TDE_DIR/2_build/build/tdebase)
in a clean chroot environment and launch a shell in case of building failure.
in a clean chroot environment and launch a shell in case of building failure.
Append the build result (OK, FAILED) to TDE_SRC/scripts/logs/build_result.log
Append the build result (OK, FAILED) to TDE_DIR/scripts/logs/build_result.log
- [sudo] ./build_module.sh -g -po "tdelibs" -> prepare "tdelibs" for building from git sources. Source code will be available
- ./build_module.sh -g -po "tdelibs" -> prepare "tdelibs" for building from git sources. Source code will be available
in TDE_SRC/2_build/build/tdelibs. After you have made changes to the source and
in TDE_DIR/2_build/build/tdelibs. After you have made changes to the source and
want to build the modified package, run './build_module.sh "tdelibs"'
want to build the modified package, run './build_module.sh "tdelibs"'
4.2) build a single set
2) build a single set
(optional) delete the TDE_SRC/0_logs/build_result.log file
(optional) delete the TDE_DIR/0_logs/build_result.log file
[sudo] ./01_base_01.sh : build this set.
./01_base_01.sh : build this set.
[sudo] ./03_base_03.sh -s 3 : build this set but skip the first 3 modules of the set.
./03_base_03.sh -s 3 : build this set but skip the first 3 modules of the set.
4.3) build all TDE
[sudo] ./build_TDE.sh : build all TDE
[sudo] ./build_TDE.sh -s 4 : build all TDE, but skip the first 4 sets
3) build all TDE
./99_build_TDE.sh : build all TDE
./99_build_TDE.sh -s 4 : build all TDE, but skip the first 4 sets