forked from KDE/digikam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.tarball
executable file
·111 lines (83 loc) · 4.3 KB
/
bootstrap.tarball
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
# Copyright (c) 2008-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Configuration to tune before to build tarball.
TARBALL_VERSION="6.3.0"
# Location to host target files.
TARBALL_DIR="$PWD/../digikam-$TARBALL_VERSION"
TARBALL_FILE="$PWD/../digikam-$TARBALL_VERSION.tar.xz"
TARBALL_CHECKSUMS="$PWD/../digikam-$TARBALL_VERSION.sum"
TARBALL_SHA256SUMS="$PWD/../sha256_release.sum"
# sub-dir to build translations
TARBALL_BUILD="build.tarball"
# PGP signature
TARBALL_SIGN=1
# Prepare temporary directory to compile translations files.
mkdir -p $TARBALL_BUILD
cd $TARBALL_BUILD
# Configure to checkout translation files. Stop at any error.
cmake -G "Unix Makefiles" . \
-DBUILD_TESTING=OFF \
-DDIGIKAMSC_CHECKOUT_PO=ON \
-DDIGIKAMSC_CHECKOUT_DOC=OFF \
-DDIGIKAMSC_COMPILE_PO=ON \
-DDIGIKAMSC_COMPILE_DOC=OFF \
-DDIGIKAMSC_COMPILE_DIGIKAM=OFF \
-DENABLE_KFILEMETADATASUPPORT=OFF \
-DENABLE_AKONADICONTACTSUPPORT=OFF \
-DENABLE_MYSQLSUPPORT=OFF \
-DENABLE_INTERNALMYSQL=OFF \
-DENABLE_MEDIAPLAYER=OFF \
-DENABLE_DBUS=OFF \
-DENABLE_APPSTYLES=OFF \
-DENABLE_QWEBENGINE=OFF \
-DENABLE_FACESENGINE_DNN=OFF \
-Wno-dev \
.. || exit 1
# Check if translation files can be compiled (.po => .mo). Stop the script is one error occurs.
# Source code is not compiled and it's expected to compile at release time.
# So, no check about this point is performed.
make -j4 || exit 1
# If all is fine clean-up build and continue.
cd ..
rm -fr $TARBALL_BUILD
# Prepare the tarball and compress.
mkdir -p $TARBALL_DIR
cp -rf ./* $TARBALL_DIR
tar cf - $TARBALL_DIR | xz -T0 -4e > $TARBALL_FILE
# Cleanup temp directory
rm -fr $TARBALL_DIR
rm -fr ./po
rm -fr ./doc-translated
# Show resume information about the tarball
echo -e "\n---------- Compute tarball checksums for digiKam $TARBALL_VERSION\n" > $TARBALL_CHECKSUMS
echo "File : $TARBALL_FILE" >> $TARBALL_CHECKSUMS
echo -n "Size : " >> $TARBALL_CHECKSUMS
du -h "$TARBALL_FILE" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS
echo -n "MD5 sum : " >> $TARBALL_CHECKSUMS
md5sum "$TARBALL_FILE" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS
echo -n "SHA1 sum : " >> $TARBALL_CHECKSUMS
sha1sum "$TARBALL_FILE" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS
echo -n "SHA256 sum : " >> $TARBALL_CHECKSUMS
sha256sum "$TARBALL_FILE" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS
# Checksums to post on Phabricator at release time.
sha256sum "$TARBALL_FILE" > $TARBALL_SHA256SUMS
cat $TARBALL_CHECKSUMS
# Compute GPG signature.
if [[ $TARBALL_SIGN = 1 ]] ; then
cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -stabv "$TARBALL_FILE"
mv -f $TARBALL_FILE.asc $TARBALL_FILE.sig
echo "File : $TARBALL_FILE.sig" >> $TARBALL_CHECKSUMS
echo -n "Size : " >> $TARBALL_CHECKSUMS
du -h "$TARBALL_FILE.sig" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS
echo -n "MD5 sum : " >> $TARBALL_CHECKSUMS
md5sum "$TARBALL_FILE.sig" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS
echo -n "SHA1 sum : " >> $TARBALL_CHECKSUMS
sha1sum "$TARBALL_FILE.sig" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS
echo -n "SHA256 sum : " >> $TARBALL_CHECKSUMS
sha256sum "$TARBALL_FILE.sig" | { read first rest ; echo $first ; } >> $TARBALL_CHECKSUMS
# Checksums to post on Phabricator at release time.
sha256sum "$TARBALL_FILE.sig" >> $TARBALL_SHA256SUMS
fi