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 text mode client
19 pushd ../textclient || exit 22
20 make distclean 2>/dev/null
21 ./bootstrap || exit 23
22 ./configure --prefix=`pwd` || exit 24
26 # Build the Citadel server
27 pushd ../citadel || exit 6
28 make distclean 2>/dev/null
30 ./configure --prefix=$CITADEL_BUILD_DIR || exit 8
32 make install || exit 10
36 pushd ../webcit || exit 11
37 make distclean 2>/dev/null
38 ./bootstrap || exit 12
39 ./configure --prefix=$WEBCIT_BUILD_DIR || exit 13
41 make install || exit 15
44 # Clear out any old versions in the AppDir
45 rm -frv citadel.AppDir/usr
46 mkdir -p citadel.AppDir/usr/bin
47 mkdir -p citadel.AppDir/usr/lib
49 # Copy over all the libraries we used
51 $CITADEL_BUILD_DIR/citserver \
52 $WEBCIT_BUILD_DIR/webcit \
53 $CITADEL_BUILD_DIR/ctdlmigrate \
54 ../textclient/citadel \
58 done | sort | while read libname junk libpath
60 if [ ! -e ${libpath} 2>/dev/null ] ; then
61 echo -e \\033[31m ${libname} was not found and will not be packaged. \\033[0m
62 elif grep ^${libname}$ excludelist >/dev/null 2>/dev/null ; then
63 echo -e \\033[33m ${libname} is in the exclude list and will not be packaged. \\033[0m
65 echo -e \\033[32m ${libname} will be packaged. \\033[0m
66 cp -L ${libpath} citadel.AppDir/usr/lib/ 2>/dev/null
69 ldconfig -v citadel.AppDir/usr/lib
71 # Copy over some utilities
72 for bin in db_dump db_load db_recover gdb
74 cp `which $bin` citadel.AppDir/usr/bin/ || exit 16
77 # Copy over the client
78 cp ../textclient/citadel citadel.AppDir/usr/bin/ || exit 26
79 cp ../textclient/citadel.rc citadel.AppDir/ || exit 27
81 # Install the Citadel Server application tree
82 mkdir -p citadel.AppDir/usr/local/citadel || exit 17
83 rsync -va $CITADEL_BUILD_DIR/ ./citadel.AppDir/usr/local/citadel/ || exit 18
85 # Install the WebCit application tree
86 mkdir -p citadel.AppDir/usr/local/webcit || exit 19
87 rsync -va $WEBCIT_BUILD_DIR/ ./citadel.AppDir/usr/local/webcit/ || exit 20
89 # Remove the build directories
90 rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR
92 cc ctdlvisor.c -o citadel.AppDir/usr/bin/ctdlvisor || exit 21
95 basefilename=citadel-`date +%s`
96 if [ $CPU == x86_64 ] ; then
98 elif [ $CPU == armv7l ] ; then
103 appimagetool citadel.AppDir/ ${basefilename}-${CPU}.appimage