X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=appimage%2Fbuild_appimage.sh;h=db3f6b30b3e2de61370b7d9e052ae75187a82127;hb=0e1c5fb91c45cb36a2d89615196a62c74f6c320c;hp=87a2111f4cfb6d53d629a1e67ae1be39e3b47dde;hpb=d728ef40502b1a9665c3bda11a437e8f3638adf7;p=citadel.git diff --git a/appimage/build_appimage.sh b/appimage/build_appimage.sh index 87a2111f4..db3f6b30b 100755 --- a/appimage/build_appimage.sh +++ b/appimage/build_appimage.sh @@ -1,34 +1,49 @@ #!/bin/bash +# Work from the directory this script is in +APPIMAGE_BUILD_DIR=$(dirname $(readlink -f $0)) +cd $APPIMAGE_BUILD_DIR || exit 28 +echo APPIMAGE_BUILD_DIR is `pwd` + +# Remove old versions +rm -vf citadel-*appimage + export CITADEL_BUILD_DIR=/tmp/citadel-build-$$ export WEBCIT_BUILD_DIR=/tmp/webcit-build-$$ -rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR # libcitadel has to be built in a "real" library directory pushd ../libcitadel || exit 1 make distclean 2>/dev/null -./bootstrap || exit 1 -./configure || exit 1 -make || exit 1 -make install || exit 1 +./bootstrap || exit 2 +./configure || exit 3 +make || exit 4 +make install || exit 5 +popd + +# Build the text mode client +pushd ../textclient || exit 22 +make distclean 2>/dev/null +./bootstrap || exit 23 +./configure --prefix=`pwd` || exit 24 +make || exit 25 popd # Build the Citadel server -pushd ../citadel || exit 1 +pushd ../citadel || exit 6 make distclean 2>/dev/null -./bootstrap || exit 1 -./configure --prefix=$CITADEL_BUILD_DIR || exit 1 -make || exit 1 -make install || exit 1 +./bootstrap || exit 7 +./configure --prefix=$CITADEL_BUILD_DIR || exit 8 +make || exit 9 +make install || exit 10 popd # Build WebCit -pushd ../webcit || exit 1 +pushd ../webcit || exit 11 make distclean 2>/dev/null -./bootstrap || exit 1 -./configure --prefix=$WEBCIT_BUILD_DIR || exit 1 -make || exit 1 -make install || exit 1 +./bootstrap || exit 12 +./configure --prefix=$WEBCIT_BUILD_DIR || exit 13 +make || exit 14 +make install || exit 15 popd # Clear out any old versions in the AppDir @@ -37,32 +52,59 @@ mkdir -p citadel.AppDir/usr/bin mkdir -p citadel.AppDir/usr/lib # Copy over all the libraries we used -for bin in $CITADEL_BUILD_DIR/citserver $WEBCIT_BUILD_DIR/webcit +for bin in \ + $CITADEL_BUILD_DIR/citserver \ + $WEBCIT_BUILD_DIR/webcit \ + $CITADEL_BUILD_DIR/ctdlmigrate \ + ../textclient/citadel \ + `which gdb` do - for x in `ldd $bin | awk ' { print $3 } ' | grep -v -e '^$' | grep -v 'libc.so' | grep -v 'libpthread.so' | grep -v 'libresolv.so'` - do - cp -v -L $x citadel.AppDir/usr/lib/ - done + ldd $bin +done | sort | while read libname junk libpath +do + if [ ! -e ${libpath} 2>/dev/null ] ; then + echo -e \\033[31m ${libname} was not found and will not be packaged. \\033[0m + elif grep ^${libname}$ excludelist >/dev/null 2>/dev/null ; then + echo -e \\033[33m ${libname} is in the exclude list and will not be packaged. \\033[0m + else + echo -e \\033[32m ${libname} will be packaged. \\033[0m + cp -L ${libpath} citadel.AppDir/usr/lib/ 2>/dev/null + fi done ldconfig -v citadel.AppDir/usr/lib +# Copy over some utilities +for bin in db_dump db_load db_recover gdb +do + cp `which $bin` citadel.AppDir/usr/bin/ || exit 16 +done + +# Copy over the client +cp ../textclient/citadel citadel.AppDir/usr/bin/ || exit 26 +cp ../textclient/citadel.rc citadel.AppDir/ || exit 27 + # Install the Citadel Server application tree -mkdir -p citadel.AppDir/usr/local/citadel -rsync -va $CITADEL_BUILD_DIR/ ./citadel.AppDir/usr/local/citadel/ +mkdir -p citadel.AppDir/usr/local/citadel || exit 17 +rsync -va $CITADEL_BUILD_DIR/ ./citadel.AppDir/usr/local/citadel/ || exit 18 # Install the WebCit application tree -mkdir -p citadel.AppDir/usr/local/webcit -rsync -va $WEBCIT_BUILD_DIR/ ./citadel.AppDir/usr/local/webcit/ +mkdir -p citadel.AppDir/usr/local/webcit || exit 19 +rsync -va $WEBCIT_BUILD_DIR/ ./citadel.AppDir/usr/local/webcit/ || exit 20 # Remove the build directories rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR -cc ctdlvisor.c -o citadel.AppDir/usr/bin/ctdlvisor || exit 1 +cc ctdlvisor.c -o citadel.AppDir/usr/bin/ctdlvisor || exit 21 -cpu=`uname -p` -basefilename=citadel-`date +%s` -if [ $cpu == x86_64 ] ; then - ARCH=x86_64 appimagetool citadel.AppDir/ ${basefilename}-x64.appimage -else - ARCH=ARM appimagetool ${basefilename}.AppDir/ ${basefilename}-arm32.appimage +CPU=`uname -m` +basefilename=citadel-`cat ../release_version.txt` +if [ $CPU == x86_64 ] ; then + export ARCH=x86_64 +elif [ $CPU == armv7l ] ; then + export ARCH=armhf +elif [ $CPU == aarch64 ] ; then + export ARCH=aarch64 fi +echo ARCH: $ARCH +echo CPU: $CPU +appimagetool citadel.AppDir/ ${basefilename}-${CPU}.appimage