"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/project/bundles/appimage/04-build-appimage.sh" (4 Sep 2019, 19302 Bytes) of package /linux/misc/digikam-6.3.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "04-build-appimage.sh": 6.2.0_vs_6.3.0.

    1 #!/bin/bash
    2 
    3 # Script to bundle data using previously-built KF5 with digiKam installation
    4 # and create a Linux AppImage bundle file.
    5 #
    6 # Copyright (c) 2015-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
    7 #
    8 # Redistribution and use is allowed according to the terms of the BSD license.
    9 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
   10 #
   11 
   12 # Halt and catch errors
   13 set -eE
   14 trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
   15 trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
   16 
   17 if [ "root" != "$USER" ]; then
   18     echo "This script must be run as root..."
   19     exit
   20 fi
   21 
   22 #################################################################################################
   23 # Manage script traces to log file
   24 
   25 mkdir -p ./logs
   26 exec > >(tee ./logs/build-appimage.full.log) 2>&1
   27 
   28 #################################################################################################
   29 
   30 echo "04-build-appimage.sh : build digiKam AppImage bundle."
   31 echo "-----------------------------------------------------"
   32 
   33 #################################################################################################
   34 # Pre-processing checks
   35 
   36 . ./config.sh
   37 . ./common.sh
   38 ChecksRunAsRoot
   39 StartScript
   40 ChecksCPUCores
   41 HostAdjustments
   42 RegisterRemoteServers
   43 
   44 if [[ "$(arch)" = "x86_64" ]] ; then
   45     LIBSUFFIX=lib64
   46 else
   47     LIBSUFFIX=lib
   48 fi
   49 
   50 #################################################################################################
   51 
   52 # Working directory
   53 ORIG_WD="`pwd`"
   54 
   55 DK_RELEASEID=`cat $ORIG_WD/data/RELEASEID.txt`
   56 
   57 #################################################################################################
   58 
   59 echo -e "---------- Build icons-set ressource\n"
   60 
   61 cd $ORIG_WD/icon-rcc
   62 
   63 rm -f CMakeCache.txt > /dev/null
   64 
   65 cmake -DCMAKE_INSTALL_PREFIX="/usr" \
   66       -DCMAKE_BUILD_TYPE=debug \
   67       -DCMAKE_COLOR_MAKEFILE=ON \
   68       -Wno-dev \
   69       .
   70 
   71 make -j$CPU_CORES
   72 
   73 #################################################################################################
   74 
   75 echo -e "---------- Prepare directories in bundle\n"
   76 
   77 # Make sure we build from the /, parts of this script depends on that. We also need to run as root...
   78 cd /
   79 
   80 # Prepare the install location
   81 rm -rf $APP_IMG_DIR/ || true
   82 mkdir -p $APP_IMG_DIR/usr/bin
   83 mkdir -p $APP_IMG_DIR/usr/etc
   84 mkdir -p $APP_IMG_DIR/usr/share
   85 mkdir -p $APP_IMG_DIR/usr/share/icons
   86 mkdir -p $APP_IMG_DIR/usr/share/metainfo
   87 mkdir -p $APP_IMG_DIR/usr/share/dbus-1/interfaces
   88 mkdir -p $APP_IMG_DIR/usr/share/dbus-1/services
   89 
   90 # make sure lib and lib64 are the same thing
   91 mkdir -p $APP_IMG_DIR/usr/lib
   92 mkdir -p $APP_IMG_DIR/usr/lib/libexec
   93 mkdir -p $APP_IMG_DIR/usr/lib/libgphoto2
   94 mkdir -p $APP_IMG_DIR/usr/lib/libgphoto2_port
   95 cd $APP_IMG_DIR/usr
   96 ln -s lib lib64
   97 
   98 #################################################################################################
   99 
  100 echo -e "---------- Copy Files in bundle\n"
  101 
  102 cd $APP_IMG_DIR
  103 
  104 # FIXME: How to find out which subset of plugins is really needed? I used strace when running the binary
  105 cp -r /usr/plugins ./usr/
  106 rm -fr ./usr/plugins/ktexteditor
  107 rm -fr ./usr/plugins/kf5/parts
  108 rm -fr ./usr/plugins/konsolepart.so
  109 
  110 # copy runtime data files
  111 cp -r /usr/share/digikam                  ./usr/share
  112 cp -r /usr/share/showfoto                 ./usr/share
  113 cp $ORIG_WD/icon-rcc/breeze.rcc           ./usr/share/digikam
  114 cp $ORIG_WD/icon-rcc/breeze-dark.rcc      ./usr/share/digikam
  115 
  116 cd $APP_IMG_DIR/usr/share/showfoto
  117 ln -s ../digikam/breeze.rcc               breeze.rcc
  118 ln -s ../digikam/breeze-dark.rcc          breeze-dark.rcc
  119 
  120 cd $APP_IMG_DIR
  121 cp $ORIG_WD/data/qt.conf                  ./usr/bin
  122 cp -r /usr/share/lensfun                  ./usr/share
  123 cp -r /usr/share/knotifications5          ./usr/share
  124 cp -r /usr/share/kservices5               ./usr/share
  125 cp -r /usr/share/kservicetypes5           ./usr/share
  126 cp -r /usr/share/kxmlgui5                 ./usr/share
  127 cp -r /usr/share/kf5                      ./usr/share
  128 cp -r /usr/share/solid                    ./usr/share
  129 cp -r /usr/share/OpenCV                   ./usr/share
  130 cp -r /usr/share/dbus-1/interfaces/kf5*   ./usr/share/dbus-1/interfaces/
  131 cp -r /usr/share/dbus-1/services/*kde*    ./usr/share/dbus-1/services/
  132 cp -r /usr/${LIBSUFFIX}/libexec/kf5      ./usr/lib/libexec/
  133 
  134 # AppImage stream data file
  135 cp -r /usr/share/metainfo/org.kde.digikam.appdata.xml   ./usr/share/metainfo/digikam.appdata.xml
  136 cp -r /usr/share/metainfo/org.kde.showfoto.appdata.xml  ./usr/share/metainfo/showfoto.appdata.xml
  137 
  138 # QWebEngine bin data files.
  139 if [[ $DK_QTWEBENGINE = 1 ]] ; then
  140     cp -r /usr/resources ./usr
  141 fi
  142 
  143 # copy libgphoto2 drivers
  144 find  /usr/${LIBSUFFIX}/libgphoto2      -name "*.so" -type f -exec cp {} ./usr/lib/libgphoto2 \;      2>/dev/null
  145 find  /usr/${LIBSUFFIX}/libgphoto2_port -name "*.so" -type f -exec cp {} ./usr/lib/libgphoto2_port \; 2>/dev/null
  146 
  147 # copy sane backends
  148 cp -r /usr/${LIBSUFFIX}/sane              ./usr/lib
  149 cp -r /etc/sane.d                         ./usr/etc
  150 
  151 # copy i18n
  152 
  153 # Qt translations files
  154 if [[ -e /usr/translations ]]; then
  155 
  156     cp -r /usr/translations ./usr
  157     # optimizations
  158     rm -rf ./usr/translations/assistant*    || true
  159     rm -rf ./usr/translations/designer*     || true
  160     rm -rf ./usr/translations/linguist*     || true
  161     rm -rf ./usr/translations/qmlviewer*    || true
  162     rm -rf ./usr/translations/qtmultimedia* || true
  163     rm -rf ./usr/translations/qtscript*     || true
  164     rm -rf ./usr/translations/qtquick*      || true
  165     rm -rf ./usr/translations/qt_help*      || true
  166     rm -rf ./usr/translations/qtserialport* || true
  167     rm -rf ./usr/translations/qtwebsockets* || true
  168 
  169 fi
  170 
  171 # KF5 translations files
  172 FILES=$(cat $ORIG_WD/logs/build-extralibs.full.log | grep /usr/share/locale | grep -e .qm -e .mo | cut -d' ' -f3)
  173 
  174 for FILE in $FILES ; do
  175     cp --parents $FILE ./
  176 done
  177 
  178 # digiKam translations files
  179 FILES=$(cat $ORIG_WD/logs/build-digikam.full.log | grep /usr/share/locale | grep -e .qm -e .mo | cut -d' ' -f3)
  180 
  181 for FILE in $FILES ; do
  182     cp --parents $FILE ./
  183 done
  184 
  185 # digiKam icons files
  186 FILES=$(cat $ORIG_WD/logs/build-digikam.full.log | grep /usr/share/icons/ | cut -d' ' -f3)
  187 
  188 for FILE in $FILES ; do
  189     cp --parents $FILE ./
  190 done
  191 
  192 # Marble data and plugins files
  193 
  194 cp -r /usr/${LIBSUFFIX}/marble/plugins/ ./usr/bin/
  195 
  196 cp -r /usr/share/marble/data            ./usr/bin/
  197 
  198 # otherwise segfaults!?
  199 cp $(ldconfig -p | grep /$LIBSUFFIX/libsasl2.so.3    | cut -d ">" -f 2 | xargs) ./usr/lib/
  200 cp $(ldconfig -p | grep /${LIBSUFFIX}/libGL.so.1       | cut -d ">" -f 2 | xargs) ./usr/lib/
  201 cp $(ldconfig -p | grep /${LIBSUFFIX}/libGLU.so.1      | cut -d ">" -f 2 | xargs) ./usr/lib/
  202 
  203 # Fedora 23 seemed to be missing SOMETHING from the Centos 6.7. The only message was:
  204 # This application failed to start because it could not find or load the Qt platform plugin "xcb".
  205 # Setting export QT_DEBUG_PLUGINS=1 revealed the cause.
  206 # QLibraryPrivate::loadPlugin failed on "/usr/lib64/qt5/plugins/platforms/libqxcb.so" :
  207 # "Cannot load library /usr/lib64/qt5/plugins/platforms/libqxcb.so: (/lib64/libEGL.so.1: undefined symbol: drmGetNodeTypeFromFd)"
  208 # Which means that we have to copy libEGL.so.1 in too
  209 
  210 # Otherwise F23 cannot load the Qt platform plugin "xcb"
  211 cp $(ldconfig -p | grep /${LIBSUFFIX}/libEGL.so.1      | cut -d ">" -f 2 | xargs) ./usr/lib/
  212 
  213 # let's not copy xcb itself, that breaks on dri3 systems https://bugs.kde.org/show_bug.cgi?id=360552
  214 #cp $(ldconfig -p | grep libxcb.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/
  215 
  216 # For Fedora 20
  217 cp $(ldconfig -p | grep /${LIBSUFFIX}/libfreetype.so.6 | cut -d ">" -f 2 | xargs) ./usr/lib/
  218 
  219 cp /usr/bin/digikam                 ./usr/bin
  220 cp /usr/bin/showfoto                ./usr/bin
  221 cp /usr/bin/kbuildsycoca5           ./usr/bin
  222 cp /usr/bin/solid-hardware5         ./usr/bin
  223 
  224 # QWebEngine runtime process
  225 [[ -e /usr/libexec/QtWebEngineProcess ]] && cp /usr/libexec/QtWebEngineProcess ./usr/bin
  226 
  227 # For Solid action when camera is connected to computer
  228 cp /usr/bin/qdbus                   ./usr/share/digikam/utils
  229 sed -i "/Exec=/c\Exec=digikam-camera downloadFromUdi %i" ./usr/share/solid/actions/digikam-opencamera.desktop
  230 
  231 #################################################################################################
  232 
  233 echo -e "---------- Scan dependencies recurssively\n"
  234 
  235 CopyReccursiveDependencies /usr/bin/digikam                  ./usr/lib
  236 CopyReccursiveDependencies /usr/bin/showfoto                 ./usr/lib
  237 CopyReccursiveDependencies /usr/plugins/platforms/libqxcb.so ./usr/lib
  238 
  239 FILES=$(ls /usr/${LIBSUFFIX}/libdigikam*.so)
  240 
  241 for FILE in $FILES ; do
  242     CopyReccursiveDependencies ${FILE} ./usr/lib
  243 done
  244 
  245 FILES=$(ls /usr/plugins/imageformats/*.so)
  246 
  247 for FILE in $FILES ; do
  248     CopyReccursiveDependencies ${FILE} ./usr/lib
  249 done
  250 
  251 # Copy in the indirect dependencies
  252 FILES=$(find . -type f -executable)
  253 
  254 for FILE in $FILES ; do
  255     CopyReccursiveDependencies ${FILE} ./usr/lib
  256 done
  257 
  258 #################################################################################################
  259 
  260 echo -e "---------- Clean-up Bundle Directory Contents\n"
  261 
  262 # The following are assumed to be part of the base system
  263 
  264 # This list is taken from linuxdeplotqt
  265 # [https://github.com/probonopd/linuxdeployqt/blob/master/tools/linuxdeployqt/excludelist.h]
  266 # NOTE: libglapi is included explicity in Krita exclude list.
  267 EXCLUDE_FILES="\
  268 ld-linux.so.2 \
  269 ld-linux-x86-64.so.2 \
  270 libanl.so.1 \
  271 libasound.so.2 \
  272 libBrokenLocale.so.1 \
  273 libcidn.so.1 \
  274 libcom_err.so.2 \
  275 libcrypt.so.1 \
  276 libc.so.6 \
  277 libdl.so.2 \
  278 libdrm.so.2 \
  279 libexpat.so.1 \
  280 libfontconfig.so.1 \
  281 libfreetype.so.6 \
  282 libgcc_s.so.1 \
  283 libgdk_pixbuf-2.0.so.0 \
  284 libgio-2.0.so.0 \
  285 libglapi.so.0 \
  286 libglib-2.0.so.0 \
  287 libGL.so.1 \
  288 libgobject-2.0.so.0 \
  289 libgpg-error.so.0 \
  290 libharfbuzz.so.0 \
  291 libICE.so.6 \
  292 libjack.so.0 \
  293 libm.so.6 \
  294 libmvec.so.1 \
  295 libnsl.so.1 \
  296 libnss_compat.so.2 \
  297 libnss_db.so.2 \
  298 libnss_dns.so.2 \
  299 libnss_files.so.2 \
  300 libnss_hesiod.so.2 \
  301 libnss_nisplus.so.2 \
  302 libnss_nis.so.2 \
  303 libp11-kit.so.0 \
  304 libpango-1.0.so.0 \
  305 libpangocairo-1.0.so.0 \
  306 libpangoft2-1.0.so.0 \
  307 libpthread.so.0 \
  308 libresolv.so.2 \
  309 librt.so.1 \
  310 libSM.so.6 \
  311 libstdc++.so.6 \
  312 libthai.so.0 \
  313 libthread_db.so.1 \
  314 libusb-1.0.so.0 \
  315 libutil.so.1 \
  316 libuuid.so.1 \
  317 libX11.so.6 \
  318 libxcb.so.1 \
  319 "
  320 
  321 for FILE in $EXCLUDE_FILES ; do
  322     if [[ -f usr/lib/${FILE} ]] ; then
  323         echo -e "   ==> ${FILE} will be removed for the bundle"
  324         rm -f usr/lib/${FILE}
  325     fi
  326 done
  327 
  328 # This list is taken from older AppImage build script from krita
  329 # NOTE: libopenal => see bug 390162.
  330 #       libdbus-1 => see Krita rules.
  331 EXTRA_EXCLUDE_FILES="\
  332 libgssapi_krb5.so.2 \
  333 libgssapi.so.3 \
  334 libhcrypto.so.4 \
  335 libheimbase.so.1 \
  336 libheimntlm.so.0 \
  337 libhx509.so.5 \
  338 libidn.so.11 \
  339 libk5crypto.so.3 \
  340 libkrb5.so.26 \
  341 libkrb5.so.3 \
  342 libkrb5support.so.0 \
  343 libpcre.so.3 \
  344 libroken.so.18 \
  345 libsasl2.so.2 \
  346 libwind.so.0 \
  347 libopenal.so.1 \
  348 libdbus-1.so.3 \
  349 "
  350 
  351 #liblber-2.4.so.2       # needed for Debian Wheezy
  352 #libldap_r-2.4.so.2     # needed for Debian Wheezy
  353 
  354 #libffi.so.6            # needed for Ubuntu 11.04
  355 #libxcb-glx.so.0        # needed for Ubuntu 11.04
  356 
  357 #libkeyutils.so.1       # Originally removed in linuxdeployqt, but needed for Gentoo (see https://bugs.kde.org/show_bug.cgi?id=406171#c2)
  358 #libz.so.1              # needed for Mint 18.1 (see http://digikam.1695700.n4.nabble.com/digikam-6-2-0-64-bit-appimage-error-td4708921.html)
  359 
  360 
  361 for FILE in $EXCLUDE_FILES ; do
  362     if [[ -f usr/lib/${FILE} ]] ; then
  363         echo -e "   ==> ${FILE} will be removed for the bundle"
  364         rm -f usr/lib/${FILE}
  365     fi
  366 done
  367 
  368 ln -s libssl.so.10 usr/lib/libssl.so || true
  369 
  370 # We don't bundle the developer stuff
  371 rm -rf usr/include         || true
  372 rm -rf usr/lib/cmake3      || true
  373 rm -rf usr/lib/pkgconfig   || true
  374 rm -rf usr/share/ECM/      || true
  375 rm -rf usr/share/gettext   || true
  376 rm -rf usr/share/pkgconfig || true
  377 
  378 #################################################################################################
  379 # See LFS instruction: http://www.linuxfromscratch.org/lfs/view/systemd/chapter05/stripping.html
  380 
  381 echo -e "---------- Strip Binaries Files \n"
  382 
  383 if [[ $DK_DEBUG = 1 ]] ; then
  384     FILES=$(find . -type f -executable | grep -Ev '(digikam|showfoto|exiv2)')
  385 else
  386     FILES=$(find . -type f -executable)
  387 fi
  388 
  389 for FILE in $FILES ; do
  390     echo -en "Strip symbols in: $FILE"
  391     /usr/bin/strip --strip-debug ${FILE}
  392     echo -e " ==> OK"
  393 done
  394 
  395 #################################################################################################
  396 
  397 echo -e "---------- Strip Configuration Files \n"
  398 
  399 # Since we set $APP_IMG_DIR as the prefix, we need to patch it away too (FIXME)
  400 # Probably it would be better to use /app as a prefix because it has the same length for all apps
  401 cd usr/ ; find . -type f -exec sed -i -e 's|$APP_IMG_DIR/usr/|./././././././././|g' {} \; ; cd  ..
  402 
  403 # On openSUSE Qt is picking up the wrong libqxcb.so
  404 # (the one from the system when in fact it should use the bundled one) - is this a Qt bug?
  405 # Also, Krita has a hardcoded /usr which we patch away
  406 cd usr/ ; find . -type f -exec sed -i -e 's|/usr|././|g' {} \; ; cd ..
  407 
  408 # We do not bundle this, so let's not search that inside the AppImage.
  409 # Fixes "Qt: Failed to create XKB context!" and lets us enter text
  410 sed -i -e 's|././/share/X11/|/usr/share/X11/|g' ./usr/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
  411 sed -i -e 's|././/share/X11/|/usr/share/X11/|g' ./usr/lib/libQt5XcbQpa.so.5
  412 
  413 #################################################################################################
  414 
  415 cd /
  416 
  417 APP=digikam
  418 
  419 #if [[ $DK_DEBUG = 1 ]] ; then
  420 #    DEBUG_SUF="-debug"
  421 #fi
  422 
  423 if [[ $DK_QTWEBENGINE = 1 ]] ; then
  424     WEB_BROWSER="-qtwebengine"
  425 else
  426     WEB_BROWSER=""
  427 fi
  428 
  429 if [[ "$ARCH" = "x86_64" ]] ; then
  430     APPIMAGE=$APP"-"$DK_RELEASEID$DK_EPOCH$WEB_BROWSER"-x86-64$DEBUG_SUF.appimage"
  431 elif [[ "$ARCH" = "i686" ]] ; then
  432     APPIMAGE=$APP"-"$DK_RELEASEID$DK_EPOCH$WEB_BROWSER"-i386$DEBUG_SUF.appimage"
  433 fi
  434 
  435 echo -e "---------- Create Bundle with AppImage SDK stage1\n"
  436 
  437 # Source functions
  438 
  439 if [[ ! -s ./functions.sh ]] ; then
  440     wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
  441 fi
  442 
  443 # Install desktopintegration in usr/bin/digikam.wrapper
  444 cd $APP_IMG_DIR
  445 
  446 # We will use a dedicated bash script to run inside the AppImage to be sure that XDG_* variable are set for Qt5
  447 cp ${ORIG_WD}/data/AppRun ./
  448 
  449 # desktop integration files
  450 
  451 cp /usr/share/applications/org.kde.digikam.desktop ./digikam.desktop
  452 cp /usr/share/icons/hicolor/64x64/apps/digikam.png ./digikam.png
  453 
  454 mkdir -p $APP_IMG_DIR/usr/share/icons/default/128x128/apps
  455 cp -r /usr/share/icons/hicolor/128x128/apps/digikam.png ./usr/share/icons/default/128x128/apps/digikam.png
  456 
  457 mkdir -p $APP_IMG_DIR/usr/share/icons/default/128x128/mimetypes
  458 cp -r /usr/share/icons/hicolor/128x128/apps/digikam.png ./usr/share/icons/default/128x128/mimetypes/application-vnd.digikam.png
  459 
  460 mkdir -p $ORIG_WD/bundle
  461 rm -f $ORIG_WD/bundle/* || true
  462 
  463 echo -e "---------- Create Bundle with AppImage SDK stage2\n"
  464 
  465 cd /
  466 
  467 # Get right version of Appimage toolkit.
  468 
  469 if [[ "$ARCH" = "x86_64" ]] ; then
  470     APPIMGBIN=AppImageTool-x86_64.AppImage
  471 elif [[ "$ARCH" = "i686" ]] ; then
  472     APPIMGBIN=AppImageTool-i686.AppImage
  473 fi
  474 
  475 if [[ ! -s ./$APPIMGBIN ]] ; then
  476     wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/$APPIMGBIN -O ./$APPIMGBIN
  477 fi
  478 
  479 chmod a+x ./$APPIMGBIN
  480 
  481 ./$APPIMGBIN $APP_IMG_DIR/ $ORIG_WD/bundle/$APPIMAGE
  482 chmod a+rwx $ORIG_WD/bundle/$APPIMAGE
  483 
  484 #################################################################################################
  485 # Show resume information and future instructions to host installer file to remote server
  486 
  487 echo -e "\n---------- Compute package checksums for digiKam $DK_RELEASEID\n"  > $ORIG_WD/bundle/$APPIMAGE.sum
  488 echo    "File       : $APPIMAGE"                                             >> $ORIG_WD/bundle/$APPIMAGE.sum
  489 echo -n "Size       : "                                                      >> $ORIG_WD/bundle/$APPIMAGE.sum
  490 du -h "$ORIG_WD/bundle/$APPIMAGE"     | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$APPIMAGE.sum
  491 echo -n "MD5 sum    : "                                                      >> $ORIG_WD/bundle/$APPIMAGE.sum
  492 md5sum "$ORIG_WD/bundle/$APPIMAGE"    | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$APPIMAGE.sum
  493 echo -n "SHA1 sum   : "                                                      >> $ORIG_WD/bundle/$APPIMAGE.sum
  494 sha1sum "$ORIG_WD/bundle/$APPIMAGE"   | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$APPIMAGE.sum
  495 echo -n "SHA256 sum : "                                                      >> $ORIG_WD/bundle/$APPIMAGE.sum
  496 sha256sum "$ORIG_WD/bundle/$APPIMAGE" | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$APPIMAGE.sum
  497 
  498 # Checksums to post on Phabricator at release time.
  499 sha256sum "$ORIG_WD/bundle/$APPIMAGE" > $ORIG_WD/bundle/sha256_release.sum
  500 
  501 if [[ $DK_SIGN = 1 ]] ; then
  502 
  503     cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -sabv "$ORIG_WD/bundle/$APPIMAGE"
  504     mv -f $ORIG_WD/bundle/$APPIMAGE.asc $ORIG_WD/bundle/$APPIMAGE.sig
  505 
  506     echo    "File       : $APPIMAGE.sig"                                             >> $ORIG_WD/bundle/$APPIMAGE.sum
  507     echo -n "Size       : "                                                          >> $ORIG_WD/bundle/$APPIMAGE.sum
  508     du -h "$ORIG_WD/bundle/$APPIMAGE.sig"     | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$APPIMAGE.sum
  509     echo -n "MD5 sum    : "                                                          >> $ORIG_WD/bundle/$APPIMAGE.sum
  510     md5sum "$ORIG_WD/bundle/$APPIMAGE.sig"    | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$APPIMAGE.sum
  511     echo -n "SHA1 sum   : "                                                          >> $ORIG_WD/bundle/$APPIMAGE.sum
  512     sha1sum "$ORIG_WD/bundle/$APPIMAGE.sig"   | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$APPIMAGE.sum
  513     echo -n "SHA256 sum : "                                                          >> $ORIG_WD/bundle/$APPIMAGE.sum
  514     sha256sum "$ORIG_WD/bundle/$APPIMAGE.sig" | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$APPIMAGE.sum
  515 
  516     # Checksums to post on Phabricator at release time.
  517     sha256sum "$ORIG_WD/bundle/$APPIMAGE.sig" >> $ORIG_WD/bundle/sha256_release.sum
  518 
  519 fi
  520 
  521 cat $ORIG_WD/bundle/$APPIMAGE.sum
  522 
  523 if [[ $DK_UPLOAD = 1 ]] ; then
  524 
  525     echo -e "---------- Cleanup older bundle AppImage files from files.kde.org repository \n"
  526 
  527     if [[ "$ARCH" = "x86_64" ]] ; then
  528         ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*$WEB_BROWSER-x86-64*.appimage*
  529     elif [[ "$ARCH" = "i686" ]] ; then
  530         ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*$WEB_BROWSER-i386*.appimage*
  531     fi
  532 
  533     echo -e "---------- Upload new bundle AppImage files to files.kde.org repository \n"
  534 
  535     rsync -r -v --progress -e ssh $ORIG_WD/bundle/$APPIMAGE $DK_UPLOADURL:$DK_UPLOADDIR
  536     scp $ORIG_WD/bundle/$APPIMAGE.sum $DK_UPLOADURL:$DK_UPLOADDIR
  537 
  538     if [[ $DK_SIGN = 1 ]] ; then
  539         scp $ORIG_WD/bundle/$APPIMAGE.sig $DK_UPLOADURL:$DK_UPLOADDIR
  540     fi
  541 
  542 else
  543     echo -e "\n------------------------------------------------------------------"
  544     curl https://download.kde.org/README_UPLOAD
  545     echo -e "------------------------------------------------------------------\n"
  546 fi
  547 
  548 #################################################################################################
  549 
  550 TerminateScript