--- /dev/null
+#!/bin/bash
+
+usage()
+{
+ echo
+ echo Usage :
+ echo
+ echo " SA_new_cpp_component Name"
+ echo
+ echo " -> create the tree to compile a new C++ component linked with MED libs"
+ echo
+ exit 1
+}
+
+rename_dir()
+{
+ # Rename the first directory containing $oldName in their file name
+ liste=`find . -type d -name "*${oldName}*"`
+ for file in $liste
+ do
+ newFile=`echo $file | sed "s/${oldName}/${newName}/g"`
+ echo "mv -f $file $newFile"
+ mv -f $file $newFile
+ return 1
+ done
+ return 0
+}
+
+if [ $# -ne 1 ]
+then
+ usage
+fi
+
+tar xvfz ${HXX2SALOME_ROOT_DIR}/cpp_compo_template.tgz
+moduleName=${1}_CPP_SRC
+mv template_SRC ${moduleName}
+
+oldName=template
+newName=$1
+
+today=`date +%d%m%y`
+cd ${moduleName}
+echo
+echo Renamed Directories:
+echo
+
+# rename directories one by one
+rename_dir
+while [ $? -eq 1 ]
+do
+ rename_dir
+done
+
+# rename files containing ${oldName} in their name
+echo
+echo Renamed Files:
+echo
+liste=`find . -name "*${oldName}*"`
+for file in $liste
+do
+ newFile=`echo $file | sed "s/${oldName}/${newName}/g"`
+ echo "mv -f $file $newFile"
+ mv -f $file $newFile
+done
+
+echo
+echo Modified Files:
+echo
+# modify all files containing $oldName, replace occurences by $newName
+liste=`find -name "*"`
+for file in $liste
+do
+ if [ -f $file ]
+ then
+ grep $oldName $file > /dev/null 2>&1
+ if [ $? -eq 0 ]
+ then
+ echo $file
+ cat $file | sed "s/${oldName}/${newName}/g" > fic_temp_${today}
+ cp -f fic_temp_${today} $file
+ fi
+ fi
+done
+rm -f fic_temp_${today}
+cd -