3 export CITADEL_BUILD_DIR=/tmp/citadel-build-$$
4 export WEBCIT_BUILD_DIR=/tmp/webcit-build-$$
5 rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR
7 # libcitadel has to be built in a "real" library directory
8 pushd ../libcitadel || exit 1
12 make install || exit 1
15 # Build the Citadel server
16 pushd ../citadel || exit 1
18 ./configure --prefix=$CITADEL_BUILD_DIR || exit 1
20 make install || exit 1
24 pushd ../webcit || exit 1
26 ./configure --prefix=$WEBCIT_BUILD_DIR || exit 1
28 make install || exit 1
31 # Clear out any old versions in the AppDir
32 rm -frv citadel.AppDir/usr
33 mkdir -p citadel.AppDir/usr/bin
34 mkdir -p citadel.AppDir/usr/lib
36 # Copy over all the libraries we used
37 for bin in $CITADEL_BUILD_DIR/citserver $WEBCIT_BUILD_DIR/webcit
39 for x in `ldd $bin | awk ' { print $3 } ' | grep -v -e '^$' | grep -v 'libc.so' | grep -v 'libpthread.so' | grep -v 'libresolv.so'`
41 cp -v -L $x citadel.AppDir/usr/lib/
44 ldconfig -v citadel.AppDir/usr/lib
46 # Install the Citadel Server application tree
47 mkdir -p citadel.AppDir/usr/local/citadel
48 rsync -va $CITADEL_BUILD_DIR/ ./citadel.AppDir/usr/local/citadel/
50 # Install the WebCit application tree
51 mkdir -p citadel.AppDir/usr/local/webcit
52 rsync -va $WEBCIT_BUILD_DIR/ ./citadel.AppDir/usr/local/webcit/
54 # Remove the build directories
55 rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR
57 cc ctdlvisor.c -o citadel.AppDir/usr/bin/ctdlvisor || exit 1
60 basefilename=citadel-`date +%s`
61 if [ $cpu == x86_64 ] ; then
62 ARCH=x86_64 appimagetool citadel.AppDir/ ${basefilename}-x64.appimage
63 md5sum ${basefilename}-x64.appimage | awk ' { print $1 } ' >${basefilename}-x64.appimage.md5
65 ARCH=ARM appimagetool ${basefilename}.AppDir/ ${basefilename}-arm32.appimage
66 md5sum ${basefilename}-arm32.appimage | awk ' { print $1 } ' >${basefilename}-arm32.appimage.md5