diff --git a/.travis.yml b/.travis.yml index 2cff36d6..38d0f43a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +sudo : true +dist : trusty language: node_js node_js: - "node" @@ -16,11 +18,11 @@ script: deploy: - provider: script # Nightly builds (launched by cron) - script: ./scripts/setup_travis_env.sh && DISPLAY=:99.0 ./scripts/create_all_packages.sh + script: sudo apt-get update -q && sudo apt-get --yes install click click-reviewers-tools && ./scripts/setup_travis_env.sh && DISPLAY=:99.0 ./scripts/create_all_packages.sh on: condition: ( "$TRAVIS_EVENT_TYPE" = "cron" ) - provider: script # Generation of packages for public releases (launched by a tag) - script: ./scripts/setup_travis_env.sh && DISPLAY=:99.0 ./scripts/create_all_packages.sh -t -v ${TRAVIS_TAG} + script: sudo apt-get update -q && sudo apt-get --yes install click click-reviewers-tools && ./scripts/setup_travis_env.sh && DISPLAY=:99.0 ./scripts/create_all_packages.sh -t -v ${TRAVIS_TAG} on: tags: true \ No newline at end of file diff --git a/scripts/create_all_packages.sh b/scripts/create_all_packages.sh index aea508e8..180452d7 100755 --- a/scripts/create_all_packages.sh +++ b/scripts/create_all_packages.sh @@ -1,7 +1,7 @@ #!/bin/bash BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. echo "BASEDIR is $BASEDIR" -cd $BASEDIR +cd "$BASEDIR" # Reading arguments while getopts tdv: option; do @@ -62,6 +62,9 @@ cp manifest.json tmp/ sed -i -e "s/$VERSION_TO_REPLACE/$VERSION/" tmp/manifest.json scripts/package_firefox_extension.sh $DRYRUN $TAG -v $VERSION scripts/package_firefoxos_app.sh $DRYRUN $TAG -v $VERSION +cp -f ubuntu_touch/* tmp/ +sed -i -e "s/$VERSION_TO_REPLACE/$VERSION/" tmp/manifest.json +scripts/package_ubuntu_touch_app.sh $DRYRUN $TAG -v $VERSION if [ "${DRYRUN}zz" == "zz" ]; then CURRENT_DATE=$(date +'%Y-%m-%d') diff --git a/scripts/package_chrome_extension.sh b/scripts/package_chrome_extension.sh index 68bfa64c..08f3ab6f 100755 --- a/scripts/package_chrome_extension.sh +++ b/scripts/package_chrome_extension.sh @@ -1,6 +1,6 @@ #!/bin/bash BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. -cd $BASEDIR +cd "$BASEDIR" # Reading arguments while getopts tdv: option; do diff --git a/scripts/package_firefox_extension.sh b/scripts/package_firefox_extension.sh index dcf23302..8a0fa7f5 100755 --- a/scripts/package_firefox_extension.sh +++ b/scripts/package_firefox_extension.sh @@ -1,6 +1,6 @@ #!/bin/bash BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. -cd $BASEDIR +cd "$BASEDIR" # Reading arguments while getopts tdv: option; do diff --git a/scripts/package_firefoxos_app.sh b/scripts/package_firefoxos_app.sh index 3726f2fc..723bd2a4 100755 --- a/scripts/package_firefoxos_app.sh +++ b/scripts/package_firefoxos_app.sh @@ -1,6 +1,6 @@ #!/bin/bash BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. -cd $BASEDIR/tmp +cd "$BASEDIR/tmp" # Reading arguments while getopts tdv: option; do diff --git a/scripts/package_ubuntu_touch_app.sh b/scripts/package_ubuntu_touch_app.sh new file mode 100755 index 00000000..e3aa0cce --- /dev/null +++ b/scripts/package_ubuntu_touch_app.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# to install: +# +# $ adb push kiwix-*.click /tmp +# $ adb shell +# $ pkcon install-local --allow-untrusted /tmp/kiwix-*.click + +BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. +cd "$BASEDIR/tmp" + +# Reading arguments +while getopts tdv: option; do + case "${option}" in + t) TAG="-t";; # Indicates that we're releasing a public version from a tag + d) DRYRUN="-d";; # Indicates a dryrun test, that does not modify anything on the network + v) VERSION=${OPTARG};; + esac +done + +echo "Packaging .click application for Ubuntu Touch, version $VERSION" + +# We need to remove the *.woff* files because click considers they are forbidden binaries +rm -f "$BASEDIR/tmp/www/fonts/*.woff*" +# We need to remove these files because the --ignore option of click is not supported in the version of Trusty +rm -rf "$BASEDIR/tmp/webextension" +rm -f "$BASEDIR/tmp/manifest.webapp" +click build "$BASEDIR/tmp" +mv kiwix*.click $BASEDIR/build/kiwix-ubuntu-touch-$VERSION.click diff --git a/scripts/push_to_gh_pages.sh b/scripts/push_to_gh_pages.sh index a4002e9b..73f24f06 100755 --- a/scripts/push_to_gh_pages.sh +++ b/scripts/push_to_gh_pages.sh @@ -1,4 +1,4 @@ #!/bin/bash BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. -cd $BASEDIR +cd "$BASEDIR" git checkout gh-pages && git merge master && git push origin gh-pages && git checkout master diff --git a/scripts/setup_travis_env.sh b/scripts/setup_travis_env.sh index 3299c33d..b45b4413 100755 --- a/scripts/setup_travis_env.sh +++ b/scripts/setup_travis_env.sh @@ -1,8 +1,8 @@ #!/bin/bash BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/.. # Decrypt the secret files -openssl aes-256-cbc -K $encrypted_3275b0f28807_key -iv $encrypted_3275b0f28807_iv -in $BASEDIR/scripts/secret_files.tar.gz.enc -out $BASEDIR/scripts/secret_files.tar.gz -d -tar xvzf $BASEDIR/scripts/secret_files.tar.gz --directory $BASEDIR/scripts/ +openssl aes-256-cbc -K $encrypted_3275b0f28807_key -iv $encrypted_3275b0f28807_iv -in "$BASEDIR/scripts/secret_files.tar.gz.enc" -out "$BASEDIR/scripts/secret_files.tar.gz" -d +tar xvzf "$BASEDIR/scripts/secret_files.tar.gz" --directory "$BASEDIR/scripts/" # On Travis, we need to make Chromium believe it has a display else it fails signing the package export DISPLAY=:99.0 sh -e /etc/init.d/xvfb start diff --git a/ubuntu_touch/kiwix.apparmor b/ubuntu_touch/kiwix.apparmor new file mode 100644 index 00000000..9647f884 --- /dev/null +++ b/ubuntu_touch/kiwix.apparmor @@ -0,0 +1,10 @@ +{ + "template": "ubuntu-webapp", + "policy_groups": [ + "networking", + "webview", + "content_exchange", + "content_exchange_source" + ], + "policy_version": 1.3 +} diff --git a/ubuntu_touch/kiwix.desktop b/ubuntu_touch/kiwix.desktop new file mode 100644 index 00000000..e8b8a5e9 --- /dev/null +++ b/ubuntu_touch/kiwix.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=kiwix +Comment=kiwix for Ubuntu Touch +Exec=webapp-container $@ ./www/index.html +Terminal=false +Type=Application +X-Ubuntu-Touch=true +Icon=./www/img/icons/kiwix-256.png +Name[en_US]=kiwix.desktop diff --git a/ubuntu_touch/manifest.json b/ubuntu_touch/manifest.json new file mode 100644 index 00000000..91b45199 --- /dev/null +++ b/ubuntu_touch/manifest.json @@ -0,0 +1,15 @@ +{ + "name": "kiwix", + "description": "Kiwix : offline Wikipedia reader", + "architecture": "all", + "maintainer": "Kiwix team ", + "framework" : "ubuntu-sdk-15.04.5", + "version" : "2.2-WIP", + "title": "kiwix", + "hooks": { + "ubports-little-webapp": { + "apparmor": "kiwix.apparmor", + "desktop": "kiwix.desktop" + } + } +} \ No newline at end of file