3 rm -vf citadel-*appimage
5 export CITADEL_BUILD_DIR=/tmp/citadel-build-$$
6 export WEBCIT_BUILD_DIR=/tmp/webcit-build-$$
7 rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR
9 # libcitadel has to be built in a "real" library directory
10 pushd ../libcitadel || exit 1
11 make distclean 2>/dev/null
15 make install || exit 5
18 # Build the Citadel server
19 pushd ../citadel || exit 6
20 make distclean 2>/dev/null
22 ./configure --prefix=$CITADEL_BUILD_DIR || exit 8
24 make install || exit 10
28 pushd ../webcit || exit 11
29 make distclean 2>/dev/null
30 ./bootstrap || exit 12
31 ./configure --prefix=$WEBCIT_BUILD_DIR || exit 13
33 make install || exit 15
36 # Clear out any old versions in the AppDir
37 rm -frv citadel.AppDir/usr
38 mkdir -p citadel.AppDir/usr/bin
39 mkdir -p citadel.AppDir/usr/lib
41 # Copy over all the libraries we used
42 for bin in $CITADEL_BUILD_DIR/citserver $WEBCIT_BUILD_DIR/webcit $CITADEL_BUILD_DIR/ctdlmigrate `which gdb`
45 done | sort | while read libname junk libpath
47 if [ ! -e ${libpath} 2>/dev/null ] ; then
48 echo -e \\033[31m ${libname} was not found and will not be packaged. \\033[0m
49 elif grep ^${libname}$ excludelist >/dev/null 2>/dev/null ; then
50 echo -e \\033[33m ${libname} is in the exclude list and will not be packaged. \\033[0m
52 echo -e \\033[32m ${libname} will be packaged. \\033[0m
53 cp -L ${libpath} citadel.AppDir/usr/lib/ 2>/dev/null
56 ldconfig -v citadel.AppDir/usr/lib
58 # Copy over some utilities
59 for bin in db_dump db_load db_recover gdb
61 cp `which $bin` citadel.AppDir/usr/bin/ || exit 16
64 # Install the Citadel Server application tree
65 mkdir -p citadel.AppDir/usr/local/citadel || exit 17
66 rsync -va $CITADEL_BUILD_DIR/ ./citadel.AppDir/usr/local/citadel/ || exit 18
68 # Install the WebCit application tree
69 mkdir -p citadel.AppDir/usr/local/webcit || exit 19
70 rsync -va $WEBCIT_BUILD_DIR/ ./citadel.AppDir/usr/local/webcit/ || exit 20
72 # Remove the build directories
73 rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR
75 cc ctdlvisor.c -o citadel.AppDir/usr/bin/ctdlvisor || exit 21
78 basefilename=citadel-`date +%s`
79 if [ $CPU == x86_64 ] ; then
81 elif [ $CPU == armv7l ] ; then
86 appimagetool citadel.AppDir/ ${basefilename}-${CPU}.appimage