## Install
-Execute 'scons install'
-(install-include-and-lib and install-example, are another aliases for selective installation)
+Execute 'sudo scons install-include' for only headers
+Execute 'sudo scons install-lib' for only libraries
+Execute 'sudo scons install-include-and-lib' for headers & libraries
+Execute 'sudo scons install-example' for only example binaries/resources
+Execute 'sudo scons install' to install the whole suite
## Uninstall
-Execute 'scons uninstall'
+Execute 'sudo scons uninstall'
# only modified files:
env.Alias('doc', env.Command('doc.dummy', [], 'cd docs/doxygen; doxygen'))
+# Installation aliases:
#
-# Run 'sudo scons install' to install the suite:
-#
-# 'sudo scons install-include' for only headers
-# 'sudo scons install-lib' for only libraries
-# 'sudo scons install-bin' for only binaries
+# 'sudo scons install-include' for only headers
+# 'sudo scons install-lib' for only libraries
+# 'sudo scons install-include-and-lib' for headers & libraries
+# 'sudo scons install-example' for only example binaries/resources
+# 'sudo scons install' to install the whole suite
#
# Run 'sudo scons uninstall' to uninstall the suite
#
install_include = env.Install (target_usr_local_include, Glob("include/anna/*"))
install_lib = env.Install (target_usr_local_lib, Glob("source/*/" + variant + "/*.a"))
install_example = env.Install (target_opt_bin, Glob("example/*/*/" + variant + "/example_*"))
+postinstall_example = env.Command('./example/postinstall.out', None, './example/postinstall.sh')
+
#Default ('install')
Depends (install_include, test_unit_result)
Depends (install_lib, test_unit_result)
Depends (install_example, test_unit_result)
+ii = env.Alias('install-include', [target_usr_local_include])
+il = env.Alias('install-lib', [target_usr_local_lib])
iil = env.Alias('install-include-and-lib', [target_usr_local_include, target_usr_local_lib])
-iex = env.Alias('install-example', target_opt_bin)
+iex = env.Alias('install-example', [target_opt_bin, postinstall_example])
env.Alias('install', [iil, iex])
env.Command ("uninstall", None, [ Delete(target_usr_local_include), Delete(target_usr_local_lib), Delete(target_opt_bin) ])
MSGDTD=../../../include/anna/diameter/codec/message.dtd
DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd
BASE_PROT=commands_baseProtocol.xml
-EXEC=./debug/example_diameter_launcher
+
+# Executables in priority order:
+EXEC_installed=/opt/bin/anna/example_diameter_launcher
+EXECS=( $EXEC_installed ./release/example_diameter_launcher ./debug/example_diameter_launcher )
#############
# FUNCTIONS #
echo "---------------------------------------"
echo
echo "Basic checkings ..."
-[ ! -f $EXEC ] && _exit "Anna Diameter Launcher (ADL) is not linked. Execute 'scons' for 'anna' suite."
+available=
+for EXEC in ${EXECS[@]}; do
+ echo -n "Looking executable at '$EXEC' ... "
+ [ -x $EXEC ] && { available=yes ; echo "available !" ; break ; }
+ echo "not found"
+done
+[ -z "$available" ] && _exit "Anna Diameter Launcher (ADL) is not installed neither linked. See README.md (Install section)."
[ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
echo
mkdir -p $DPATH/DTDs
mkdir -p $DPATH/counters
mkdir -p $DPATH/resources
-cp $EXEC $DPATH/ADL-launcher
+if [ "$EXEC" = "$EXEC_installed" ]
+then
+ ln -s $EXEC_installed $DPATH/ADL-launcher
+else
+ cp $EXEC $DPATH/ADL-launcher
+fi
cp -rL $DEPLOYMENTS_DIR/* $DPATH
cp resources/* $DPATH/resources
cp $SETUPS_DIR/*xml $DPATH/stacks
STD_DICTIONARY=stacks/avps_etsi.xml,stacks/avps_ietf.xml,stacks/avps_tgpp.xml,stacks/commands_baseProtocol.xml
APP_DICTIONARY=stacks/commands_qosControl.xml
DICTIONARY=$STD_DICTIONARY,$APP_DICTIONARY
-# Perhaps the stack is not fully defined:
-#KINDNESS=-ignoreErrors
-# But we prefer stack to generate Failed-AVP automatically:
-KINDNESS=
# Communication endpoints:
LOCAL_STANDARD_ENDPOINT=localhost:3868
# General
EXE_BN=ADL-launcher
-# Tracing:
-TRACING="-cntDir counters"
-# need detailed traces ?:
-#TRACING="$TRACING -trace debug"
-
#############
# FUNCTIONS #
#############
tol=$(get_tol $option)
[ "$tol" = "" ] && _exit "Option '$option' not implemented !!"
+# Tracing
+TRACING="-cntDir counters"
+echo
+echo "Enable debug traces ? (y/n) [n]:"
+read enable
+[ "$enable" = "" ] && enable=n
+[ "$enable" = "y" ] && TRACING="$TRACING -trace debug"
+
+# Kindness
+KINDNESS=
+echo
+echo "Strict xml for decoded messages ? (y/n) [y]:"
+echo " (ignoring flags turns a made-up xml representation; execute './$EXE_BN | grep -A1 ignoreFlags:' for more help)"
+read strict
+[ "$strict" = "" ] && strict=y
+[ "$strict" = "n" ] && KINDNESS="-ignoreFlags"
+if [ "$option" = "s" ]
+then
+ echo
+ echo "Ignore errors ? (y/n) [n]:"
+ echo " (ignoring errors, the process won't answer Failed-AVP automatically; execute './$EXE_BN | grep -A1 ignoreErrors:' for more help)"
+ read i_errors
+ [ "$i_errors" = "" ] && i_errors=n
+ [ "$i_errors" = "y" ] && KINDNESS="$KINDNESS -ignoreErrors"
+fi
+
# Run script:
EXE_LINK=ADL-$tol
ln -sf $EXE_BN $EXE_LINK
esac
+echo
echo "Created 'run.sh' script !"
echo
--- /dev/null
+#!/bin/bash
+
+cd `dirname $0`
+
+cat << EOF
+
+=========================== [483/19225]
+Post-installation procedure
+===========================
+
+This will preconfigure examples when proceed.
+
+You can also execute this procedure later by mean:
+
+ 1) scons install: no sudo required again once installed and perhaps
+ you prefer deployments with another unix user.
+
+ 2) Executing './example/postinstall.sh'
+
+
+Press ENTER to continue, CTRL+C to abort ...
+EOF
+
+read
+
+# diameter module
+./diameter/launcher/DEPLOY.sh
+
+# ...
+# ...
+
+# perhaps the user wants to redeploy ...
+#touch `basename $0 .sh`.out
+
+exit 0
+