Files
asterisk/tests/CI/installAsterisk.sh
lvl b08427134f Introduce astcachedir, to be used for temporary bucket files
As described in the issue, /tmp is not a suitable location for a
large amount of cached media files, since most distributions make
/tmp a RAM-based tmpfs mount with limited capacity.

I opted for a location that can be configured separately, as opposed
to using a subdirectory of spooldir, given the different storage
profile (transient files vs files that might stay there indefinitely).

This commit just makes the cache directory configurable, and changes
the default location from /tmp to /var/cache/asterisk.

ASTERISK-29143

Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
2020-12-09 11:17:27 -06:00

35 lines
1020 B
Bash
Executable File

#!/usr/bin/env bash
CIDIR=$(dirname $(readlink -fn $0))
UNINSTALL=0
UNINSTALL_ALL=0
source $CIDIR/ci.functions
MAKE=`which make`
if [ x"$DESTDIR" != x ] ; then
mkdir -p "$DESTDIR"
fi
destdir=${DESTDIR:+DESTDIR=$DESTDIR}
[ $UNINSTALL -gt 0 ] && ${MAKE} ${destdir} uninstall
[ $UNINSTALL_ALL -gt 0 ] && ${MAKE} ${destdir} uninstall-all
${MAKE} ${destdir} install || ${MAKE} ${destdir} NOISY_BUILD=yes install || exit 1
${MAKE} ${destdir} samples install-headers
if [ x"$DESTDIR" != x ] ; then
sed -i -r -e "s@\[directories\]\(!\)@[directories]@g" $DESTDIR/etc/asterisk/asterisk.conf
sed -i -r -e "s@ /(var|etc|usr)/@ $DESTDIR/\1/@g" $DESTDIR/etc/asterisk/asterisk.conf
fi
set +e
if [ x"$USER_GROUP" != x ] ; then
chown -R $USER_GROUP $DESTDIR/var/cache/asterisk
chown -R $USER_GROUP $DESTDIR/var/lib/asterisk
chown -R $USER_GROUP $DESTDIR/var/spool/asterisk
chown -R $USER_GROUP $DESTDIR/var/log/asterisk
chown -R $USER_GROUP $DESTDIR/var/run/asterisk
chown -R $USER_GROUP $DESTDIR/etc/asterisk
fi
ldconfig