| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# SPDX-FileCopyrightText: 2008-2026 by Gilles Caulier, <caulier dot gilles at gmail dot com> |
| 4 |
# |
| 5 |
# SPDX-License-Identifier: BSD-3-Clause |
| 6 |
# |
| 7 |
|
| 8 |
# Configuration to tune before to build tarball. |
| 9 |
|
| 10 |
TARBALL_VERSION="9.1.0" |
| 11 |
|
| 12 |
# Location to host target files. |
| 13 |
TARBALL_DIR="$PWD/../digikam-$TARBALL_VERSION" |
| 14 |
TARBALL_FILE="digiKam-$TARBALL_VERSION.tar.xz" |
| 15 |
TARBALL_PATH="$PWD/../$TARBALL_FILE" |
| 16 |
TARBALL_CHECKSUMS="$PWD/../digiKam-$TARBALL_VERSION.sum" |
| 17 |
TARBALL_SHA256SUMS="$PWD/../sha256_release.sum" |
| 18 |
|
| 19 |
# sub-dir to build translations |
| 20 |
TARBALL_BUILD="build.tarball" |
| 21 |
|
| 22 |
# PGP signature |
| 23 |
TARBALL_SIGN=0 |
| 24 |
|
| 25 |
# Prepare temporary directory to compile translations files. |
| 26 |
|
| 27 |
mkdir -p $TARBALL_BUILD |
| 28 |
cd $TARBALL_BUILD |
| 29 |
|
| 30 |
# Configure to checkout translation files. Stop at any error. |
| 31 |
|
| 32 |
/opt/qt6/bin/cmake -G "Unix Makefiles" . \ |
| 33 |
-DBUILD_TESTING=OFF \ |
| 34 |
-DBUILD_WITH_QT6=ON \ |
| 35 |
-DDIGIKAMSC_COMPILE_PO=ON \ |
| 36 |
-DDIGIKAMSC_COMPILE_DIGIKAM=OFF \ |
| 37 |
-DENABLE_KFILEMETADATASUPPORT=OFF \ |
| 38 |
-DENABLE_AKONADICONTACTSUPPORT=OFF \ |
| 39 |
-DENABLE_MYSQLSUPPORT=OFF \ |
| 40 |
-DENABLE_INTERNALMYSQL=OFF \ |
| 41 |
-DENABLE_GEOLOCATION=OFF \ |
| 42 |
-DENABLE_MEDIAPLAYER=OFF \ |
| 43 |
-DENABLE_DBUS=OFF \ |
| 44 |
-DENABLE_APPSTYLES=OFF \ |
| 45 |
-Wno-dev \ |
| 46 |
.. || exit 1 |
| 47 |
|
| 48 |
# Check if translation files can be compiled (.po => .mo). Stop the script is one error occurs. |
| 49 |
# Source code is not compiled and it's expected to compile at release time. |
| 50 |
# So, no check about this point is performed. |
| 51 |
|
| 52 |
make -j4 || exit 1 |
| 53 |
|
| 54 |
# If all is fine clean-up build and continue. |
| 55 |
|
| 56 |
cd .. |
| 57 |
rm -fr $TARBALL_BUILD |
| 58 |
|
| 59 |
# Prepare the tarball and compress. |
| 60 |
|
| 61 |
mkdir -p $TARBALL_DIR |
| 62 |
cp -rf ./* $TARBALL_DIR |
| 63 |
|
| 64 |
XZ_OPT=-9 tar cJf $TARBALL_PATH $TARBALL_DIR |
| 65 |
|
| 66 |
# Cleanup temp directory |
| 67 |
|
| 68 |
rm -fr $TARBALL_DIR |
| 69 |
|
| 70 |
# Show resume information about the tarball |
| 71 |
|
| 72 |
echo -e "\n---------- Compute tarball checksums for digiKam $TARBALL_VERSION\n" > $TARBALL_CHECKSUMS |
| 73 |
echo "File : $TARBALL_FILE" >> $TARBALL_CHECKSUMS |
| 74 |
echo -n "Size : " >> $TARBALL_CHECKSUMS |
| 75 |
du -h "$TARBALL_PATH" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS |
| 76 |
echo -n "SHA256 sum : " >> $TARBALL_CHECKSUMS |
| 77 |
sha256sum "$TARBALL_PATH" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS |
| 78 |
|
| 79 |
# Checksums to post on Phabricator at release time. |
| 80 |
sha256sum "$TARBALL_PATH" > $TARBALL_SHA256SUMS |
| 81 |
|
| 82 |
cat $TARBALL_CHECKSUMS |
| 83 |
|
| 84 |
# Compute GPG signature. |
| 85 |
|
| 86 |
if [[ $TARBALL_SIGN = 1 ]] ; then |
| 87 |
|
| 88 |
cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -stabv "$TARBALL_PATH" |
| 89 |
mv -f $TARBALL_PATH.asc $TARBALL_PATH.sig |
| 90 |
|
| 91 |
echo "File : $TARBALL_FILE.sig" >> $TARBALL_CHECKSUMS |
| 92 |
echo -n "Size : " >> $TARBALL_CHECKSUMS |
| 93 |
du -h "$TARBALL_PATH.sig" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS |
| 94 |
echo -n "SHA256 sum : " >> $TARBALL_CHECKSUMS |
| 95 |
sha256sum "$TARBALL_PATH.sig" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS |
| 96 |
|
| 97 |
# Checksums to post on Phabricator at release time. |
| 98 |
sha256sum "$TARBALL_PATH.sig" >> $TARBALL_SHA256SUMS |
| 99 |
|
| 100 |
fi |