#!/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
# 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
# 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
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
* 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.
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);