diff --git a/COPYING b/COPYING index caeca07..88798ab 120000 --- a/COPYING +++ b/COPYING @@ -1 +1 @@ -/usr/share/automake-1.14/COPYING \ No newline at end of file +/usr/share/automake-1.15/COPYING \ No newline at end of file diff --git a/ChangeLog b/ChangeLog index a88e9e3..d01507a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,51 @@ +2015-12-02 15:58 marc + + * build-in-docker.conf, build-in-docker.sh, + resolve-debbuilddeps.sh: enhanced build in docker + +2015-12-02 07:17 marc + + * build-in-docker.conf: build requires universe for npm + +2015-12-01 14:50 marc + + * build-in-docker.conf, build-in-docker.sh, debian/control.in: + improved dependencies for more ubuntu support + +2015-12-01 13:10 marc + + * build-in-docker.conf: build everything in docker now, 2nd try + +2015-12-01 12:17 marc + + * bootstrap.sh, build-in-docker.conf, build-in-docker.sh, + configure.ac, makefile.am: build everithing in docker now + +2015-11-25 15:25 marc + + * build-in-docker.sh: allow add repositories (for cordova-cli) + +2015-11-25 12:45 marc + + * configure.ac, debian/control.in: install cordova from ubuntu ppa + +2015-11-25 10:05 marc + + * configure.ac, cordova/makefile.am, debian/control.in: fixes for + cordova + +2015-11-25 08:57 marc + + * ax_init_standard_project.m4, bootstrap.sh, configure.ac, + debian/control.in, sql-to-dot.sed: check for android and cordova + separately; depend on npm and nodejs for cordova + +2015-11-20 14:05 marc + + * ChangeLog, cordova/config.xml.in, cordova/makefile.am, + html/safechat.js, safechat.desktop.in: try to allow background + process + 2015-11-09 22:34 marc * html/documentation.dox, html/makefile.am: added missing doc diff --git a/INSTALL b/INSTALL index f812f5a..ddcdb76 120000 --- a/INSTALL +++ b/INSTALL @@ -1 +1 @@ -/usr/share/automake-1.14/INSTALL \ No newline at end of file +/usr/share/automake-1.15/INSTALL \ No newline at end of file diff --git a/build-in-docker.conf b/build-in-docker.conf index 6fb02a1..3310463 100644 --- a/build-in-docker.conf +++ b/build-in-docker.conf @@ -1,11 +1,22 @@ -packages+=("wheezy:::curl:::npm") -packages+=("nodejs") -repos+=("Ubuntu:::universe") -repos+=("wheezy:::'deb http://ftp.is.debian.org/debian wheezy-backports main'") -commands+=("wheezy:::update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100") -commands+=("wheezy:::curl https://www.npmjs.com/install.sh | sh") -commands+=("npm install -g cordova") +# if you have android, we need cordova plus more dependencies +# so we can build an android app if test -n "${ANDROID_HOME}"; then - envs+=("-e ANDROID_HOME=${ANDROID_HOME}") - dirs+=("-v ${ANDROID_HOME}:${ANDROID_HOME}:ro") + # all this is needed for android through cordova (phonegap) only + packages+=("wheezy:::curl:::npm") + packages+=("git nodejs default-jdk libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1") + repos+=("Ubuntu-precise:::'deb http://archive.ubuntu.com precise universe'") + repos+=("Debian|Ubuntu-precise::::::universe") + repos+=("wheezy:::'deb http://ftp.is.debian.org/debian wheezy-backports main'") + commands+=("update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100") + commands+=("wheezy:::curl https://www.npmjs.com/install.sh | sh") + commands+=("npm install -g cordova") + commands+=("chown $(id -u) ${HOME}") + commands+=("chown -R $(id -u) ${HOME}/.npm") + commands+=("useradd -d ${HOME} -u $(id -u) $(id -un)") + envs+=("-e ANDROID_HOME=${ANDROID_HOME}") + envs+=("-e HOME=${HOME}") + envs+=("-e TERM=xterm") + dirs+=("-v ${ANDROID_HOME}:${ANDROID_HOME}:ro") + dirs+=("-v ${HOME}/.gnupg:${HOME}/.gnupg:ro") + dirs+=("-v ${HOME}/.android:${HOME}/.android:ro") fi diff --git a/build-in-docker.sh b/build-in-docker.sh index b6a1560..ac091ae 100755 --- a/build-in-docker.sh +++ b/build-in-docker.sh @@ -1,4 +1,5 @@ #! /bin/bash -e +set -o errtrace # build and test everything in a fresh docker installation img="ubuntu:latest" @@ -39,21 +40,21 @@ while test $# -gt 0; do echo " :::" echo " Read as: On linux type use else use " echo " That means: If the distributer ID or codename in lsb_release" - echo " matches , then is replaced, else is replaced." + echo " matches regular expression , then is replaced, else is replaced." echo " The three colons are for splitting from and part." echo " E.g.: Install package curl on wheezy and npm on olter systems:" - echo " $0 -p wheezy:::curl:::npm" + echo " $0 -p Debian|precise:::curl:::npm" echo echo "EXAMPLE:" echo echo "$0 -i mwaeckerlin/ubuntu:trusty-i386 \\" - echo " -t deb \\" - echo " -e ANDROID_HOME=/opt/local/android \\" - echo " -d /opt/local/android \\" - echo " -r universe \\" - echo " -r https://dev.marc.waeckerlin.org/repository \\" - echo " -k https://dev.marc.waeckerlin.org/repository/PublicKey \\" - echo " -p mrw-c++" + echo " -t deb \\" + echo " -e ANDROID_HOME=/opt/local/android \\" + echo " -d /opt/local/android \\" + echo " -r universe \\" + echo " -r https://dev.marc.waeckerlin.org/repository \\" + echo " -k https://dev.marc.waeckerlin.org/repository/PublicKey \\" + echo " -p mrw-c++" echo exit 0 ;; @@ -93,6 +94,38 @@ while test $# -gt 0; do shift done +function traperror() { + set +x + local DOCKER_ID="$1" + local err=($2) # error status + local line="$3" # LINENO + local linecallfunc="$4" + local command="$5" + local funcstack="$6" + for e in ${err[@]}; do + if test -n "$e" -a "$e" != "0"; then + echo "<---" + echo "ERROR: line $line - command '$command' exited with status: $e (${err[@]})" + if [ "${funcstack}" != "main" -o "$linecallfunc" != "0" ]; then + echo -n " ... Error at ${funcstack} " + if [ "$linecallfunc" != "" ]; then + echo -n "called at line $linecallfunc" + fi + echo + fi + echo "**** Entering docker container ${DOCKER_ID}, exit with Ctrl-D" + echo -n " ... cleanup docker: " + docker rm -f "${DOCKER_ID}" + echo "returning status: $e" + echo "--->" + exit $e + fi + done + echo -n " SUCCESS ... cleanup docker: " + docker rm -f "${DOCKER_ID}" + exit 0 +} + function ifthenelse() { arg="$1" shift @@ -103,24 +136,29 @@ function ifthenelse() { os="${arg%%:::*}" thenpart="${arg#*:::}" if test "${thenpart/:::/}" = "${thenpart}"; then - docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if test "${os//$(lsb_release -is)/}${os//$(lsb_release -cs)/}" != "${os}${os}"; then '"${cmd//ARG/${thenpart}}"'; fi' + docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)" =~ ${os} ]]; then '"${cmd//ARG/${thenpart}}"'; fi' else elsepart="${thenpart##*:::}" thenpart="${thenpart%:::*}" - docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if test "${os//$(lsb_release -is)/}${os//$(lsb_release -cs)/}" != "${os}${os}"; then '"${cmd//ARG/${thenpart}}"'; else '"${cmd//ARG/${elsepart}}"'; fi' + if test -n "${thenpart}"; then + docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)" =~ ${os} ]]; then '"${cmd//ARG/${thenpart}}"'; else '"${cmd//ARG/${elsepart}}"'; fi' + else + docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)" =~ ${os} ]]; then true; else '"${cmd//ARG/${elsepart}}"'; fi' + fi fi fi } set -x +docker pull $img DOCKER_ID=$(docker run -d ${dirs[@]} ${envs[@]} -w /workdir $img sleep infinity) -trap "docker rm -f ${DOCKER_ID}" INT TERM EXIT +trap 'traperror '"${DOCKER_ID}"' "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FUNCNAME[@]}" "${FUNCTION}"' SIGINT INT TERM EXIT docker exec ${DOCKER_ID} apt-get update -docker exec ${DOCKER_ID} apt-get upgrade -y --force-yes -if ! docker exec ${DOCKER_ID} apt-get install -y --force-yes python-software-properties apt-transport-https dpkg-dev lsb-release; then - docker exec ${DOCKER_ID} apt-get install -y --force-yes software-properties-common apt-transport-https dpkg-dev lsb-release -fi +docker exec ${DOCKER_ID} apt-get upgrade -y +docker exec ${DOCKER_ID} apt-get install -y python-software-properties software-properties-common apt-transport-https dpkg-dev lsb-release || \ + docker exec ${DOCKER_ID} apt-get install -y software-properties-common apt-transport-https dpkg-dev lsb-release || \ + docker exec ${DOCKER_ID} apt-get install -y python-software-properties apt-transport-https dpkg-dev lsb-release; for repo in "${repos[@]}"; do ifthenelse "${repo}" "apt-add-repository ARG" done diff --git a/cordova/makefile.am b/cordova/makefile.am index 9d8e7c3..f0c6c23 100644 --- a/cordova/makefile.am +++ b/cordova/makefile.am @@ -19,13 +19,13 @@ ${ANDROID_SRC}: ( cp -r "@srcdir@/$${file}" "$${file}" && \ chmod -R u+w "$${file}" ); \ done - if [ "$$(whoami)" != "root" ]; then \ + if [ "$$(whoami 2> /dev/null)" != "root" ]; then \ ${CORDOVA} plugin add https://github.com/katzer/cordova-plugin-background-mode.git; \ ${CORDOVA} build --debug || ${CORDOVA} build --debug; \ fi ${ANDROID}: ${ANDROID_SRC} - if [ "$$(whoami)" != "root" ]; then \ + if [ "$$(whoami 2> /dev/null)" != "root" ]; then \ cp $< $@; \ fi diff --git a/cordova/platforms/android/AndroidManifest.xml b/cordova/platforms/android/AndroidManifest.xml index 9b6d49b..82f0365 100644 --- a/cordova/platforms/android/AndroidManifest.xml +++ b/cordova/platforms/android/AndroidManifest.xml @@ -1,5 +1,5 @@ - + @@ -11,6 +11,7 @@ + diff --git a/cordova/platforms/android/assets/www/cordova_plugins.js b/cordova/platforms/android/assets/www/cordova_plugins.js index 8ca9d88..a9fdf5b 100644 --- a/cordova/platforms/android/assets/www/cordova_plugins.js +++ b/cordova/platforms/android/assets/www/cordova_plugins.js @@ -3,13 +3,33 @@ module.exports = [ { "file": "plugins/cordova-plugin-whitelist/whitelist.js", "id": "cordova-plugin-whitelist.whitelist", + "pluginId": "cordova-plugin-whitelist", "runs": true + }, + { + "file": "plugins/cordova-plugin-device/www/device.js", + "id": "cordova-plugin-device.device", + "pluginId": "cordova-plugin-device", + "clobbers": [ + "device" + ] + }, + { + "file": "plugins/de.appplant.cordova.plugin.background-mode/www/background-mode.js", + "id": "de.appplant.cordova.plugin.background-mode.BackgroundMode", + "pluginId": "de.appplant.cordova.plugin.background-mode", + "clobbers": [ + "cordova.plugins.backgroundMode", + "plugin.backgroundMode" + ] } ]; module.exports.metadata = // TOP OF METADATA { - "cordova-plugin-whitelist": "1.0.0" + "cordova-plugin-whitelist": "1.0.0", + "cordova-plugin-device": "1.1.0", + "de.appplant.cordova.plugin.background-mode": "0.6.4" } // BOTTOM OF METADATA }); \ No newline at end of file diff --git a/cordova/platforms/android/res/xml/config.xml b/cordova/platforms/android/res/xml/config.xml index 4316490..76488f0 100644 --- a/cordova/platforms/android/res/xml/config.xml +++ b/cordova/platforms/android/res/xml/config.xml @@ -1,10 +1,17 @@ - + + + + + + + + SafeChat diff --git a/cordova/plugins/android.json b/cordova/plugins/android.json index 681f25c..83b7149 100644 --- a/cordova/plugins/android.json +++ b/cordova/plugins/android.json @@ -20,7 +20,14 @@ "installed_plugins": { "cordova-plugin-whitelist": { "PACKAGE_NAME": "ch.safechat" + }, + "de.appplant.cordova.plugin.background-mode": { + "PACKAGE_NAME": "ch.safechat" } }, - "dependent_plugins": {} + "dependent_plugins": { + "cordova-plugin-device": { + "PACKAGE_NAME": "ch.safechat" + } + } } \ No newline at end of file diff --git a/cordova/plugins/fetch.json b/cordova/plugins/fetch.json index bfc05e7..6de3723 100644 --- a/cordova/plugins/fetch.json +++ b/cordova/plugins/fetch.json @@ -6,5 +6,22 @@ }, "is_top_level": true, "variables": {} + }, + "de.appplant.cordova.plugin.background-mode": { + "source": { + "type": "git", + "url": "https://github.com/katzer/cordova-plugin-background-mode.git", + "subdir": "." + }, + "is_top_level": true, + "variables": {} + }, + "cordova-plugin-device": { + "source": { + "type": "registry", + "id": "cordova-plugin-device" + }, + "is_top_level": false, + "variables": {} } } \ No newline at end of file diff --git a/html/index.html.in b/html/index.html.in index a6a629c..a94ca06 100644 --- a/html/index.html.in +++ b/html/index.html.in @@ -1,56 +1,56 @@ - + - - - - - - - - - -Safe Chat - - - - - - - - - -
- -

start up engine, please wait ...

- -
- + + + + + + + + + + Safe Chat + + + + + + + + + +
+ +

start up engine, please wait ...

+ +
+
- + - + in your browser and does not send any credentials to the + server. Your password and your secret key is fully under your + control. That's why you must enable javascript and local storage for + this application. +