Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
czur-scanner-tools / opt / scanner / iris / bin / linux_install_idrs.sh
Size: Mime:
#
# iDRS 16 installation script for linux.
#
# linux_install_idrs16.sh:
# - creates all symbolic links for the iDRS librairies
#


# dir and list of librairies to link.
cd ..
BASE_DIR=`pwd`
BIN_DIR=$BASE_DIR/bin
LIBRARY_DIR=$BASE_DIR/lib
RESOURCE_DIR=$BASE_DIR/resources

cd $BIN_DIR

# function used to create links for one library.
sym_link_lib()
{

  # 1 from the lib path gets the lib dir and the lib name
  LIB_NAME=`echo $1 | awk -F"/" '{print $NF}'`
  LIB_BASE=`echo $LIB_NAME | awk -F "." '{print $1}'`'.so'
  
  # 2 check if we can access to the later version
  if [ $LIB_BASE.* != "" ]
  then
    LIB_DIR=`echo $1 | awk -F"/$LIB_BASE" '{print $1}'`
    CURRENT_DIR=`pwd`
  
    # 3 cd in the lib directory
    cd $LIB_DIR
  
    # 4 retrieve the versions (if less than 4 the lasts will be empty)
  
    LIB_FULL=`ls $LIB_BASE.* | tail -n1`
    LIB_V1=`echo $LIB_FULL | cut -f3 -d'.'`
  
  
    # 5 create the needed sym links.

    if [ "$LIB_V1" != "" ]
    then
      ln -sf "$LIB_NAME" "$LIB_BASE.$LIB_V1"
      ln -sf "$LIB_BASE.$LIB_V1" "$LIB_BASE"
    fi

    # 6 pop back dir.
    cd $CURRENT_DIR 
  fi
}

### "main" part of the script ###

# link librairies
for library in `ls $LIBRARY_DIR | grep '.so.'`
do
  echo "Creating symbolic links for library $library"
  sym_link_lib $LIBRARY_DIR/$library
done

# link resources
cd $LIBRARY_DIR
for resource in `ls $RESOURCE_DIR`
do
  echo "Creating symbolic link for resource $resource"
  ln -sf $RESOURCE_DIR/$resource $resource
done

# add symlink in bin for .NET assemblies
cd $BIN_DIR
for assembly in `ls $LIBRARY_DIR | grep '.dll'`
do
  echo "Creating symbolic link for .NET assembly $assembly"
  ln -sf $LIBRARY_DIR/$assembly
done
cd $BASE_DIR
echo "done !"