File indexing completed on 2024-12-29 04:00:05
0001 #!/bin/bash 0002 0003 # SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier, <caulier dot gilles at gmail dot com> 0004 # 0005 # SPDX-License-Identifier: BSD-3-Clause 0006 # 0007 0008 # Configuration to tune before to build tarball. 0009 0010 TARBALL_VERSION="8.2.0" 0011 0012 # Location to host target files. 0013 TARBALL_DIR="$PWD/../digikam-$TARBALL_VERSION" 0014 TARBALL_FILE="digiKam-$TARBALL_VERSION.tar.xz" 0015 TARBALL_PATH="$PWD/../$TARBALL_FILE" 0016 TARBALL_CHECKSUMS="$PWD/../digiKam-$TARBALL_VERSION.sum" 0017 TARBALL_SHA256SUMS="$PWD/../sha256_release.sum" 0018 0019 # sub-dir to build translations 0020 TARBALL_BUILD="build.tarball" 0021 0022 # PGP signature 0023 TARBALL_SIGN=0 0024 0025 # Prepare temporary directory to compile translations files. 0026 0027 mkdir -p $TARBALL_BUILD 0028 cd $TARBALL_BUILD 0029 0030 # Configure to checkout translation files. Stop at any error. 0031 0032 cmake -G "Unix Makefiles" . \ 0033 -DBUILD_TESTING=OFF \ 0034 -DDIGIKAMSC_COMPILE_PO=ON \ 0035 -DDIGIKAMSC_COMPILE_DIGIKAM=OFF \ 0036 -DENABLE_KFILEMETADATASUPPORT=OFF \ 0037 -DENABLE_AKONADICONTACTSUPPORT=OFF \ 0038 -DENABLE_MYSQLSUPPORT=OFF \ 0039 -DENABLE_INTERNALMYSQL=OFF \ 0040 -DENABLE_GEOLOCATION=OFF \ 0041 -DENABLE_MEDIAPLAYER=OFF \ 0042 -DENABLE_DBUS=OFF \ 0043 -DENABLE_APPSTYLES=OFF \ 0044 -DENABLE_QWEBENGINE=OFF \ 0045 -Wno-dev \ 0046 .. || exit 1 0047 0048 # Check if translation files can be compiled (.po => .mo). Stop the script is one error occurs. 0049 # Source code is not compiled and it's expected to compile at release time. 0050 # So, no check about this point is performed. 0051 0052 make -j4 || exit 1 0053 0054 # If all is fine clean-up build and continue. 0055 0056 cd .. 0057 rm -fr $TARBALL_BUILD 0058 0059 # Prepare the tarball and compress. 0060 0061 mkdir -p $TARBALL_DIR 0062 cp -rf ./* $TARBALL_DIR 0063 0064 XZ_OPT=-9 tar cJf $TARBALL_PATH $TARBALL_DIR 0065 0066 # Cleanup temp directory 0067 0068 rm -fr $TARBALL_DIR 0069 0070 # Show resume information about the tarball 0071 0072 echo -e "\n---------- Compute tarball checksums for digiKam $TARBALL_VERSION\n" > $TARBALL_CHECKSUMS 0073 echo "File : $TARBALL_FILE" >> $TARBALL_CHECKSUMS 0074 echo -n "Size : " >> $TARBALL_CHECKSUMS 0075 du -h "$TARBALL_PATH" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS 0076 echo -n "SHA256 sum : " >> $TARBALL_CHECKSUMS 0077 sha256sum "$TARBALL_PATH" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS 0078 0079 # Checksums to post on Phabricator at release time. 0080 sha256sum "$TARBALL_PATH" > $TARBALL_SHA256SUMS 0081 0082 cat $TARBALL_CHECKSUMS 0083 0084 # Compute GPG signature. 0085 0086 if [[ $TARBALL_SIGN = 1 ]] ; then 0087 0088 cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -stabv "$TARBALL_PATH" 0089 mv -f $TARBALL_PATH.asc $TARBALL_PATH.sig 0090 0091 echo "File : $TARBALL_FILE.sig" >> $TARBALL_CHECKSUMS 0092 echo -n "Size : " >> $TARBALL_CHECKSUMS 0093 du -h "$TARBALL_PATH.sig" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS 0094 echo -n "SHA256 sum : " >> $TARBALL_CHECKSUMS 0095 sha256sum "$TARBALL_PATH.sig" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS 0096 0097 # Checksums to post on Phabricator at release time. 0098 sha256sum "$TARBALL_PATH.sig" >> $TARBALL_SHA256SUMS 0099 0100 fi