6 SCR_DIR=`readlink -f $0 | xargs dirname`
7 PROJECT_ROOT=$(readlink -f $SCR_DIR/../../..)
18 [ -n "$msg" ] && echo -e "\n${msg}\n"
28 echo "------------------------------------------------------"
29 echo " AOTS ADML Agent installation "
30 echo "------------------------------------------------------"
32 [ -d $PROJECT_ROOT/build/Release ] && VARIANT=Release
33 [ -d $PROJECT_ROOT/build/Debug ] && VARIANT=Debug
34 [ -z "$VARIANT" ] && _exit "Cannot locate neither 'Release' nor 'Debug' variant !"
35 build_type_letter=$(echo $VARIANT | cut -c1 | tr '[:upper:]' '[:lower:]')
37 version__dflt=v"`date +'%y'`.`date +'%m'`.`date +'%d'`$build_type_letter"
38 INSTALL__dflt=$HOME/3rdParty/anna-aots-adml-builds/v"`date +'%y'`.`date +'%m'`.`date +'%d'`$build_type_letter"
40 echo "Choose the target path for installation [$INSTALL__dflt]:"
41 echo " (enter a non-existent directory)"
43 [ -z "$INSTALL" ] && INSTALL=$INSTALL__dflt
44 INSTALL=`readlink -m $INSTALL`
45 [ -d $INSTALL ] && _exit "The target installation directory ($INSTALL) already exists ! (if you want to reinstall, remove it first)"
48 echo "Stage 1: Deploying resources ......................"
51 cp -rL $SCR_DIR/deployments/aots-adml/* $INSTALL
53 # VARIABLES ######################################
55 LDIR=${PROJECT_ROOT}/example/diameter/launcher
56 BIN_DIR=${PROJECT_ROOT}/build/$VARIANT/bin
57 LIB_DIR=${PROJECT_ROOT}/build/$VARIANT/lib
62 DYNLIBS=${ADML}/dynlibs
63 ##################################################
66 echo "Variant: $VARIANT"
70 mkdir -p ${ADML}/counters
71 mkdir -p ${ADML}/test-reports
74 cp ${PROJECT_ROOT}/example/diameter/launcher/resources/scripts/operation_curl.sh ${ADML}/operation.sh
78 cp ${PROJECT_ROOT}/include/anna/diameter/codec/message.dtd ${DTDs}
79 cp ${PROJECT_ROOT}/include/anna/diameter/stack/dictionary.dtd ${DTDs}
80 cp ${PROJECT_ROOT}/example/diameter/launcher/resources/services_examples/services.dtd ${DTDs}
82 # Main Launcher and dynamic libraries:
83 cp ${BIN_DIR}/anna_diameter_launcher ${ADML}/ADML
84 cp -r $LIB_DIR/dynamic/launcher ${DYNLIBS}
85 cp $LIB_DIR/libanna_testing_shared.so ${DYNLIBS}
87 # Get stuff from leaf directories:
88 cd $LIB_DIR/dynamic/launcher
89 leafs=( $(find . -type d -links 2) )
92 cd ${PROJECT_ROOT}/dynamic/launcher
93 for dir in ${leafs[@]}
95 cp $dir/*.xml ${DYNLIBS}/$dir 2>/dev/null
96 cp $dir/dynamic.suffix ${DYNLIBS}/$dir 2>/dev/null
97 cp -r $dir/services ${DYNLIBS}/$dir 2>/dev/null
101 # ADML dynamic libs selection script:
102 cp ${LDIR}/resources/scripts/select_dynlib.sh ${DYNLIBS}/select.sh
104 # Default dynamic library:
106 ln -sf default/libanna_launcher_procedure_default_shared.so
109 # ADML Agent shall use http server:
110 httpOpt="--httpServer \`grep -v ^# .httpServer\`"
111 echo "${httpOpt}" >> ${ADML}/args.ft
112 echo "${httpOpt}" >> ${ADML}/args.st
113 echo "localhost:8000" > ${ADML}/.httpServer