Build citadel server and webcit in temp directories. This allows the builder to...
authorArt Cancro <ajc@citadel.org>
Sat, 23 Jan 2021 16:28:35 +0000 (11:28 -0500)
committerArt Cancro <ajc@citadel.org>
Sat, 23 Jan 2021 16:28:35 +0000 (11:28 -0500)
appimage/build_appimage.sh
citadel/internet_addressing.c

index f98e8ef214d4c68cb8f0b1d524e8c2085c303ad0..ae54bb2a347b95132409ca8cbe05dbe6ae7abc04 100755 (executable)
@@ -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
index 11cefd808ee6ba52bdfd10a1a381d90326dc0ccf..030291f6c6412ec2286a356e64b33f986bae71e7 100644 (file)
@@ -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);