From 2f8e2137a6b9cb436d9dd01c2cf28a8a772044c1 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 23 Jan 2021 11:28:35 -0500 Subject: [PATCH] Build citadel server and webcit in temp directories. This allows the builder to enjoy a persistent /usr/local/citadel on the build host. --- appimage/build_appimage.sh | 38 ++++++++++++++++++++++------------- citadel/internet_addressing.c | 4 ++-- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/appimage/build_appimage.sh b/appimage/build_appimage.sh index f98e8ef21..ae54bb2a3 100755 --- a/appimage/build_appimage.sh +++ b/appimage/build_appimage.sh @@ -1,8 +1,10 @@ #!/bin/bash -rm -fr /usr/local/citadel /usr/local/webcit +export CITADEL_BUILD_DIR=/tmp/citadel-build-$$ +export WEBCIT_BUILD_DIR=/tmp/webcit-build-$$ +rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR -# Build libcitadel +# libcitadel has to be built in a "real" library directory pushd ../libcitadel || exit 1 ./bootstrap || exit 1 ./configure || exit 1 @@ -13,7 +15,7 @@ popd # Build the Citadel server pushd ../citadel || exit 1 ./bootstrap || exit 1 -./configure --prefix=/usr/local/citadel || exit 1 +./configure --prefix=$CITADEL_BUILD_DIR || exit 1 make || exit 1 make install || exit 1 popd @@ -21,18 +23,18 @@ popd # Build WebCit pushd ../webcit || exit 1 ./bootstrap || exit 1 -./configure --prefix=/usr/local/webcit || exit 1 +./configure --prefix=$WEBCIT_BUILD_DIR || exit 1 make || exit 1 make install || exit 1 popd -# Clear out our build directories +# Clear out any old versions in the AppDir rm -frv citadel.AppDir/usr mkdir -p citadel.AppDir/usr/bin mkdir -p citadel.AppDir/usr/lib # Copy over all the libraries we used -for bin in /usr/local/citadel/citserver /usr/local/webcit/webcit +for bin in $CITADEL_BUILD_DIR/citserver $WEBCIT_BUILD_DIR/webcit 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 @@ -41,14 +43,22 @@ do done ldconfig -v citadel.AppDir/usr/lib -# Copy over our application trees -for x in citadel webcit -do - mkdir -p citadel.AppDir/usr/local/$x - rsync -va /usr/local/$x/ ./citadel.AppDir/usr/local/$x/ -done +# Install the Citadel Server application tree +mkdir -p citadel.AppDir/usr/local/citadel +rsync -va $CITADEL_BUILD_DIR/ ./citadel.AppDir/usr/local/citadel/ -rm -fr /usr/local/citadel /usr/local/webcit +# Install the WebCit application tree +mkdir -p citadel.AppDir/usr/local/webcit +rsync -va $WEBCIT_BUILD_DIR/ ./citadel.AppDir/usr/local/webcit/ + +# Remove the build directories +rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR cc ctdlvisor.c -o citadel.AppDir/usr/bin/ctdlvisor || exit 1 -ARCH=ARM appimagetool citadel.AppDir/ + +cpu=`uname -p` +if [ $cpu == x86_64 ] ; then + ARCH=x86_64 appimagetool citadel.AppDir/ +else + ARCH=ARM appimagetool citadel.AppDir/ +fi diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 11cefd808..030291f6c 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -2,7 +2,7 @@ * This file contains functions which handle the mapping of Internet addresses * to users on the Citadel system. * - * Copyright (c) 1987-2020 by the citadel.org team + * Copyright (c) 1987-2021 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -1671,7 +1671,7 @@ void AutoGenerateEmailAddressForUser(struct ctdluser *user) snprintf(synthetic_email_addr, sizeof synthetic_email_addr, "ctdl%08x@%s", i, CtdlGetConfigStr("c_fqdn")); } u = CtdlDirectoryLookup(NULL, synthetic_email_addr, 0); - syslog(LOG_DEBUG, "\033[33mAddress <%s> lookup <%d>\033[0m", synthetic_email_addr, u); + syslog(LOG_DEBUG, "user_ops: address <%s> lookup returned <%d>", synthetic_email_addr, u); } CtdlSetEmailAddressesForUser(user->fullname, synthetic_email_addr); -- 2.30.2