summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2018-01-05 18:08:33 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2018-05-28 14:46:58 +0900
commit1da1d03f8d107bff644797131bc997476d22ecc1 (patch)
tree9fc888e0cb05603dd4ed233a675a67cf4bc575ff
parent204867aa831b7de0c1faf4321c9767c868d2d577 (diff)
downloadtde-packaging-1da1d03f.tar.gz
tde-packaging-1da1d03f.zip
DEB build script: first commit, still work in progress although
functional. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rwxr-xr-xdebian/_buildscripts/local/scripts/01_base_01.sh24
-rwxr-xr-xdebian/_buildscripts/local/scripts/02_base_02.sh20
-rwxr-xr-xdebian/_buildscripts/local/scripts/03_base_03.sh19
-rwxr-xr-xdebian/_buildscripts/local/scripts/04_applications_01.sh23
-rwxr-xr-xdebian/_buildscripts/local/scripts/05_applications_02.sh29
-rwxr-xr-xdebian/_buildscripts/local/scripts/06_applications_03.sh29
-rwxr-xr-xdebian/_buildscripts/local/scripts/07_applications_04.sh36
-rwxr-xr-xdebian/_buildscripts/local/scripts/08_applications_05.sh34
-rwxr-xr-xdebian/_buildscripts/local/scripts/09_others_01.sh28
-rwxr-xr-xdebian/_buildscripts/local/scripts/10_others_02.sh11
-rwxr-xr-xdebian/_buildscripts/local/scripts/91_build_base.sh5
-rwxr-xr-xdebian/_buildscripts/local/scripts/92_build_applications.sh8
-rwxr-xr-xdebian/_buildscripts/local/scripts/93_build_others.sh4
-rw-r--r--debian/_buildscripts/local/scripts/README.txt175
-rwxr-xr-xdebian/_buildscripts/local/scripts/_build_common.sh109
-rw-r--r--debian/_buildscripts/local/scripts/_build_config_template.sh37
-rwxr-xr-xdebian/_buildscripts/local/scripts/_build_set_common.sh75
-rwxr-xr-xdebian/_buildscripts/local/scripts/_update_repositories-int.sh79
-rw-r--r--debian/_buildscripts/local/scripts/additional files/user_home_folder/.pbuilderrc149
-rwxr-xr-xdebian/_buildscripts/local/scripts/additional files/usr/lib/pbuilder/hooks/D05deps3
-rwxr-xr-xdebian/_buildscripts/local/scripts/additional files/usr/lib/pbuilder/hooks/__template_C10shell7
-rwxr-xr-xdebian/_buildscripts/local/scripts/build_TDE.sh89
-rwxr-xr-xdebian/_buildscripts/local/scripts/build_module.sh468
-rw-r--r--debian/_buildscripts/local/scripts/hook examples/applications/kaffeine/kaffeine-wizard.diff65
-rwxr-xr-xdebian/_buildscripts/local/scripts/hook examples/applications/kaffeine/pre_build.sh13
-rw-r--r--debian/_buildscripts/local/scripts/hook examples/tdebase/018_kate_save_all.diff37
-rwxr-xr-xdebian/_buildscripts/local/scripts/hook examples/tdebase/pre_build.sh16
-rw-r--r--debian/_buildscripts/local/scripts/hook examples/tdebase/tdebase-usesak.diff15
-rw-r--r--debian/_buildscripts/local/scripts/hook examples/tdelibs/038_placeholder.diff64
-rwxr-xr-xdebian/_buildscripts/local/scripts/hook examples/tdelibs/pre_build.sh13
-rwxr-xr-xdebian/_buildscripts/local/scripts/update_repositories.sh19
31 files changed, 1703 insertions, 0 deletions
diff --git a/debian/_buildscripts/local/scripts/01_base_01.sh b/debian/_buildscripts/local/scripts/01_base_01.sh
new file mode 100755
index 000000000..b8c00a6a1
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/01_base_01.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "dependencies/libr"
+build_module "dependencies/akode"
+build_module "dependencies/tqt3"
+build_module "dependencies/tqtinterface"
+build_module "dependencies/arts"
+build_module "dependencies/dbus-tqt"
+build_module "dependencies/dbus-1-tqt"
+build_module "dependencies/tqca-tls"
+build_module "dependencies/libart-lgpl"
+build_module "dependencies/avahi-tqt"
+build_module "dependencies/libcaldav"
+build_module "dependencies/libcarddav"
+build_module "tdelibs"
+build_module "libraries/libtdeldap"
+build_module "tdebase"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/02_base_02.sh b/debian/_buildscripts/local/scripts/02_base_02.sh
new file mode 100755
index 000000000..e36bf3ed1
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/02_base_02.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "dependencies/sip4-tqt"
+build_module "dependencies/tqscintilla"
+build_module "dependencies/python-tqt"
+build_module "libraries/python-trinity"
+build_module "libraries/pytdeextensions"
+build_module "tdebindings"
+build_module "tdeutils"
+build_module "tdemultimedia"
+build_module "tdeaccessibility"
+build_module "tdenetwork"
+build_module "tdeadmin"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/03_base_03.sh b/debian/_buildscripts/local/scripts/03_base_03.sh
new file mode 100755
index 000000000..61f1825f4
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/03_base_03.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "tdeartwork"
+build_module "tdegames"
+build_module "tdetoys"
+build_module "tdeedu"
+build_module "tdegraphics"
+build_module "tdepim"
+build_module "tdeaddons"
+build_module "tdesdk"
+build_module "tdevelop"
+build_module "tdewebdev"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/04_applications_01.sh b/debian/_buildscripts/local/scripts/04_applications_01.sh
new file mode 100755
index 000000000..104606515
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/04_applications_01.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "libraries/libkipi"
+build_module "libraries/libkdcraw"
+build_module "libraries/libkexiv2"
+build_module "libraries/kipi-plugins"
+build_module "applications/abakus"
+build_module "applications/amarok"
+build_module "applications/basket"
+build_module "applications/digikam"
+build_module "applications/dolphin"
+build_module "applications/filelight"
+build_module "applications/gtk3-tqt-engine"
+build_module "applications/gtk-qt-engine"
+build_module "applications/gwenview"
+build_module "applications/gwenview-i18n"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/05_applications_02.sh b/debian/_buildscripts/local/scripts/05_applications_02.sh
new file mode 100755
index 000000000..2245d43c6
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/05_applications_02.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "applications/k3b"
+build_module "applications/k3b-i18n"
+build_module "applications/k9copy"
+build_module "applications/kaffeine"
+build_module "applications/kaffeine-mozilla"
+build_module "applications/kasablanca"
+build_module "applications/katapult"
+build_module "applications/kbarcode"
+build_module "applications/kbfx"
+build_module "applications/kbibtex"
+build_module "applications/kbiff"
+build_module "applications/kbookreader"
+build_module "applications/kchmviewer"
+build_module "applications/kcmautostart"
+# LDAP packages
+build_module "libraries/libtdeldap"
+build_module "applications/kcmldap"
+build_module "applications/kcmldapcontroller"
+build_module "applications/kcmldapmanager"
+build_module "applications/kerberostray"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/06_applications_03.sh b/debian/_buildscripts/local/scripts/06_applications_03.sh
new file mode 100755
index 000000000..d6ad71ba6
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/06_applications_03.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "applications/kcpuload"
+build_module "applications/kdbg"
+build_module "applications/kdbusnotification"
+build_module "applications/kdiff3"
+build_module "applications/kdirstat"
+build_module "applications/keep"
+build_module "applications/kftpgrabber"
+build_module "applications/kile"
+build_module "applications/kima"
+build_module "applications/kkbswitch"
+build_module "applications/klcddimmer"
+build_module "applications/kmplayer"
+build_module "applications/kmyfirewall"
+build_module "applications/kmymoney"
+build_module "applications/knemo"
+build_module "applications/knetload"
+build_module "applications/knetstats"
+build_module "applications/knmap"
+build_module "applications/knowit"
+build_module "applications/knutclient"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/07_applications_04.sh b/debian/_buildscripts/local/scripts/07_applications_04.sh
new file mode 100755
index 000000000..178c5f55f
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/07_applications_04.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "applications/koffice"
+build_module "applications/koffice-i18n"
+build_module "applications/keximdb"
+build_module "applications/konversation"
+build_module "applications/kooldock"
+build_module "applications/kopete-otr"
+build_module "applications/kpicosim"
+build_module "applications/kpilot"
+build_module "applications/kplayer"
+build_module "applications/krecipes"
+build_module "applications/krename"
+build_module "applications/krusader"
+build_module "applications/kscope"
+build_module "applications/ksensors"
+build_module "applications/kshowmail"
+build_module "applications/kshutdown"
+build_module "applications/ksplash-engine-moodin"
+build_module "applications/kstreamripper"
+build_module "applications/ksystemlog"
+build_module "applications/ktechlab"
+build_module "applications/ktorrent"
+build_module "applications/kuickshow"
+build_module "applications/kvirc"
+build_module "applications/kvkbd"
+build_module "applications/kvpnc"
+build_module "applications/kxmleditor"
+
+set_log_end
+
diff --git a/debian/_buildscripts/local/scripts/08_applications_05.sh b/debian/_buildscripts/local/scripts/08_applications_05.sh
new file mode 100755
index 000000000..bf69c9c87
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/08_applications_05.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "applications/mplayerthumbs"
+build_module "applications/qalculate-tde"
+build_module "applications/piklab"
+build_module "applications/potracegui"
+build_module "applications/soundkonverter"
+build_module "applications/tastymenu"
+build_module "applications/tde-guidance"
+build_module "applications/tdeio-apt"
+build_module "applications/tdeio-ftps"
+build_module "applications/tdeio-locate"
+build_module "applications/tdeio-umountwrapper"
+build_module "applications/tdenetworkmanager"
+build_module "applications/tdepowersave"
+build_module "applications/tderadio"
+build_module "applications/tde-style-baghira"
+build_module "applications/tde-style-domino"
+build_module "applications/tde-style-ia-ora"
+build_module "applications/tde-style-lipstik"
+build_module "applications/tde-style-qtcurve"
+build_module "applications/tde-systemsettings"
+build_module "applications/tdmtheme"
+build_module "applications/tork"
+build_module "applications/twin-style-crystal"
+build_module "applications/wlassistant"
+build_module "applications/yakuake"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/09_others_01.sh b/debian/_buildscripts/local/scripts/09_others_01.sh
new file mode 100755
index 000000000..0a4889772
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/09_others_01.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "applications/tdeio-sword"
+build_module "applications/bibletime"
+build_module "applications/desktop-effects-tde"
+build_module "applications/fusion-icon"
+build_module "metapackages/sudo-trinity"
+build_module "applications/kdpkg"
+build_module "applications/kerry"
+build_module "applications/kgtk-qt3"
+build_module "applications/tdesudo"
+build_module "applications/kiosktool"
+build_module "applications/knights"
+build_module "libraries/libksquirrel"
+build_module "applications/ksquirrel"
+build_module "applications/qt4-tqt-theme-engine"
+build_module "applications/rosegarden"
+build_module "applications/smartcardauth"
+build_module "applications/smb4k"
+build_module "applications/tdesvn"
+build_module "applications/tellico"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/10_others_02.sh b/debian/_buildscripts/local/scripts/10_others_02.sh
new file mode 100755
index 000000000..ea1d403bd
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/10_others_02.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+. ./_build_set_common.sh
+
+#----------------------------
+set_log_start
+
+build_module "tde-i18n"
+build_module "applications/compizconfig-backend-tdeconfig"
+
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/91_build_base.sh b/debian/_buildscripts/local/scripts/91_build_base.sh
new file mode 100755
index 000000000..42056ce41
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/91_build_base.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+./01_base_01.sh
+./02_base_02.sh
+./03_base_03.sh
diff --git a/debian/_buildscripts/local/scripts/92_build_applications.sh b/debian/_buildscripts/local/scripts/92_build_applications.sh
new file mode 100755
index 000000000..174464c41
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/92_build_applications.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+./04_applications_01.sh
+./05_applications_02.sh
+./06_applications_03.sh
+./07_applications_04.sh
+./08_applications_05.sh
+
diff --git a/debian/_buildscripts/local/scripts/93_build_others.sh b/debian/_buildscripts/local/scripts/93_build_others.sh
new file mode 100755
index 000000000..c1222f8b0
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/93_build_others.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+./09_others_01.sh
+./10_others_02.sh \ No newline at end of file
diff --git a/debian/_buildscripts/local/scripts/README.txt b/debian/_buildscripts/local/scripts/README.txt
new file mode 100644
index 000000000..6f57d3abc
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/README.txt
@@ -0,0 +1,175 @@
+ Index
+-------
+A) Environment preparation
+B) Notes about scripts
+C) How to use the scripts
+
+
+ A) Environment preparation
+----------------------------
+0) * NOTE *: you can change folder names, as long as you update the "build_config.sh" file accordingly after the first run.
+1) Install pbuilder and configure it (see https://wiki.ubuntu.com/PbuilderHowto for a detailed tutorial)
+ * You can use the file ".pbuilderrc" from following point 2) - it is recommended to update the mirror to use
+ with one near you.
+ * Create the folder "/var/cache/pbuilder/repo"
+ * Create base package with the command:
+ DIST=<your distro> pbuilder --create
+2) copy files from "additional files" folder to respective folder.
+ "user_home_folder" is the user home folder path.
+3) Create base package with the command:
+ DIST=<your distro> pbuilder --create
+4) create a base folder for TDE, hereafter referred to as TDE_SRC (for example ~/tde_src)
+5) create the following folders [ see NOTE at point 0) about folder names ]
+- in TDE_SRC: 0_logs : contains log files for repo update and global builds (more on this later)
+ 1_git : contains the git repo clones and build hook scripts
+ 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)
+- in TDE_SRC/1_git:
+== SKIP TEMPORARILY ==
+ edeps : contains extra dependency modules necessary to build TDE
+== SKIP END ==
+ hooks : contains build hook scripts to execute ad-hoc code before and after the building process.
+ Mainly used to apply patches automatically during the building process
+6) clone TDE git repositories:
+ - cd "TDE_SRC/1_git"
+ - clone tde repo : git clone http://scm.trinitydesktop.org/scm/git/tde
+ - clone tde packaging repo: git clone http://scm.trinitydesktop.org/scm/git/tde-packaging
+== SKIP TEMPORARILY ==
+ - download dependency modules from the official PPA:
+ https://quickbuild.pearsoncomputing.net/~trinity/+archive/trinity-nightly-build-dependencies/+packages
+ or from Slavek PPA (usually more recently updated):
+ https://quickbuild.pearsoncomputing.net/~slavek-banko/+archive/deps-r14/+packages
+ Make sure you select the correct modules for your distribution and copy them to TDE_SRC/1_git/extra-dependencies/<MODULE NAME>
+ Examples: TDE_SRC/1_git/extra-dependencies/libr, TDE_SRC/1_git/extra-dependencies/imlib, ...
+== SKIP END ==
+== TEMPORARILY ONLY ==
+ >>> @Slavek: if you have a better path for download, please let me know <<<
+ - download extra dependency .deb modules from the official PPA:
+ https://quickbuild.pearsoncomputing.net/~trinity/+archive/trinity-nightly-build-dependencies/+packages
+ or from Slavek PPA (usually more recently updated):
+ https://quickbuild.pearsoncomputing.net/~slavek-banko/+archive/deps-r14/+packages
+ and save them inside the folders
+ TDE_SRC/2_build/debs/edeps/<MODULE NAME>/
+== TEMPORARILY ONLY END ==
+
+7) cd "TDE_SRC/1_git/tde-packaging/debian/_buildscripts/local/scripts/"
+ ./update_git_repository.sh -> the very first time this will create the TDE_SRC/build_config.sh file.
+ Edit the file to match your preferences.
+
+
+ B) Notes about scripts
+------------------------
+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 in TDE_SRC/2_build/debs/<MODULE NAME>/src/
+
+The source can be either the git repo or a local copy in TDE_SRC/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 debugging/developing).
+When using pbuilder, a hook can be used to invoke a shell when the build fails (see also "known issues").
+
+Build logs are automatically stored to files, but can also be displayed during the build process.
+The location of a module build log is TDE_SRC/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).
+
+2) * Scripts description *
+- build_module.sh: build a single module
+ Usage:
+ build_module.sh [options] module_name
+ Options:
+ -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
+ -sl (Show Log) : output the building logs to terminal
+ -lr (Log Result) : log (append) build result (OK, FAILED) to TDE_SRC/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)
+ -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
+ -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
+
+- _build_config_template.sh
+Template file for building configuration. Will be copied into TDE_SRC/build_config.sh upon first execution
+
+- _build_common.sh
+Utility script containing common code. No need for invoking it directly.
+
+- _build_set_common.sh
+Utility script used to build sets of modules. No need for invoking it directly.
+
+- <dd>_<set_name>.sh
+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
+TDE_SRC/0_logs/build_result.log.
+ Usage:
+ <dd>_<set_name>.sh [options] set_name
+ Options:
+ -s N: if specified, skip first N modules from the set of modules
+
+The sets are logically grouped as "base system", "applications" and "others"
+== SKIP TEMPORARILY ==
+ 00_extradeps.sh : dependencies modules
+== SKIP END ==
+ 01_base_01.sh - 03_base_03.sh : TDE base system
+ 04_application_01.sh - 08_application_05.sh : application modules
+ 09_others_01.sh - 10_others_02.sh : other modules that either fail to build/install or that are somehow less used
+ 91_build_base.sh : whole TDE base system
+ 92_build_applications.sh : all TDE applications in 04_application_01.sh - 08_application_05.sh
+ 93_build_base.sh : all modules in 09_others_01.sh - 10_others_02.sh
+
+- build_TDE.sh
+Script used to build the whole TDE at once. Calls the dd_setname.sh set scripts in order.
+ Usage:
+ build_TDE.sh [options]
+ Options:
+ -s N: if specified, skip first N sets from the list of sets
+
+== SKIP TEMPORARILY: not yet provided ==
+- 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
+ # --- LOCAL TDE REPOSITORY ---
+ deb [arch=##your arch here (ex. amd64)## trusted=yes] file:TDE_SRC(full path, ex:/home/tde_src)/3_repo/dists/testing/main/binary-##your arch here (ex. amd64)## ./
+== SKIP END ==
+
+- update_git_repository.sh:
+Scripts used to update the local clone of the git repositories.
+ Usage:
+ update_git_repository.sh
+
+3) * Building hooks *
+Hooks are available to execute ad-hoc code before and after the build process. For example this is very useful to automatically apply patches.
+Currently there are two type of hooks:
+- pre_build : applied just before switching the module to quilt format and build
+- post_build: applied just after the build (dpkg-buildpackage or pbuilder) has terminated
+To use a hook, just create an executable pre_build.sh and/or post_build.sh script 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 variable defined in that file. See the files in the "hook examples" folder for real usage samples.
+
+
+ C) How to use the scripts
+---------------------------
+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/"
+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
+4) Run "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.
+
+Examples of real usage:
+
+4.1) build a single module
+* ./build_module.sh -g "tdelibs" -> build "tdelibs" from git sources in a clean chroot environment
+* ./build_module.sh -g -l -sl "applications/amarok" -> build "amarok" locally from git sources and
+ display building logs during building
+* ./build_module.sh -sh -lr "tdebase" -> build "tdebase" from the local sources (in TDE_SRC/2_build/build/tdebase)
+ 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
+* ./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
+ want to build the modified package, run './build_module.sh "tdelibs"'
+
+4.2) build a single set
+ (optional) delete the TDE_SRC/0_logs/build_result.log file
+ ./01_base_01.sh : build this set.
+ ./03_base_03.sh -s 3 : build this set but skip the first 3 modules (tdeartwork, tdegames, tdetoys)
+
+4.3) build all TDE
+ ./build_TDE.sh : build all TDE
+ ./build_TDE.sh -s 4 : build all TDE, but skip the first 4 sets
+
diff --git a/debian/_buildscripts/local/scripts/_build_common.sh b/debian/_buildscripts/local/scripts/_build_common.sh
new file mode 100755
index 000000000..41ca19cf9
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/_build_common.sh
@@ -0,0 +1,109 @@
+#!/bin/bash
+
+
+#----------------------------
+#----------------------------
+# Color table
+# Black 0;30 Dark Gray 1;30
+# Blue 0;34 Light Blue 1;34
+# Green 0;32 Light Green 1;32
+# Cyan 0;36 Light Cyan 1;36
+# Red 0;31 Light Red 1;31
+# Purple 0;35 Light Purple 1;35
+# Brown 0;33 Yellow 1;33
+# Light Gray 0;37 White 1;37
+# No Color 0
+CBlack='\e[0;30m'
+CDarkGray='\e[1;30m'
+CBlue='\e[0;34m'
+CLightBlue='\e[1;34m'
+CGreen='\e[0;32m'
+CLightGreen='\e[1;32m'
+CCyan='\e[0;36m'
+CLightCyan='\e[1;36m'
+CRed='\e[0;31m'
+CLightRed='\e[1;31m'
+CPurple='\e[0;35m'
+CLightPurple='\e[1;35m'
+CBrown='\e[0;33m'
+CYellow='\e[1;33m'
+CGray='\e[0;37m'
+CWhite='\e[1;37m'
+CNone='\e[0m'
+
+
+#----------------------------
+function init_common()
+{
+ # Check script folder
+ 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
+ CFG_FILE=$TDE_DIR/build_config.sh
+ if [ -f "$CFG_FILE" ]; then
+ . "$CFG_FILE"
+ else
+ echo -e "${CYellow} --- NOTE ---${CNone}"
+ echo "Creating TDE build configuration file from template as $CFG_FILE."
+ echo "Please check and modify as required, then rerun this script."
+ cp "$SCRIPT_DIR/_build_config_template.sh" "$CFG_FILE"
+ exit 0
+ fi
+ 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
+
+ cd "$SCRIPT_DIR"
+}
+
+
+#----------------------------
+# Save execution start time
+# Parameters:
+# $1 - timer number
+function exec_time_start()
+{
+ _ET_start_var="_ET_start_$1"
+ eval "$_ET_start_var=`date +%s.%N`"
+}
+
+
+#----------------------------
+# Save execution stop time and set $2 to the execution time
+# in the format: dd/hh:mm:ss.mmm
+# Parameters:
+# $1 - timer number
+# $2 - result variable name
+function exec_time_stop()
+{
+ _ET_start_var="_ET_start_$1"
+ _ET_stop_var="_ET_stop_$1"
+ eval "$_ET_stop_var=`date +%s.%N`"
+ _ET_diff=`echo "${!_ET_stop_var} - ${!_ET_start_var}" | bc`
+ _ET_days=`echo "$_ET_diff/86400" | bc`
+ _ET_diff_day=`echo "$_ET_diff-86400*$_ET_days" | bc`
+ _ET_hours=`echo "$_ET_diff_day/3600" | bc`
+ _ET_diff_hour=`echo "$_ET_diff_day-3600*$_ET_hours" | bc`
+ _ET_mins=`echo "$_ET_diff_hour/60" | bc`
+ _ET_secs=`echo "$_ET_diff_hour-60*$_ET_mins" | bc`
+ local _resultvar=$2
+ eval "$_resultvar=`printf \"%02d/%02d:%02d:%06.3f\" $_ET_days $_ET_hours $_ET_mins $_ET_secs`"
+}
diff --git a/debian/_buildscripts/local/scripts/_build_config_template.sh b/debian/_buildscripts/local/scripts/_build_config_template.sh
new file mode 100644
index 000000000..5a465acb2
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/_build_config_template.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+#----------------------------
+# Build information
+#----------------------------
+TDE_RELEASE="14.1.0" # TDE release number
+DISTRO="debian" # Build for this distro
+D_VERSION="buster" # Build for this distro version
+REL_SUFFIX="~a" # Relative suffix for packages
+ARCHITECTURE="amd64" # Build for this architecture
+USE_LOCAL_BUILD_NUMBER="n" # If == "y", use local build numbering for modules
+BUILD_NUMBER="b001" # TDE build number
+BUILD_DATE="" # module build date (automatic if "" or fixed otherwise, ex 20171201)
+BUILD_DEFAULT_OPTIONS="-g -lr" # default building options (pbuilder)
+
+#----------------------------
+# Base directories
+#----------------------------
+# Relative paths
+CFG_SCRIPT_LOG_DIR="0_logs"
+CFG_GIT_DIR="1_git"
+CFG_BUILD_DIR="2_build"
+CFG_GIT_TDE_MAIN="$CFG_GIT_DIR/tde/main"
+CFG_GIT_TDE_PACKAGING="$CFG_GIT_DIR/tde-packaging/$DISTRO/$D_VERSION"
+CFG_GIT_EXTRA_DEPENDENCIES="$CFG_GIT_DIR/edeps"
+CFG_HOOK_DIR="$CFG_GIT_DIR/hooks"
+#Absolute paths
+PBUILDER_REPO="/var/cache/pbuilder/repo"
+PBUILDER_HOOK_DIR="/usr/lib/pbuilder/hooks"
+PBUILDER_SHELL_HOOK="$PBUILDER_HOOK_DIR/C10shell"
+PBUILDER_SHELL_HOOK_TEMPLATE="$PBUILDER_HOOK_DIR/__template_C10shell"
+
+#----------------------------
+# Build output directories and logs
+#----------------------------
+CFG_TDE_BUILD_DIR="$CFG_BUILD_DIR/build"
+CFG_TDE_DEBS_DIR="$CFG_BUILD_DIR/debs"
diff --git a/debian/_buildscripts/local/scripts/_build_set_common.sh b/debian/_buildscripts/local/scripts/_build_set_common.sh
new file mode 100755
index 000000000..43e26d83c
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/_build_set_common.sh
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+# Load common code and initialization
+. ./_build_common.sh
+init_common
+
+_BUILDSET_TIMER=1
+_BUILDSET_TIME="--/--:--:--:---"
+
+parm_SKIP_FETCH="n" # if "y" skips N packages from the list
+parm_SKIP_N=0 # this argument represents the number of packages to skip
+SKIP_cnt=0
+
+
+#----------------------------
+# do_exit for set building
+function do_exit()
+{
+ cd "$SCRIPT_DIR"
+ if [ $1 -eq 0 ]; then
+ echo -e "${CGray}#### Building process for set \"${0##*/}\" completed ####${CNone}"
+ else
+ echo -e "${CGray}#### Building process for set \"${0##*/}\" interrupted ($1) ####${CNone}"
+ fi
+ exit $1
+}
+
+
+#----------------------------
+function set_log_start()
+{
+ echo -e "${CGray}#### Starting building process for set \"${0##*/}\" ####${CNone}"
+ echo
+ echo "---------- ${0##*/} ----------" >>"$LOG_RESULT_FILENAME"
+ exec_time_start $_BUILDSET_TIMER
+}
+
+
+#----------------------------
+function set_log_end()
+{
+ exec_time_stop $_BUILDSET_TIMER "_BUILDSET_TIME"
+ echo " [$_BUILDSET_TIME] SET ${0##*/}" >>"$LOG_RESULT_FILENAME"
+ echo >>"$LOG_RESULT_FILENAME"
+ do_exit 0
+}
+
+
+#----------------------------
+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 $@"
+ echo
+ fi
+}
+
+
+#----------------------------
+# Check command line arguments
+#----------------------------
+for arg in $@; do
+ if [ "$parm_SKIP_FETCH" = "y" ]; then
+ parm_SKIP_N=$arg
+ parm_SKIP_FETCH="n"BUILD_DEFAULT_OPTIONS
+ elif [ "$arg" = "-s" ]; then # skip first N packages
+ parm_SKIP_FETCH="y"
+ fi
+done
+if [ "$parm_SKIP_FETCH" = "y" ]; then
+ echo "Invalid command line arguments ($@)"
+ do_exit 3
+fi
diff --git a/debian/_buildscripts/local/scripts/_update_repositories-int.sh b/debian/_buildscripts/local/scripts/_update_repositories-int.sh
new file mode 100755
index 000000000..4efd1bf19
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/_update_repositories-int.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+# Load common code
+. ./_build_common.sh
+
+#----------------------------
+# Initialization
+init_common
+
+#----------------------------
+# Update TDE main repository
+echo -e "\n---- Updating main TDE GIT repo ----\n"
+
+cd "$TDE_DIR/$CFG_GIT_DIR/tde"
+if [[ ! -e .git ]] || [[ -z "`git rev-parse --git-dir 2>/dev/null`" ]]; then
+ echo "Current directory does not contain a .git folder. Exiting..."
+ cd $SCRIPT_DIR
+ exit 1
+fi
+
+branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"`
+if [[ -z "$branch" ]] || [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then
+ echo "There is not active upstream branch. Exiting..."
+ cd $SCRIPT_DIR
+ exit 1
+fi
+
+touch /var/lock/update-tde-git-submodules
+
+PARENTDIR=$PWD
+echo "---- Main repo ----"
+git pull --rebase
+if [[ ! -z "`git status --porcelain --ignore-submodules`" ]]; then
+ git reset --hard HEAD
+ git clean -dxff
+fi
+
+exec 3< submodules
+while read <&3
+do
+ cd $PARENTDIR
+ DIR2UPDATE=$REPLY
+ if [[ $DIR2UPDATE != "" ]]; then
+ echo -e "\n---- Submodule $DIR2UPDATE ----"
+ cd $PARENTDIR/$DIR2UPDATE/..
+ cd `git rev-parse --show-toplevel`
+ if [[ -z "`grep \"^Updated: $PWD$\" /var/lock/update-tde-git-submodules`" ]]; then
+ echo "Updated: $PWD" >>/var/lock/update-tde-git-submodules
+ git submodule init
+ git submodule update
+ fi
+ cd $PARENTDIR/$DIR2UPDATE
+ if [[ ! -z "`git status --porcelain --ignore-submodules`" ]]; then
+ git reset --hard HEAD
+ git clean -dxff
+ fi
+ git checkout $branch
+ git pull --rebase
+ cd ..
+ cd `git rev-parse --show-toplevel`
+ fi
+done
+exec 3>&-
+
+rm /var/lock/update-tde-git-submodules
+
+
+#------------------------------
+# Update TDE-packaging repository
+echo -e "\n----------------------------------------"
+echo -e "\n--- Updating TDE-packaging GIT repo ----\n"
+
+cd "$TDE_DIR/$CFG_GIT_DIR/tde-packaging"
+git pull --rebase
+
+
+#------------------------------
+# Done
+cd $SCRIPT_DIR
diff --git a/debian/_buildscripts/local/scripts/additional files/user_home_folder/.pbuilderrc b/debian/_buildscripts/local/scripts/additional files/user_home_folder/.pbuilderrc
new file mode 100644
index 000000000..cb58cb895
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/additional files/user_home_folder/.pbuilderrc
@@ -0,0 +1,149 @@
+#!/bin/bash
+
+#-- get desired distribution and architecture
+if [ "$DIST" = "" ]; then
+ DIST=$(lsb_release -cs)
+fi
+DISTRIBUTION=$DIST
+if [ "$ARCH" = "" ]; then
+ ARCH=$(dpkg --print-architecture)
+fi
+ARCHITECTURE=$ARCH
+
+if [ -n "$T" ]; then
+ if [ "${T##*-}" = "vm" ]; then
+ BUILD_VM="qemu"
+ T=${T%-vm}
+ fi
+ if [ "${T#*@}" = "$T" ]; then
+ DISTRIBUTION=${T%-*}
+ ARCHITECTURE=${T##*-}
+ else
+ DISTRIBUTION=${T%@*}
+ ARCHITECTURE=${T##*@}
+ fi
+ if [ "${DISTRIBUTION##*-}" = "backports" ]; then
+ BACKPORTS="yes"
+ DISTRIBUTION=${DISTRIBUTION%-backports}
+ fi
+fi
+
+BASETGZ="/var/cache/pbuilder/base-$DIST@$ARCH.tgz"
+
+#-- select apt components
+case "$DISTRIBUTION" in
+ sid|buster|stretch|jessie|wheezy|squeeze|lenny|etch|sarge)
+ COMPONENTS="main contrib non-free"
+ ;;
+
+ ceres|beowulf|ascii)
+ COMPONENTS="main"
+ DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg)
+ EXTRAPACKAGES="$EXTRAPACKAGES devuan-keyring"
+ ;;
+
+ bionic|artful|zesty|yakkety|xenial|wily|vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick|lucid)
+ COMPONENTS="main restricted universe multiverse"
+ DEBOOTSTRAPOPTS=(--variant=buildd)
+ ;;
+
+ raspbian-jessie|raspbian-wheezy)
+ COMPONENTS="main contrib non-free"
+ DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg)
+ ;;
+esac
+EXTRAPACKAGES="$EXTRAPACKAGES fakeroot apt-transport-https ca-certificates"
+
+#-- select base apt sources
+case "$DISTRIBUTION" in
+ sid|buster|stretch|jessie|wheezy)
+ MIRRORSITE=http://deb.debian.org/debian
+ ;;
+
+ squeeze|lenny|etch|sarge)
+ MIRRORSITE=http://archive.debian.org/debian
+ OTHERMIRROR="#deb http://archive.debian.org/backports.org $DISTRIBUTION-backports main contrib non-free"
+ ;;
+
+ ceres|beowulf|ascii)
+ MIRRORSITE=http://auto.mirror.devuan.org/merged
+ ;;
+
+ bionic|artful|zesty|yakkety|wily|vivid|trusty|precise)
+ if [ "$ARCHITECTURE" = "amd64" ] || [ "$ARCHITECTURE" = "i386" ]; then
+ MIRRORSITE=http://archive.ubuntu.com/ubuntu
+ else
+ MIRRORSITE=http://ports.ubuntu.com
+ fi
+ ;;
+
+ xenial)
+ if [ "$ARCHITECTURE" = "amd64" ] || [ "$ARCHITECTURE" = "i386" ]; then
+ MIRRORSITE=http://archive.ubuntu.com/ubuntu
+ else
+ MIRRORSITE=http://ports.ubuntu.com
+ fi
+ OTHERMIRROR="deb $MIRRORSITE $DISTRIBUTION-updates $COMPONENTS"
+ ;;
+
+ utopic|saucy|raring|quantal|oneiric|natty|maverick|lucid)
+ MIRRORSITE=http://old-releases.ubuntu.com/ubuntu
+ ;;
+
+ raspbian-jessie|raspbian-wheezy)
+ MIRRORSITE=http://ftp.fi.muni.cz/pub/linux/raspbian/raspbian
+ ;;
+esac
+
+if [ -n "${ARCH}" ]; then
+ NAME="$NAME-$ARCH"
+ DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
+fi
+
+BUILDRESULT="/var/cache/pbuilder/$DISTRIBUTION/result/"
+
+APTCACHE="/var/cache/pbuilder/aptcache/$DISTRIBUTION/"
+if [ -n "$APTCACHE" ] && [ ! -d "$APTCACHE" ]; then
+ mkdir $APTCACHE
+fi
+if [ -z "$(stat -L --print "%d\n" $APTCACHE/. /var/cache/pbuilder/build/. | uniq -d)" ]; then
+ # apt cache for build on tmpfs is managed by hook scripts
+ BINDMOUNTS="${BINDMOUNTS} ${APTCACHE}"
+ APTCACHEHARDLINK=no
+ APTCACHE=""
+fi
+
+BUILDPLACE="/var/cache/pbuilder/build/"
+
+# default PKGNAME_LOGFILE
+PKGNAME_LOGFILE="__build__.log"
+
+#-- extra options
+DEBBUILDOPTS="-B"
+if [ "$ARCHITECTURE" == "amd64" ]; then
+ DEBBUILDOPTS="-b"
+fi
+if [ "${DISTRIBUTION#raspbian}" != "$DISTRIBUTION" ] && [ "$ARCHITECTURE" == "armhf" ]; then
+ DEBBUILDOPTS="-b"
+ DISTRIBUTION=${DISTRIBUTION#raspbian-}
+fi
+if [ -z "$DEB_SIGN_KEYID" ]; then
+ AUTO_DEBSIGN=${AUTO_DEBSIGN:-no}
+fi
+
+#-- choose dependency solver
+#-- apt is better if target distribution contains apt >= 1.4~beta3
+#-- aptitude is better if target distribution contains apt < 1.4~beta3
+case "$DISTRIBUTION" in
+ sid|buster|stretch|\
+ ceres|beowulf|ascii|\
+ bionic|artful|zesty)
+ PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-apt"
+ ;;
+
+ jessie|wheezy|squeeze|lenny|etch|sarge|\
+ raspbian-jessie|raspbian-wheezy|\
+ yakkety|xenial|wily|vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick|lucid)
+ PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-aptitude"
+ ;;
+esac
diff --git a/debian/_buildscripts/local/scripts/additional files/usr/lib/pbuilder/hooks/D05deps b/debian/_buildscripts/local/scripts/additional files/usr/lib/pbuilder/hooks/D05deps
new file mode 100755
index 000000000..a42f5bef0
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/additional files/usr/lib/pbuilder/hooks/D05deps
@@ -0,0 +1,3 @@
+#!/bin/sh
+(cd /var/cache/pbuilder/repo; apt-ftparchive packages . > Packages && gzip -c Packages >Packages.gz)
+apt-get update
diff --git a/debian/_buildscripts/local/scripts/additional files/usr/lib/pbuilder/hooks/__template_C10shell b/debian/_buildscripts/local/scripts/additional files/usr/lib/pbuilder/hooks/__template_C10shell
new file mode 100755
index 000000000..3e2f1c865
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/additional files/usr/lib/pbuilder/hooks/__template_C10shell
@@ -0,0 +1,7 @@
+#!/bin/sh
+# invoke shell if build fails.
+
+apt-get install -y --force-yes vim less bash mc
+cd /tmp/buildd/*/debian/..
+echo "Build FAILED! Invoking shell"
+/bin/bash < /dev/tty > /dev/tty 2> /dev/tty
diff --git a/debian/_buildscripts/local/scripts/build_TDE.sh b/debian/_buildscripts/local/scripts/build_TDE.sh
new file mode 100755
index 000000000..303b3215f
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/build_TDE.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# Load common code and initialization
+. ./_build_common.sh
+init_common
+
+_BUILDALL_TIMER=2
+_BUILDALL_TIME="--/--:--:--:---"
+
+parm_SKIP_FETCH="n" # if "y" skips N packages from the list
+parm_SKIP_N=0 # this argument represents the number of packages to skip
+SKIP_cnt=0
+
+
+#----------------------------
+# do_exit for set building
+function do_exit()
+{
+ cd "$SCRIPT_DIR"
+ if [ $1 -eq 0 ]; then
+ echo -e "${CGray}#### Building process for TDE completed ####${CNone}"
+ else
+ echo -e "${CGray}#### Building process for TDE interrupted ($1) ####${CNone}"
+ fi
+ exit $1
+}
+
+
+#----------------------------
+function set_log_start()
+{
+ echo -e "${CGray}#### Starting building process for TDE ####${CNone}"
+ echo
+ echo "********** TDE **********" >>"$LOG_RESULT_FILENAME"
+ exec_time_start $_BUILDALL_TIMER
+}
+
+
+#----------------------------
+function set_log_end()
+{
+ exec_time_stop $_BUILDALL_TIMER "_BUILDALL_TIME"
+ echo " [$_BUILDALL_TIME] All TDE " >>"$LOG_RESULT_FILENAME"
+ echo >>"$LOG_RESULT_FILENAME"
+ do_exit 0
+}
+
+
+#----------------------------
+function build_set()
+{
+ if [ $parm_SKIP_N -gt 0 -a $SKIP_cnt -lt $parm_SKIP_N ]; then
+ SKIP_cnt=$((SKIP_cnt+1))
+ else
+ ./build_module.sh -g -lr "$@"
+ echo
+ fi
+}
+
+
+#----------------------------
+# Check command line arguments
+#----------------------------
+for arg in $@; do
+ if [ "$parm_SKIP_FETCH" = "y" ]; then
+ parm_SKIP_N=$arg
+ parm_SKIP_FETCH="n"
+ elif [ "$arg" = "-s" ]; then # skip first N packages
+ parm_SKIP_FETCH="y"
+ fi
+done
+if [ "$parm_SKIP_FETCH" = "y" ]; then
+ echo "Invalid command line arguments ($@)"
+ do_exit 3
+fi
+
+
+#----------------------------
+# Build TDE
+#----------------------------
+set_log_start
+for setname in `find . -maxdepth 1 -type f -iname '[01]*' | sort`; do
+ if [ $parm_SKIP_N -gt 0 -a $SKIP_cnt -lt $parm_SKIP_N ]; then
+ SKIP_cnt=$((SKIP_cnt+1))
+ else
+ $setname
+ fi
+done
+set_log_end
diff --git a/debian/_buildscripts/local/scripts/build_module.sh b/debian/_buildscripts/local/scripts/build_module.sh
new file mode 100755
index 000000000..3a421e572
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/build_module.sh
@@ -0,0 +1,468 @@
+#!/bin/bash
+#
+# Build a single TDE module
+#
+
+# Load common code and initialization
+. ./_build_common.sh
+init_common
+
+# Timer settings
+_BUILDMOD_TIMER_NUM=0
+_BUILDMOD_TIME="--/--:--:--:---"
+exec_time_start $_BUILDMOD_TIMER_NUM
+
+
+#----------------------------
+# Parameters:
+# $1 - error code
+function do_exit()
+{
+ cd "$SCRIPT_DIR"
+ if [ $1 -eq 0 ]; then
+ echo -e "${CGreen}#### Processing module ${CLightGreen}\"$MOD_NAME\"${CGreen} succeeded ####${CNone}"
+ if [ "$bool_LOG_RESULT" = "y" ]; then
+ echo "[ OK ] [$_BUILDMOD_TIME] \"$MOD_NAME\"" >>"$LOG_RESULT_FILENAME"
+ fi
+ else
+ echo -e "${CRed}#### Processing module ${CLightRed}\"$MOD_NAME\"${CRed} failed ($1) ####${CNone}"
+ if [ "$bool_LOG_RESULT" = "y" ]; then
+ echo "[FAILED] [$_BUILDMOD_TIME] \"$MOD_NAME\"" >>"$LOG_RESULT_FILENAME"
+ fi
+ fi
+ exit $1
+}
+
+
+#----------------------------
+# Parameters:
+# $1 - folder name
+function recreate_folder()
+{
+ if [ -d "$1" ]; then
+ rm -R "$1"
+ fi
+ mkdir -p "$1"
+}
+
+
+#----------------------------
+# Check command line arguments
+#----------------------------
+MOD_NAME="" # the module to be built
+bool_BUILD_FROM_GIT="n"
+bool_EXTRADEP_MOD="n"
+bool_SHOW_BUILD_LOGS="n"
+bool_BUILD_LOCALLY="n"
+bool_LOG_RESULT="n"
+bool_SHELL_HOOK="n"
+bool_PREPARE_ONLY="n"
+bool_DEBUG_MODE="n"
+bool_INTERNAL_PBUILDER="n"
+for arg in $@; do
+ if [ "$arg" = "-g" ]; then # select code to build from Git repo (-g) or from local build copy
+ bool_BUILD_FROM_GIT="y"
+ elif [ "$arg" = "-l" ]; then # build module Locally instead of in a clean chroot environment
+ bool_BUILD_LOCALLY="y"
+ elif [ "$arg" = "-sl" ]; then # output the building logs to terminal (ShowLog)
+ bool_SHOW_BUILD_LOGS="y"
+ elif [ "$arg" = "-lr" ]; then # Log build Result to file
+ bool_LOG_RESULT="y"
+ elif [ "$arg" = "-sh" ]; then # install Shell Hook for failing builds (only valid if NOT building locally)
+ bool_SHELL_HOOK="y"
+ elif [ "$arg" = "-po" ]; then # Prepare build folder Only but do not build
+ bool_PREPARE_ONLY="y"
+ elif [ "$arg" = "-d" ]; then # build with Debug symbols (used in hook scripts)
+ bool_DEBUG_MODE="y"
+ elif [ "$arg" = "-ip" ]; then # build using Internal Pbuilder
+ bool_INTERNAL_PBUILDER="y"
+ elif [ "$MOD_NAME" = "" ]; then # module to be built
+ MOD_NAME="$arg"
+ fi
+done
+
+if [ "$MOD_NAME" = "" ]; then
+ echo "Please specify the module to build"
+ do_exit 3
+fi
+
+# Check if module is an extra dependency (i.e. from the nightly build dependency PPA)
+if [[ $MOD_NAME =~ ^edeps/ ]]; then
+ bool_EXTRADEP_MOD="y"
+fi
+
+# Shell hook is only valid if NOT building locally
+# Internal pbuilder option has no meaning if we are building locally
+if [ "bool_BUILD_LOCALLY" = "y" ]; then
+ bool_SHELL_HOOK="n"
+ bool_INTERNAL_PBUILDER="n"
+fi
+
+
+# Log start
+echo -e "${CLightCyan}#### Processing module \"$MOD_NAME\" ####${CNone}"
+
+
+#----------------------------
+# Base directories
+#----------------------------
+GIT_DIR="$TDE_DIR/$CFG_GIT_DIR"
+BUILD_DIR="$TDE_DIR/$CFG_BUILD_DIR"
+GIT_TDE_MAIN="$TDE_DIR/$CFG_GIT_TDE_MAIN"
+GIT_TDE_PACKAGING="$TDE_DIR/$CFG_GIT_TDE_PACKAGING"
+GIT_EXTRA_DEPENDENCIES="$TDE_DIR/$CFG_GIT_EXTRA_DEPENDENCIES"
+HOOK_DIR="$TDE_DIR/$CFG_HOOK_DIR"
+
+# This folders must exists
+BASE_DIRS=("GIT_DIR" "BUILD_DIR" "SCRIPT_DIR" "GIT_TDE_MAIN" "GIT_TDE_PACKAGING" "GIT_EXTRA_DEPENDENCIES" "HOOK_DIR" "PBUILDER_REPO")
+
+for var_name in ${BASE_DIRS[@]}; do
+ if [ ! -d "${!var_name}" ]; then
+ echo -e "$var_name directory missing. Value is \"${!var_name}\". Check your config or create it."
+ do_exit 4
+ fi
+done
+
+
+#----------------------------
+# Build output directories
+#----------------------------
+TDE_BUILD_DIR="$TDE_DIR/$CFG_TDE_BUILD_DIR"
+TDE_DEBS_DIR="$TDE_DIR/$CFG_TDE_DEBS_DIR"
+
+BUILD_DIRS=("TDE_BUILD_DIR" "TDE_DEBS_DIR")
+
+for var_name in ${BUILD_DIRS[@]}; do
+ if [ ! -d "${!var_name}" ]; then
+ mkdir "${!var_name}"
+ fi
+done
+
+
+#----------------------------
+# Check module name validity
+#----------------------------
+if [ "$bool_EXTRADEP_MOD" != "y" ]; then
+ # Standard module
+ MOD_GIT_PATH="$GIT_TDE_MAIN/$MOD_NAME"
+ MOD_GIT_PKGING_PATH="$GIT_TDE_PACKAGING/$MOD_NAME/debian"
+else
+ # Extra dependency module
+ MOD_GIT_PATH="$GIT_DIR/$MOD_NAME"
+fi
+MOD_BUILD_PATH="$TDE_BUILD_DIR/$MOD_NAME"
+MOD_BUILD_PKGING_PATH="$MOD_BUILD_PATH/debian"
+
+if [ "$bool_BUILD_FROM_GIT" = "y" ]; then
+ echo -e "${CYellow}> Building from GIT repo${CNone}"
+ # source files
+ if [ ! -d "$MOD_GIT_PATH" ]; then
+ echo "Module \"$MOD_NAME\" not found in GIT"
+ do_exit 5
+ fi
+ bool_COPY_MOD_SRC="y"
+
+ # packaging scripts
+ if [ "$bool_EXTRADEP_MOD" != "y" -a ! -d "$MOD_GIT_PKGING_PATH" ]; then
+ echo "Packaging for \"$MOD_NAME\" not found in GIT"
+ do_exit 6
+ fi
+ bool_COPY_PKGING_FILES="y"
+ #
+else
+ echo -e "${CYellow}> Building from BUILD folder${CNone}"
+ # source files
+ bool_COPY_MOD_SRC="n"
+ if [ ! -d "$MOD_BUILD_PATH" ]; then
+ if [ ! -d "$MOD_GIT_PATH" ]; then
+ echo "Module \"$MOD_NAME\" not found neither in BUILD nor in GIT"
+ do_exit 7
+ fi
+ bool_COPY_MOD_SRC="y"
+ fi
+
+ # packaging scripts
+ bool_COPY_PKGING_FILES="n"
+ if [ "$bool_EXTRADEP_MOD" != "y" -a ! -d "$MOD_BUILD_PKGING_PATH" ]; then
+ if [ ! -d "$MOD_GIT_PKGING_PATH" ]; then
+ echo "Packaging for \"$MOD_NAME\" not found neither in BUILD nor in GIT"
+ do_exit 8
+ fi
+ bool_COPY_PKGING_FILES="y"
+ fi
+fi
+
+
+#----------------------------
+# Prepare source files
+#----------------------------
+# remove output from previous build
+if [ -d "$MOD_BUILD_PATH" ]; then
+ cd "$MOD_BUILD_PATH/.."
+ rm *.deb *.dsc *.changes *.tar.bz2 *.tar.gz *.tar.xz *.log *.buildinfo &>/dev/null
+fi
+
+# copy main repo source files, if needed
+if [ "$bool_COPY_MOD_SRC" = "y" ]; then
+ bool_COPY_PKGING_FILES="y"
+ recreate_folder "$MOD_BUILD_PATH"
+ if [ "$bool_EXTRADEP_MOD" != "y" ]; then
+ # Normal module
+ cp -R "$MOD_GIT_PATH" "$MOD_BUILD_PATH/.."
+ # Add SCM information for crash test report
+ [ -f "$MOD_BUILD_PATH/.tdescmmodule" ] && rm "$MOD_BUILD_PATH/.tdescmmodule"
+ [ -f "$MOD_BUILD_PATH/.tdescmrevision" ] && rm "$MOD_BUILD_PATH/.tdescmrevision"
+ # --> Module name
+ echo "$MOD_NAME" >"$MOD_BUILD_PATH/.tdescmmodule"
+ # --> SCM info
+ cd "$MOD_GIT_PATH"
+ MOD_BRANCH=`git branch --contains HEAD | grep -v "no branch" | head -n1 | cut -c 3-`
+ COMMIT_HASH=`git rev-parse HEAD`
+ echo "$MOD_BRANCH-$COMMIT_HASH" >"$MOD_BUILD_PATH/.tdescmrevision"
+ else
+ # Extra dependency module
+ if [ `find "$MOD_GIT_PATH" -name '*.dsc' | wc -l` == 1 ]; then
+ if [ -d "$MOD_BUILD_PATH" ]; then
+ rm -R "$MOD_BUILD_PATH"
+ fi
+ if [ "$bool_SHOW_BUILD_LOGS" = "y" ]; then
+ dpkg-source --no-copy --no-check -x `find "$MOD_GIT_PATH" -name '*.dsc'` "$MOD_BUILD_PATH"
+ else
+ dpkg-source --no-copy --no-check -x `find "$MOD_GIT_PATH" -name '*.dsc'` "$MOD_BUILD_PATH" &>/dev/null
+ fi
+ else
+ echo "There must be one and only one .dsc file in \"$MOD_GIT_PATH\""
+ do_exit 9
+ fi
+ fi
+fi
+
+# copying packaging scripts, if needed
+if [ "$bool_EXTRADEP_MOD" != "y" -a "$bool_COPY_PKGING_FILES" = "y" ]; then
+ if [ -d "$MOD_BUILD_PKGING_PATH" ]; then
+ rm -R $MOD_BUILD_PKGING_PATH
+ fi
+ cp -R "$MOD_GIT_PKGING_PATH" "$MOD_BUILD_PKGING_PATH"
+
+ # TODO metapackage support
+
+ if [ "$USE_LOCAL_BUILD_NUMBER" != "y" ]; then
+ # Default package name (Slavek's repo style)
+ # Calculate package version
+ cd $MOD_GIT_PATH
+ branch=`git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
+ target_tag=`git tag | grep -F "$TDE_RELEASE" | head -n1`
+ tag=`git tag | \
+ sed "s|^\([^0-9]\)|\1.|" | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr -k 5,5nr | sed "s|^\([^0-9]\)\.|\1|" | \
+ while read t; do \
+ git branch --contains $t | cut -c 3- | grep -x "$branch" >/dev/null && \
+ echo "$t..HEAD" && break; done`
+ count=`git log $tag --pretty=oneline | wc -l`
+ package=$(basename $PWD)-trinity-$TDE_RELEASE
+ if [[ "$count" -gt 0 ]] || [[ -z "$target_tag" ]]; then
+ package=$package~pre$count+$(git rev-parse HEAD | cut -c 1-8)
+ fi
+ REL=4:$TDE_RELEASE${package#*$TDE_RELEASE}
+ REL=${REL%+*}
+ REL=${REL/4:14.0.0/4:14.0.0-s}
+ REL=${REL/4:14.0.0-s~pre/4:14.0.0-s~}
+ REL=${REL/.0~pre/.0~s}
+ # Get package name and packaging release
+ PKG_NAME=$(head -n1 $MOD_BUILD_PKGING_PATH/changelog)
+ PKG_NAME=${PKG_NAME%% *}
+ PKG_TAG=$(cd "$GIT_TDE_PACKAGING/$MOD_NAME" &&
+ git tag | \
+ sed "s|^\([^0-9]\)|\1.|" | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr -k 5,5nr | sed "s|^\([^0-9]\)\.|\1|" | \
+ while read t; do \
+ git branch --contains $t | cut -c 3- | grep -x "$branch" >/dev/null && \
+ echo "$t..HEAD" && break; done)
+ PKG_REL=$(cd "$GIT_TDE_PACKAGING/$MOD_NAME" &&
+ git log $PKG_TAG --pretty=oneline . | wc -l)
+ if [ -n "$REL_SUFFIX" ]; then
+ PKG_REL="${PKG_REL}${REL_SUFFIX}"
+ fi
+ # TODO add relative patch count
+ ADD_REL=0
+
+ DATE=$(date -R)
+ 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 -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"
+ else
+ # Local build version
+ if [ "$BUILD_DATE" = "" ]; then
+ BUILD_DATE=`date +%Y%m%d+%H%M`
+ fi
+ BUILD_VERSION="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
+ fi
+fi
+
+# prepare destination directory for building
+MOD_DEB_PATH="$TDE_DEBS_DIR/$MOD_NAME"
+MOD_DEBSRC_PATH="$MOD_DEB_PATH/src"
+recreate_folder "$MOD_DEB_PATH"
+recreate_folder "$MOD_DEBSRC_PATH"
+
+
+#----------------------------
+# Apply pre-build hooks if present
+#----------------------------
+if [ -x "$HOOK_DIR/$MOD_NAME/pre_build.sh" ]; then
+ echo -e "${CYellow}> Applying pre-build hook${CNone}"
+ . "$HOOK_DIR/$MOD_NAME/pre_build.sh"
+ if [ $? -eq 0 ]; then
+ echo -e "> ${CBrown}Pre-build hook applied successfully${CNone}"
+ else
+ echo -e "> ${CLightBlue}Pre-build hook failed${CNone}"
+ fi
+fi
+
+
+#----------------------------
+# Switch to 3.0(quilt) format
+#----------------------------
+# create orig tarball
+cd "$MOD_BUILD_PATH"
+MOD_BASENAME=`head -n 1 "$MOD_BUILD_PKGING_PATH/changelog" | sed -r "s/^([^ ]+).*/\1/"`
+MOD_MAJOR_VER=`head -n 1 "$MOD_BUILD_PKGING_PATH/changelog" | sed -r "s/^[^ ]+ \(([^:]+:)?.*/\1/"`
+MOD_UP_VER=`head -n 1 "$MOD_BUILD_PKGING_PATH/changelog" | sed -r "s/^[^ ]+ \(([^:]+:)?([^-]+).*/\2/"`
+MOD_DEB_VER=`head -n 1 "$MOD_BUILD_PKGING_PATH/changelog" | sed -r "s/^[^ ]+ \([^-]+-([^\)]+).*/\1/"`
+
+tar cJf "../${MOD_BASENAME}_${MOD_UP_VER}.orig.tar.xz" --exclude="debian" --exclude=".git*" .
+
+# switch to quilt format
+if [ -f "$MOD_BUILD_PKGING_PATH/source/format" ]; then
+ grep -q "(native)" "$MOD_BUILD_PKGING_PATH/source/format" && \
+ sed -i "s/(native)/(quilt)/" "$MOD_BUILD_PKGING_PATH/source/format"
+else
+ [ -d "$MOD_BUILD_PKGING_PATH/source" ] || mkdir -p "$MOD_BUILD_PKGING_PATH/source"
+ echo "3.0 (quilt)" >"$MOD_BUILD_PKGING_PATH/source/format"
+fi
+
+# remove quilt references from rules file
+grep -q "^include.*/usr/share/cdbs/1/rules/patchsys-quilt\.mk" "$MOD_BUILD_PKGING_PATH/rules" && \
+sed -i "s/^\(include.*\/usr\/share\/cdbs\/1\/rules\/patchsys-quilt\.mk\)/#\1/" "$MOD_BUILD_PKGING_PATH/rules"
+
+if [ "$bool_PREPARE_ONLY" = "y" ]; then
+ echo -e "${CBrown}Source code prepared for building${CNone}"
+ do_exit 0
+fi
+
+
+#----------------------------
+# Enable debug mode if required
+#----------------------------
+if [ "$bool_DEBUG_MODE" = "y" ]; then
+ echo -e "${CBrown}Enable debug mode${CNone}"
+ sed -i "s/RelWithDebInfo/Debug/" "$MOD_BUILD_PKGING_PATH/rules"
+fi
+
+
+#----------------------------
+# Build
+#----------------------------
+BUILDING_LOG_FILE="$MOD_DEBSRC_PATH/__build__.log"
+cd "$MOD_BUILD_PATH"
+
+if [ "$bool_BUILD_LOCALLY" = "y" ]; then
+ ## Build module locally
+ echo -e "${CYellow}> Building locally${CNone}"
+ if [ "$bool_SHOW_BUILD_LOGS" = "y" ]; then
+ dpkg-buildpackage -us -uc | tee "$BUILDING_LOG_FILE"
+ else
+ dpkg-buildpackage -us -uc &>"$BUILDING_LOG_FILE"
+ fi
+ build_retval=$?
+ #
+else
+ ## Build module in a clean chroot environment using pbuilder
+ # Install/remove shell hook
+ if [ "$bool_SHELL_HOOK" = "y" ]; then
+ if [ -x "$PBUILDER_SHELL_HOOK_TEMPLATE" ]; then
+ cp "$PBUILDER_SHELL_HOOK_TEMPLATE" "$PBUILDER_SHELL_HOOK" &>/dev/null
+ else
+ echo "pbuilder shell hook template file not found! ($PBUILDER_SHELL_HOOK_TEMPLATE)"
+ fi
+ else
+ if [ -x "$PBUILDER_SHELL_HOOK" ]; then
+ rm "$PBUILDER_SHELL_HOOK" &>/dev/null
+ fi
+ fi
+ # Build
+ mount --bind "$TDE_DEBS_DIR" "$PBUILDER_REPO"
+ if [ $? -ne 0 ]; then
+ echo "Unable to mount folder \"$TDE_DEBS_DIR\" to \"$PBUILDER_REPO\". Can not proceed :("
+ do_exit 11
+ fi
+ #
+ echo -e "${CYellow}> Building using pbuilder${CNone}"
+ if [ "$bool_SHOW_BUILD_LOGS" = "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"
+ else
+ pdebuild --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$D_VERSION ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE"
+ fi
+ else
+ 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"
+ else
+ pdebuild --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$D_VERSION ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" &>"$BUILDING_LOG_FILE"
+ fi
+ fi
+ build_retval=$?
+ umount "$PBUILDER_REPO"
+fi
+
+if [ $build_retval -eq 0 ]; then
+ echo -e "${CLightGreen}> Building completed SUCCESSFULLY${CNone}"
+else
+ echo -e "${CLightRed}> Building completed WITH ERRORS${CNone}"
+fi
+
+
+#----------------------------
+# Apply post-build hooks if present
+#----------------------------
+if [ -x "$HOOK_DIR/$MOD_NAME/post_build.sh" ]; then
+ echo -e "${CYellow}> Applying post-build hook${CNone}"
+ . "$HOOK_DIR/$MOD_NAME/post_build.sh"
+ if [ $? -eq 0 ]; then
+ echo -e "${CBrown}Post-build hook applied successfully${CNone}"
+ else
+ echo -e "${CLightBlue}Post-build hook failed${CNone}"
+ fi
+fi
+
+#----------------------------
+# Move compiled module files to destination folders
+#----------------------------
+if [ "$bool_BUILD_LOCALLY" = "y" ]; then
+ cd "$MOD_BUILD_PATH/.."
+ if [ "$bool_BUILD_LOCALLY" == "y" ]; then
+ mv *.deb "$MOD_DEB_PATH" &>/dev/null
+ fi
+ mv *.dsc *.changes *.tar.xz *.tar.bz2 *.tar.gz *.buildinfo "$MOD_DEBSRC_PATH" &>/dev/null
+else
+ cd "$MOD_DEB_PATH"
+ mv *.dsc *.changes *.tar.xz *.tar.bz2 *.tar.gz *.buildinfo "$MOD_DEBSRC_PATH" &>/dev/null
+fi
+cd "$MOD_BUILD_PATH/.."
+mv *.orig.tar.xz "$MOD_DEBSRC_PATH" &>/dev/null
+
+
+#----------------------------
+# Removing leftover files
+#----------------------------
+cd "$MOD_BUILD_PATH/.."
+rm *.deb *.dsc *.changes *.tar.xz *.tar.bz2 *.tar.gz *.log *.buildinfo &>/dev/null
+cd "$MOD_DEB_PATH"
+rm *.dsc *.changes *.tar.xz *.tar.bz2 *.tar.gz *.log *.buildinfo &>/dev/null
+
+
+#----------------------------
+# Building completed
+#----------------------------
+exec_time_stop $_BUILDMOD_TIMER_NUM "_BUILDMOD_TIME"
+do_exit $build_retval
diff --git a/debian/_buildscripts/local/scripts/hook examples/applications/kaffeine/kaffeine-wizard.diff b/debian/_buildscripts/local/scripts/hook examples/applications/kaffeine/kaffeine-wizard.diff
new file mode 100644
index 000000000..c35ba6516
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/hook examples/applications/kaffeine/kaffeine-wizard.diff
@@ -0,0 +1,65 @@
+diff -urN kaffeine/kaffeine/src/kaffeine.cpp kaffeine.new/kaffeine/src/kaffeine.cpp
+--- kaffeine/kaffeine/src/kaffeine.cpp 2013-03-02 15:47:14.000000000 -0600
++++ kaffeine.new/kaffeine/src/kaffeine.cpp 2013-11-24 11:39:09.809430631 -0600
+@@ -683,7 +683,9 @@
+ m_autoResizeTriple = new TDEToggleAction(i18n("Triple Size"), 0, ALT|Key_3, TQT_TQOBJECT(this), TQT_SLOT(slotAutoresizeTriple()), actionCollection(), "view_auto_resize_triple");
+
+ m_playersMenu = new TDEActionMenu(i18n("&Player Engine"), actionCollection(), "options_player");
+- KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureKeys()), actionCollection());
++ m_instWizard = new TDEAction(i18n("Installation &Wizard"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotInstWizard()), actionCollection(), "inst_wizard");
++
++ KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureKeys()), actionCollection());
+ KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureToolbars()), actionCollection());
+ KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotPreferences()), actionCollection(), "options_preferences");
+
+@@ -1619,6 +1621,18 @@
+ mute();
+ }
+
++void Kaffeine::slotInstWizard()
++{
++ TQString stamp = locateLocal("appdata", "wizard_stamp_v0.7.1");
++ InstWizard::showWizard();
++
++ TDEProcess process;
++ process << "touch" << stamp;
++ process.start(TDEProcess::Block, TDEProcess::Stderr);
++ process.clearArguments();
++}
++
++
+ /********* DCOP INTERFACE *********/
+
+ void Kaffeine::openURL(TQString url)
+diff -urN kaffeine/kaffeine/src/kaffeine.h kaffeine.new/kaffeine/src/kaffeine.h
+--- kaffeine/kaffeine/src/kaffeine.h 2013-03-02 15:47:14.000000000 -0600
++++ kaffeine.new/kaffeine/src/kaffeine.h 2013-11-24 11:09:17.455756279 -0600
+@@ -193,6 +193,7 @@
+ void slotDvbClient(bool,const TQString&,int,int,const TQString&);
+ void slotNumKeyInput( int );
+ void slotDVBNextBack( int );
++ void slotInstWizard();
+
+ private:
+ void autoresize();
+@@ -258,7 +259,8 @@
+ TDEToggleAction* m_autoResizeTriple;
+ TDEToggleAction* m_originalAspect;
+ TDEToggleAction* m_toggleLayout;
+- TDEActionMenu* m_playersMenu;
++ TDEActionMenu* m_playersMenu;
++ TDEAction* m_instWizard;
+ TDEToggleAction* m_sleepAfterPlay;
+ TDEToggleAction* m_quitAfterPlay;
+ TDEToggleAction* m_quitAfterPlaylist;
+diff -urN kaffeine/kaffeine/src/kaffeineui.rc kaffeine.new/kaffeine/src/kaffeineui.rc
+--- kaffeine/kaffeine/src/kaffeineui.rc 2012-09-14 17:39:52.000000000 -0500
++++ kaffeine.new/kaffeine/src/kaffeineui.rc 2013-11-24 11:10:15.335565312 -0600
+@@ -34,6 +34,7 @@
+ <Merge/>
+ <Menu noMerge="1" name="settings"><text>&amp;Settings</text>
+ <Action name="options_player"/>
++ <Action name="inst_wizard"/>
+ <Separator/>
+ <Merge name="StandardToolBarMenuHandler"/>
+ <Action name="options_show_statusbar"/>
diff --git a/debian/_buildscripts/local/scripts/hook examples/applications/kaffeine/pre_build.sh b/debian/_buildscripts/local/scripts/hook examples/applications/kaffeine/pre_build.sh
new file mode 100755
index 000000000..96400d6e9
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/hook examples/applications/kaffeine/pre_build.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+CURR_DIR=$PWD
+cd "$PKG_BUILD_PATH"
+
+# Apply patches
+if [ "$bool_COPY_PKG_SRC" = "y" ]; then
+ echo -e "${CLightPurple}Applying Kaffeine wizard patch${CNone}"
+ patch -p2 < "$HOOK_DIR/$PKG_NAME/kaffeine-wizard.diff"
+fi
+
+cd "$CURR_DIR"
+return 0
diff --git a/debian/_buildscripts/local/scripts/hook examples/tdebase/018_kate_save_all.diff b/debian/_buildscripts/local/scripts/hook examples/tdebase/018_kate_save_all.diff
new file mode 100644
index 000000000..16ac7c7dc
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/hook examples/tdebase/018_kate_save_all.diff
@@ -0,0 +1,37 @@
+diff -Nur ori/tdebase/kate/app/katedocmanager.cpp new/tdebase/kate/app/katedocmanager.cpp
+--- ori/tdebase/kate/app/katedocmanager.cpp 2013-07-27 02:36:57.000000000 +0900
++++ new/tdebase/kate/app/katedocmanager.cpp 2013-12-05 15:56:20.311928016 +0900
+@@ -381,7 +381,6 @@
+ return modified;
+ }
+
+-
+ bool KateDocManager::queryCloseDocuments(KateMainWindow *w)
+ {
+ uint docCount = m_docList.count();
+@@ -436,12 +435,22 @@
+ return true;
+ }
+
+-
+ void KateDocManager::saveAll()
+ {
+ for (TQPtrListIterator<Kate::Document> it(m_docList); it.current(); ++it)
+- if ( it.current()->isModified() && it.current()->views().count() )
+- ((Kate::View*)it.current()->views().first())->save();
++ {
++ if (it.current()->views().count())
++ {
++ if (it.current()->url().isEmpty())
++ {
++ ((Kate::View*)it.current()->views().first())->saveAs();
++ }
++ else if (it.current()->isModified())
++ {
++ ((Kate::View*)it.current()->views().first())->save();
++ }
++ }
++ }
+ }
+
+ void KateDocManager::saveDocumentList (TDEConfig* config)
diff --git a/debian/_buildscripts/local/scripts/hook examples/tdebase/pre_build.sh b/debian/_buildscripts/local/scripts/hook examples/tdebase/pre_build.sh
new file mode 100755
index 000000000..e764c29ad
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/hook examples/tdebase/pre_build.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+CURR_DIR=$PWD
+cd "$PKG_BUILD_PATH"
+
+# Apply patches
+if [ "$bool_COPY_PKG_SRC" = "y" ]; then
+ echo -e "${CLightPurple}Applying Kate save all patch${CNone}"
+ patch -p2 < "$HOOK_DIR/$PKG_NAME/018_kate_save_all.diff"
+
+ echo -e "${CLightPurple}Applying SAK patch${CNone}"
+ patch -p1 < "$HOOK_DIR/$PKG_NAME/tdebase-usesak.diff"
+fi
+
+cd "$CURR_DIR"
+return 0
diff --git a/debian/_buildscripts/local/scripts/hook examples/tdebase/tdebase-usesak.diff b/debian/_buildscripts/local/scripts/hook examples/tdebase/tdebase-usesak.diff
new file mode 100644
index 000000000..e85ca1047
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/hook examples/tdebase/tdebase-usesak.diff
@@ -0,0 +1,15 @@
+diff -urNa tdebase/tdm/config.def tdebase.new/tdm/config.def
+--- tdebase/tdm/config.def 2013-09-12 11:51:29.000000000 -0500
++++ tdebase.new/tdm/config.def 2014-02-10 06:29:38.537806886 -0600
+@@ -2010,9 +2010,9 @@
+
+ Key: UseSAK
+ Type: bool
+-Default: true
++Default: false
+ User: greeter
+-Instance: #*/!
++Instance: #:*/false
+ Comment:
+ SAK
+ Description:
diff --git a/debian/_buildscripts/local/scripts/hook examples/tdelibs/038_placeholder.diff b/debian/_buildscripts/local/scripts/hook examples/tdelibs/038_placeholder.diff
new file mode 100644
index 000000000..65d64cc72
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/hook examples/tdelibs/038_placeholder.diff
@@ -0,0 +1,64 @@
+diff -Nur ori/tdelibs/tdeutils/kfinddialog.cpp new/tdelibs/tdeutils/kfinddialog.cpp
+--- ori/tdelibs/tdeutils/kfinddialog.cpp 2014-02-05 16:54:13.852605699 +0900
++++ new/tdelibs/tdeutils/kfinddialog.cpp 2014-02-11 18:16:55.292214876 +0900
+@@ -149,8 +149,9 @@
+ m_replace->setMaxCount(10);
+ m_replace->setDuplicatesEnabled(false);
+ m_backRef = new TQCheckBox(i18n("Use p&laceholders"), m_replaceGrp);
++ m_backRef->setEnabled(m_regExp->isChecked());
+ m_backRefItem = new TQPushButton(i18n("Insert Place&holder"), m_replaceGrp);
+- m_backRefItem->setEnabled(false);
++ m_backRefItem->setEnabled(m_regExp->isChecked() && m_backRef->isChecked());
+
+ m_replaceLayout->addWidget(m_replaceLabel, 0, 0);
+ m_replaceLayout->addMultiCellWidget(m_replace, 1, 1, 0, 1);
+@@ -193,8 +194,8 @@
+
+ // signals and slots connections
+ connect(m_selectedText, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSelectedTextToggled(bool)));
+- connect(m_regExp, TQT_SIGNAL(toggled(bool)), m_regExpItem, TQT_SLOT(setEnabled(bool)));
+- connect(m_backRef, TQT_SIGNAL(toggled(bool)), m_backRefItem, TQT_SLOT(setEnabled(bool)));
++ connect(m_regExp, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotRegexCheckBoxToggled(bool)));
++ connect(m_backRef, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPlaceholdersCheckBoxToggled(bool)));
+ connect(m_regExpItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(showPatterns()));
+ connect(m_backRefItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(showPlaceholders()));
+
+@@ -276,11 +277,23 @@
+ "Ask before replacing each match found.") );
+ }
+
+-void KFindDialog::textSearchChanged( const TQString & text)
++void KFindDialog::textSearchChanged(const TQString & text)
+ {
+ enableButtonOK( !text.isEmpty() );
+ }
+
++void KFindDialog::slotRegexCheckBoxToggled(bool checked)
++{
++ m_regExpItem->setEnabled(checked);
++ m_backRef->setEnabled(checked);
++ m_backRefItem->setEnabled(checked && m_backRef->isChecked());
++}
++
++void KFindDialog::slotPlaceholdersCheckBoxToggled(bool checked)
++{
++ m_backRefItem->setEnabled(checked && m_regExp->isChecked());
++}
++
+ void KFindDialog::showEvent( TQShowEvent *e )
+ {
+ if ( !d->m_initialShowDone )
+diff -Nur ori/tdelibs/tdeutils/kfinddialog.h new/tdelibs/tdeutils/kfinddialog.h
+--- ori/tdelibs/tdeutils/kfinddialog.h 2014-02-05 16:54:13.852605699 +0900
++++ new/tdelibs/tdeutils/kfinddialog.h 2014-02-11 18:16:57.876214916 +0900
+@@ -250,7 +250,9 @@
+ void slotSelectedTextToggled(bool);
+ void showPatterns();
+ void showPlaceholders();
+- void textSearchChanged( const TQString &);
++ void textSearchChanged(const TQString &);
++ void slotRegexCheckBoxToggled(bool checked);
++ void slotPlaceholdersCheckBoxToggled(bool checked);
+
+ protected:
+ virtual void showEvent ( TQShowEvent * );
diff --git a/debian/_buildscripts/local/scripts/hook examples/tdelibs/pre_build.sh b/debian/_buildscripts/local/scripts/hook examples/tdelibs/pre_build.sh
new file mode 100755
index 000000000..35bfc3c1b
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/hook examples/tdelibs/pre_build.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+CURR_DIR=$PWD
+cd "$PKG_BUILD_PATH"
+
+# Apply patches
+if [ "$bool_COPY_PKG_SRC" = "y" ]; then
+ echo -e "${CLightPurple}Applying kfinddialog placeholder patch${CNone}"
+ patch -p2 < "$HOOK_DIR/$PKG_NAME/038_placeholder.diff"
+fi
+
+cd "$CURR_DIR"
+return 0
diff --git a/debian/_buildscripts/local/scripts/update_repositories.sh b/debian/_buildscripts/local/scripts/update_repositories.sh
new file mode 100755
index 000000000..867d2108a
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/update_repositories.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Load common code
+. ./_build_common.sh
+
+#----------------------------
+# Initialization
+init_common
+
+#----------------------------
+# Run real update script
+if [ ! -d "$SCRIPT_LOG_DIR" ]; then
+ echo -e "\"$SCRIPT_LOG_DIR\" folder is missing. Check your config or create it."
+ exit 1
+fi
+echo "Update in progress..."
+./_update_repositories-int.sh &>"$SCRIPT_LOG_DIR/update-repos.log"
+echo "Update completed."
+