-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpackage-appimage.sh
executable file
·111 lines (87 loc) · 2.11 KB
/
package-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
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
APP="f-crm"
ARCH="x86_64"
if [ -z "$F_CRM_VERSION" ]; then
F_CRM_VERSION="2.0.0"
echo "Warning: Missing F_CRM_VERSION variable!"
fi
if [ -z ${DIST_DIR:-} ];
then
DIST_DIR=`pwd`/dist/linux-appimage
fi
if [ -z ${SIGN_CERT:-} ];
then
SIGN_CERT="Developer ID Application"
fi
if [ -z ${BUILD_DIR:-} ]; then
BUILD_DIR=`pwd`/build
fi
if [ -z ${BUILD_DIR:-} ]; then
BUILD_DIR=`pwd`/build
fi
if [ -z ${SRC_DIR:-} ];
then
# Just assume we are run from the scipts directory
SRC_DIR=`pwd`/..
fi
if [ -z ${QTDIR:-} ];
then
QMAKE=qmake
else
export QT_LIBRARY_PATH=$QTDIR/lib
export QT_PLUGIN_PATH=$QTDIR/plugins/
QMAKE=$QTDIR/bin/qmake
fi
echo "Building ${APP} for APPIMAGE into ${DIST_DIR} from ${SRC_DIR}"
rm -rf $DIST_DIR $BUILD_DIR
mkdir -p $DIST_DIR && cd $DIST_DIR
mkdir -p $BUILD_DIR
pushd $BUILD_DIR
BUILD_DIR=$(pwd)
$QMAKE \
-spec linux-g++ \
"CONFIG += release x86_64" \
$SRC_DIR/${APP}.pro
if ! make -j10 ;
then
exit 1
fi
popd
pushd $DIST_DIR
APPIMAGE_DIR=$(pwd)/AppImage
echo "Constructing AppImage layout in: ${APPIMAGE_DIR}"
mkdir -p $APPIMAGE_DIR/usr/bin
if ! cp -v $BUILD_DIR/${APP} $APPIMAGE_DIR/usr/bin ;
then
exit 1
fi
mkdir -p $APPIMAGE_DIR/usr/lib
mkdir -p $APPIMAGE_DIR/usr/share/applications
printf "[Desktop Entry]\nType=Application\nName=${APP}\nExec=${APP}\nIcon=${APP}\nCategories=Office;" > $APPIMAGE_DIR/usr/share/applications/${APP}.desktop
mkdir -p $APPIMAGE_DIR/usr/share/icons/default/scalable/apps
cp $SRC_DIR/res/icons/${APP}.svg $APPIMAGE_DIR/usr/share/icons/default/scalable/apps
pushd ${APPIMAGE_DIR}
echo "Diagnostics information"
pwd
ls -la /etc/fuse.conf
ls -la /dev/fuse
echo "who: ${USER}"
whoami
echo "fusermount"
fusermount -V
echo "grep grops"
grep jenkins /etc/group
echo "grep users"
grep jenkins /etc/passwd
if ! linuxdeployqt \
$APPIMAGE_DIR/usr/share/applications/${APP}.desktop \
-qmake=$QMAKE \
-exclude-libs=libqsqlmysql,libqsqlpsql \
-extra-plugins=iconengines,imageformats \
-appimage ;
then
exit 1
fi
mv ${APP}-${ARCH}.AppImage $DIST_DIR/${APP}-${ARCH}-${F_CRM_VERSION}.AppImage
popd
popd