Newer
Older
# Usage: sudo ./update_project.bash
# TODO Use git clone in temporary directory
mv ${HOME}/tmp/etsi_its.tar.bz2 ${HOME}/tmp/etsi_its.tar.`date +'%Y%m%d'`.bz2
find ${PATH_DEV_ITS} -name "*.o" -exec rm {} \;
tar jcvf ${HOME}/tmp/etsi_its.tar.bz2 ${PATH_DEV_ITS}
rm -fr ${PATH_DEV_ITS}
mkdir -p ${PATH_DEV_ITS}/asn1/ ${PATH_DEV_ITS}/ttcn/LibIts/asn1/ ${PATH_DEV_ITS}/include ${PATH_DEV_ITS}/bin ${PATH_DEV_ITS}/lib ${PATH_DEV_ITS}/objs ${PATH_DEV_ITS}/src ${PATH_DEV_ITS}/docs
# Update ASN.1 files
echo 'Updating ASN.1 files'
ASN1_SRC_PATH=${SRC_ITS_PATH}/ttcn/LibIts/asn1
ASN1_DST_PATH=${PATH_DEV_ITS}/ttcn/LibIts/asn1
NB_DEL=`echo ${ASN1_SRC_PATH} | awk -F"/" '{print NF + 1}'`
#ASN1_DIR_LIST=`find ${ASN1_SRC_PATH} -type d -not -path "*/.svn*" | cut -sd / -f${NB_DEL}-`
ASN1_DIR_LIST="CAM DENM EVCSN EV-RSR IS ITS-Container Security"
ASN1_SUBDIR_LIST=`find $ASN1_SRC_PATH/$i -type d | cut -sd / -f${NB_DEL}-`
for j in ${ASN1_SUBDIR_LIST}
if [ ! -d ${ASN1_DST_PATH}/$j ]
then
mkdir ${ASN1_DST_PATH}/$j
chmod 775 ${ASN1_DST_PATH}/$j
fi
for k in `ls ${ASN1_SRC_PATH}/$j/*.asn`
do
cp $k ${ASN1_DST_PATH}/$j
done
cp ${SRC_ITS_PATH}/asn1/Makefile ${PATH_DEV_ITS}/asn1
# Update testdata
echo 'Updating testdata'
FWK_SRC_PATH=${SRC_ITS_PATH}/testdata
FWK_DST_PATH=${PATH_DEV_ITS}
if [ -d ${FWK_SRC_PATH} ]
then
cp -Rp ${FWK_SRC_PATH} ${FWK_DST_PATH}
fi
# Update ETSI Framework files
echo 'Updating ETSI Framework files'
FWK_SRC_PATH=${SRC_ITS_PATH}/ccsrc
FWK_DST_PATH=${PATH_DEV_ITS}/framework
mkdir -p ${FWK_DST_PATH}/src ${FWK_DST_PATH}/include
chmod -R 775 ${FWK_DST_PATH}
# Create link to TITAN Abstract_Socket
ln -sf $TOP/../titan.TestPorts.Common_Components.Abstract_Socket/src/Abstract_Socket.cc ${FWK_DST_PATH}/src/Abstract_Socket.cc
ln -sf $TOP/../titan.TestPorts.Common_Components.Abstract_Socket/src/Abstract_Socket.hh ${FWK_DST_PATH}/include/Abstract_Socket.hh
FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/Protocols/ -name "*.h*" -type f`
FWK_DIR_LIST_THH=`find ${FWK_SRC_PATH}/Protocols/ -name "*.t.h*" -type f`
FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/Protocols/ -name "*.c*" -type f`
FWK_DIR_LIST_L=`find ${FWK_SRC_PATH}/Protocols/ -name "*.l" -type f`
FWK_DIR_LIST_Y=`find ${FWK_SRC_PATH}/Protocols/ -name "*.y" -type f`
for i in ${FWK_DIR_LIST_HH}
do
done
if [ "${FWK_DIR_LIST_L}" != "" ]
then
for i in ${FWK_DIR_LIST_L}
do
done
fi
if [ "${FWK_DIR_LIST_Y}" != "" ]
then
for i in ${FWK_DIR_LIST_Y}
do
done
fi
FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/Framework/ -name "*.h*" -type f`
FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/Framework/ -name "*.c*" -type f`
for i in ${FWK_DIR_LIST_HH}
do
cp $i ${FWK_DST_PATH}/include
done
for i in ${FWK_DIR_LIST_CC}
do
cp $i ${FWK_DST_PATH}/src
done
FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/loggers/ -name "*.h*" -type f`
FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/loggers/ -name "*.c*" -type f`
for i in ${FWK_DIR_LIST_HH}
do
cp $i ${FWK_DST_PATH}/include
done
for i in ${FWK_DIR_LIST_CC}
do
cp $i ${FWK_DST_PATH}/src
done
FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/Asn1c/ -name "*.h*" -type f`
FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/Asn1c/ -name "*.c*" -type f`
for i in ${FWK_DIR_LIST_HH}
do
cp $i ${FWK_DST_PATH}/include
done
for i in ${FWK_DIR_LIST_CC}
do
cp $i ${FWK_DST_PATH}/src
done
TTCN_3_ORG_PATH=${SRC_ITS_PATH}/ttcn
TTCN_3_DST_PATH=${PATH_DEV_ITS}/src
CC_SRC_PATH=${SRC_ITS_PATH}/ccsrc
TTCN_3_ATS_LIST='AtsAutoInterop AtsCAM AtsDENM AtsBTP AtsGeoNetworking AtsSecurity AtsRSUsSimulator LibCommon/ttcn TestCodec AtsGenCert AtsPki'
for i in ${TTCN_3_ATS_LIST}
do
if [ ! -d ${TTCN_3_DST_PATH}/$i ]
then
mkdir -p ${TTCN_3_DST_PATH}/$i/bin ${TTCN_3_DST_PATH}/$i/lib ${TTCN_3_DST_PATH}/$i/src ${TTCN_3_DST_PATH}/$i/include ${TTCN_3_DST_PATH}/$i/ttcn ${TTCN_3_DST_PATH}/$i/objs ${TTCN_3_DST_PATH}/$i/etc ${TTCN_3_DST_PATH}/$i/docs
chmod -R 775 ${TTCN_3_DST_PATH}/$i
fi
cp ${TTCN_3_ORG_PATH}/$i/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn
cp ${TTCN_3_ORG_PATH}/../etc/$i/*.cfg ${TTCN_3_DST_PATH}/$i/etc
cp ${TTCN_3_ORG_PATH}/../docs/$i/o2.cfg ${TTCN_3_DST_PATH}/$i/docs
done
# Update libraries & CC files
TTCN_3_LIB_LIST='Common BTP CAM DENM GeoNetworking Ipv6OverGeoNetworking Security MapemSpatem IVIM SremSsem AtsRSUsSimulator Http Pki'
mkdir -p ${TTCN_3_DST_PATH}/LibIts/$i/docs ${TTCN_3_DST_PATH}/LibIts/$i/src ${TTCN_3_DST_PATH}/LibIts/$i/include ${TTCN_3_DST_PATH}/LibIts/$i/ttcn
cp ${TTCN_3_ORG_PATH}/LibIts/ttcn/$i/*.ttcn ${TTCN_3_DST_PATH}/LibIts/$i/ttcn
cp ${CC_SRC_PATH}/Externals/LibItsCommon_externals.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/EncDec/LibItsBtp_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/BTP_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/BTP_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/BTP_ports/*.partC ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/BTP_ports/*.partH ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/EncDec/LibItsCam_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/CAM_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/CAM_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/CAM_ports/*.partC ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/CAM_ports/*.partH ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/EncDec/LibItsDenm_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/DENM_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/DENM_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/DENM_ports/*.partC ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/DENM_ports/*.partH ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/EncDec/LibItsGeoNetworking_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Externals/LibItsGeoNetworking_externals.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/GN_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/GN_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/GN_ports/*.partC ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/GN_ports/*.partH ${TTCN_3_DST_PATH}/LibIts/$i/include
elif [ "$i" == "Ipv6OverGeoNetworking" ]
then
cp ${CC_SRC_PATH}/EncDec/LibItsIpv6OverGeoNetworking_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Externals/LibItsIpv6OverGeoNetworking_externals.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/IPv6oGN_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/IPv6oGN_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/EncDec/LibItsSecurity_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Externals/LibItsSecurity_externals.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/EncDec/LibItsHttp_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/Http_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/Http_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/EncDec/LibItsPki_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/EncDec/LibItsSecurity_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Externals/LibItsSecurity_externals.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/EncDec/LibItsMapemSpatem_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/MapemSpatem_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/MapemSpatem_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/MapemSpatem_ports/*.partC ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/MapemSpatem_ports/*.partH ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/EncDec/LibItsIvim_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/IVIM_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/IVIM_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/IVIM_ports/*.partC ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/IVIM_ports/*.partH ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/EncDec/LibItsSremSsem_Encdec.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/SremSsem_ports/*.cc ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/SremSsem_ports/*.hh ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Ports/LibIts_ports/SremSsem_ports/*.partC ${TTCN_3_DST_PATH}/LibIts/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/SremSsem_ports/*.partH ${TTCN_3_DST_PATH}/LibIts/$i/include
cp ${CC_SRC_PATH}/Externals/AtsRSUsSimulator_externals.cc ${TTCN_3_DST_PATH}/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/RSUsSimulator_ports/*.cc ${TTCN_3_DST_PATH}/$i/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/RSUsSimulator_ports/*.hh ${TTCN_3_DST_PATH}/$i/include
fi
done
# Generate Bison parsers is any
cd ${FWK_DST_PATH}/src
if [ "${FWK_DIR_LIST_Y}" != "" ]
then
for i in ${FWK_DIR_LIST_Y}
do
BASE_NAME=$(basename "$i" .y)
bison ${BASE_NAME}.y --defines=../include/${BASE_NAME}.h -o${BASE_NAME}.c
done
fi
if [ "${FWK_DIR_LIST_L}" != "" ]
then
for i in ${FWK_DIR_LIST_L}
do
BASE_NAME=$(basename "$i" .l)
# Patch ASN1C Makefile
# Update GeoNetworking
cp ${PATH_PATCHES}/geonw_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsGeoNetworking/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/AtsGeoNetworking/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/AtsGeoNetworking/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/AtsGeoNetworking/bin
# Update BTP
cp ${PATH_PATCHES}/btp_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsBTP/bin
${RUN_PATH}/etsi_its_patches/asn1c_patch.bash ${ASN1_DST_PATH}/../Makefile
# Update CAM
cp ${PATH_PATCHES}/cam_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsCAM/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/AtsCAM/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/AtsCAM/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/AtsCAM/bin
# Update DENM
cp ${PATH_PATCHES}/denm_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsDENM/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/AtsDENM/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/AtsDENM/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/AtsDENM/bin
# Update RSUsSimulator
cp ${PATH_PATCHES}/rsusimulator_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsRSUsSimulator/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/AtsRSUsSimulator/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/AtsRSUsSimulator/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/AtsRSUsSimulator/bin
cp ${CC_SRC_PATH}/Ports/LibIts_ports/AutoInterop_ports/*.cc ${TTCN_3_DST_PATH}/AtsAutoInterop/src
cp ${CC_SRC_PATH}/Ports/LibIts_ports/AutoInterop_ports/*.hh ${TTCN_3_DST_PATH}/AtsAutoInterop/include
cp ${PATH_PATCHES}/autointerop_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsAutoInterop/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/AtsAutoInterop/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/AtsAutoInterop/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/AtsAutoInterop/bin
# Update Security
cp ${PATH_PATCHES}/security_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsSecurity/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/AtsSecurity/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/AtsSecurity/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/AtsSecurity/bin
# Update GenCert
cp ${PATH_PATCHES}/gencert_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsGenCert/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/AtsGenCert/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/AtsGenCert/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/AtsGenCert/bin
# Update TestCodec
cp ${PATH_PATCHES}/testcodec_generate_makefile.bash ${PATH_DEV_ITS}/src/TestCodec/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/TestCodec/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/TestCodec/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/TestCodec/bin
# Update Pki
cp ${PATH_PATCHES}/pki_generate_makefile.bash ${PATH_DEV_ITS}/src/AtsPki/bin
cp ${PATH_PATCHES}/run_mtc.bash ${PATH_DEV_ITS}/src/AtsPki/bin
cp ${PATH_PATCHES}/run_ptcs.bash ${PATH_DEV_ITS}/src/AtsPki/bin
cp ${PATH_PATCHES}/run_all.bash ${PATH_DEV_ITS}/src/AtsPki/bin
find ${PATH_DEV_ITS} -type f -exec chmod 664 {} \;
find ${PATH_DEV_ITS} -name "*.bash" -type f -exec chmod 775 {} \;
find ${PATH_DEV_ITS} -type d -exec chmod 775 {} \;
chown -R ${CHOWN_USER_GROUP} ${PATH_DEV_ITS}
mkdir ${PATH_DEV_ITS}/bin/asn1
cd ${PATH_DEV_ITS}/bin/asn1
make CC=gcc -f ${PATH_DEV_ITS}/asn1/Makefile
rm -fr ${PATH_DEV_ITS}/ttcn/LibIts/asn1/IS/ISO_TS_19091/original
cd -
if [ ! -d ${PATH_DEV_ITS}/include/asn1 ]
then
mkdir ${PATH_DEV_ITS}/include/asn1
else
for i in `find ${PATH_DEV_ITS}/include/asn1 -name "*.h"`;
do
done
fi
for i in `find ${PATH_DEV_ITS}/bin/asn1 -name "*.h"`
do
cp $i ${PATH_DEV_ITS}/include/asn1
done
ln -sf ${PATH_DEV_ITS}/bin/asn1/libItsAsn.so ${PATH_DEV_ITS}/lib/libItsAsn.so
#cp ${HOME}/frameworks/asn1c/skeletons/ANY.h ${PATH_DEV_ITS}/include/asn1