forked from aforensics/HiddenVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-appimage.sh
executable file
·76 lines (62 loc) · 2.14 KB
/
make-appimage.sh
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
#!/bin/bash
# Copyright (C) 2020 HiddenVM <https://github.com/aforensics/HiddenVM>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -e
set -u
ROOT_DIR="./AppDir"
TARGET_DIR="./target"
# Blow away and recreate the AppImage root and target directories
rm -rf "${ROOT_DIR}" "${TARGET_DIR}"
mkdir -p "${ROOT_DIR}" "${TARGET_DIR}/release"
# Copy the files we want
cp -r \
../AppRun \
../launch-log-progress.sh \
../bootstrap.sh \
../lib \
../extras \
../HVM_VERSION \
../SUPPORTED_TAILS_VERSIONS \
../LICENSE \
hiddenvm.desktop \
"${ROOT_DIR}/"
pushd "${ROOT_DIR}"
# Use a dummy icon file for now
touch hiddenvm.svg
ln -s hiddenvm.svg .DirIcon
popd
APPIMGTOOL_NAME="appimagetool-x86_64.AppImage"
APPIMGTOOL="./${APPIMGTOOL_NAME}"
if [ ! -f "${APPIMGTOOL}" ]; then
echo "appimagetool needs to be downloaded"
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/${APPIMGTOOL_NAME}"
chmod +x "${APPIMGTOOL}"
fi
APPIMG_NAME="HiddenVM-$(cat ../HVM_VERSION)-x86_64"
APPIMG_FILE="${APPIMG_NAME}.AppImage"
# Generate the AppImage and copy the LICENSE file to the target directory
ARCH=x86_64 ${APPIMGTOOL} "${ROOT_DIR}" "${TARGET_DIR}/${APPIMG_FILE}"
cp ../LICENSE "${TARGET_DIR}"
pushd "${TARGET_DIR}"
# Zip up the AppImage and LICENSE files
if ! command -v zip; then
echo "Installing 'zip' ..."
sudo apt-get -y install zip
fi
zip "${APPIMG_NAME}.zip" "${APPIMG_FILE}" LICENSE
# Generate sha512 sums
sha512sum "${APPIMG_NAME}"* > "${APPIMG_NAME}.sha512"
mv "${APPIMG_NAME}.zip" "${APPIMG_NAME}.sha512" release/
popd