3 # Work from the directory this script is in
4 APPIMAGE_BUILD_DIR=$(dirname $(readlink -f $0))
5 cd $APPIMAGE_BUILD_DIR || exit 28
6 echo APPIMAGE_BUILD_DIR is `pwd`
9 rm -vf citadel-*appimage
11 export CITADEL_BUILD_DIR=/tmp/citadel-build-$$
12 export WEBCIT_BUILD_DIR=/tmp/webcit-build-$$
14 # libcitadel has to be built in a "real" library directory
15 pushd ../libcitadel || exit 1
16 make distclean 2>/dev/null
20 make install || exit 5
23 # Build the text mode client
24 pushd ../textclient || exit 22
25 make distclean 2>/dev/null
26 ./bootstrap || exit 23
27 ./configure --prefix=`pwd` || exit 24
31 # Build the Citadel server
32 pushd ../citadel || exit 6
33 make distclean 2>/dev/null
35 ./configure --prefix=$CITADEL_BUILD_DIR || exit 8
37 make install || exit 10
41 pushd ../webcit || exit 11
42 make distclean 2>/dev/null
43 ./bootstrap || exit 12
44 ./configure --prefix=$WEBCIT_BUILD_DIR || exit 13
46 make install || exit 15
49 # Clear out any old versions in the AppDir
50 rm -frv citadel.AppDir/usr
51 mkdir -p citadel.AppDir/usr/bin
52 mkdir -p citadel.AppDir/usr/lib
54 # Copy over all the libraries we used
56 $CITADEL_BUILD_DIR/citserver \
57 $WEBCIT_BUILD_DIR/webcit \
58 $CITADEL_BUILD_DIR/ctdlmigrate \
59 ../textclient/citadel \
63 done | sort | while read libname junk libpath
65 if [ ! -e ${libpath} 2>/dev/null ] ; then
66 echo -e \\033[31m ${libname} was not found and will not be packaged. \\033[0m
67 elif grep ^${libname}$ excludelist >/dev/null 2>/dev/null ; then
68 echo -e \\033[33m ${libname} is in the exclude list and will not be packaged. \\033[0m
70 echo -e \\033[32m ${libname} will be packaged. \\033[0m
71 cp -L ${libpath} citadel.AppDir/usr/lib/ 2>/dev/null
74 ldconfig -v citadel.AppDir/usr/lib
76 # Copy over some utilities
77 for bin in db_dump db_load db_recover gdb
79 cp `which $bin` citadel.AppDir/usr/bin/ || exit 16
82 # Copy over the client
83 cp ../textclient/citadel citadel.AppDir/usr/bin/ || exit 26
84 cp ../textclient/citadel.rc citadel.AppDir/ || exit 27
86 # Install the Citadel Server application tree
87 mkdir -p citadel.AppDir/usr/local/citadel || exit 17
88 rsync -va $CITADEL_BUILD_DIR/ ./citadel.AppDir/usr/local/citadel/ || exit 18
90 # Install the WebCit application tree
91 mkdir -p citadel.AppDir/usr/local/webcit || exit 19
92 rsync -va $WEBCIT_BUILD_DIR/ ./citadel.AppDir/usr/local/webcit/ || exit 20
94 # Remove the build directories
95 rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR
97 cc ctdlvisor.c -o citadel.AppDir/usr/bin/ctdlvisor || exit 21
100 basefilename=citadel-`cat ../release_version.txt`
101 if [ $CPU == x86_64 ] ; then
103 elif [ $CPU == armv7l ] ; then
105 elif [ $CPU == aarch64 ] ; then
110 appimagetool citadel.AppDir/ ${basefilename}-${CPU}.appimage