Salome HOME
PR: application install improvment
authorprascle <prascle>
Wed, 12 Apr 2006 08:53:42 +0000 (08:53 +0000)
committerprascle <prascle>
Wed, 12 Apr 2006 08:53:42 +0000 (08:53 +0000)
bin/appli_install.sh
bin/virtual_salome.py

index fb344c902521e1ac12512f7197f03aa469494e93..ce5938282b0b9485c157545e3a98f1e4d6f75cac 100644 (file)
@@ -28,15 +28,15 @@ else
   #     edit and uncomment the following line to set it, and comment the echo and exit lines
   #ln -fs myPathForSalomePrerequisiteScriptToBeSourced env.d/envProducts.sh
   echo "The file to source for SALOME prerequisite definition is not known:"
-  echo "--> Edit the corresponding line in " $0 ",Comment this message and the exit command,"
+  echo "--> Edit the corresponding line in " $0 ",Comment this message and the following exit command,"
   exit 1;
 fi
 
 # --- symbolic links creation, from modules_root_dir
 
-VERSION=BR_PR_V320b1
+VERSION=V3_2_0
 
-for module in KERNEL MED GUI GEOM SMESH VISU SUPERV LIGHT NETGENPLUGIN PYCALCULATOR PYTIX
+for module in KERNEL MED GUI GEOM SMESH VISU SUPERV LIGHT NETGENPLUGIN PYCALCULATOR; 
 do 
     echo " ========= " ${module};
     python virtual_salome.py -v --prefix="." --module=$INSTALL_ROOT/${module}_${VERSION}
@@ -60,4 +60,8 @@ echo "export PYHELLO_ROOT_DIR=$APPLI_ROOT" >> env.d/configSalome.sh
 echo "export SalomeAppConfig=$APPLI_ROOT:$APPLI_ROOT/share/salome/resources" >> env.d/configGUI.sh
 echo "export SUITRoot=$APPLI_ROOT/share/salome" >> env.d/configGUI.sh
 
+# --- SAMPLES directory
+
+echo "export DATA_DIR=$INSTALL_ROOT/SAMPLES/${VERSION}/SAMPLES_SRC" >> env.d/configSalome.sh
+
 # --- 
\ No newline at end of file
index 5c92ae8f649a96ec1fe911271bf4b70712ae3af3..03bc4c258ab849106d343d6d19ecceaa44353096 100644 (file)
@@ -20,15 +20,20 @@ def mkdir(path):
     else:
         if verbose:
             print 'Directory %s already exists' % path
+            pass
+        pass
 
 def symlink(src, dest):
     """Create a link if it does not exist"""
     if not os.path.exists(dest):
         if verbose:
             print 'Creating symlink %s' % dest
+            pass
         os.symlink(src, dest)
     else:
         print 'Symlink %s already exists' % dest
+        pass
+    pass
 
 def rmtree(dir):
     """Remove (recursive) a directory if it exists"""
@@ -38,6 +43,9 @@ def rmtree(dir):
     else:
         if verbose:
             print 'Do not need to delete %s; already gone' % dir
+            pass
+        pass
+    pass
 
 def main():
     usage="""usage: %prog [options]
@@ -47,13 +55,13 @@ Typical use is:
     parser = optparse.OptionParser(usage=usage)
 
     parser.add_option('-v', '--verbose', action='count', dest='verbose',
-        default=0, help="Increase verbosity")
+                      default=0, help="Increase verbosity")
 
     parser.add_option('--prefix', dest="prefix", default='.',
-        help="The base directory to install to (default .)")
+                      help="The base directory to install to (default .)")
 
     parser.add_option('--module', dest="module", 
-        help="The module directory to install in (mandatory)")
+                      help="The module directory to install in (mandatory)")
 
     parser.add_option('--clear', dest='clear', action='store_true',
         help="Clear out the install and start from scratch")
@@ -62,13 +70,13 @@ Typical use is:
     global verbose
 
     if not options.module:
-       print "Option module is mandatory"
-       return 
-
+        print "Option module is mandatory"
+        return 
+   
     module_dir=options.module
     if not os.path.exists(module_dir):
-       print "Module %s does not exist" % module_dir
-       return
+        print "Module %s does not exist" % module_dir
+        return
 
     home_dir = os.path.expanduser(options.prefix)
 
@@ -76,20 +84,22 @@ Typical use is:
     module_bin_dir=os.path.join(module_dir,'bin','salome')
     module_lib_dir=os.path.join(module_dir,'lib','salome')
     module_lib_py_dir=os.path.join(module_dir,'lib',py_version,'site-packages','salome')
-    module_lib_py_shared_dir=os.path.join(module_dir,'lib',py_version,'site-packages','salome','shared_modules')
+    module_lib_py_shared_dir=os.path.join(module_dir,'lib',py_version,
+                                          'site-packages','salome','shared_modules')
     module_share_dir=os.path.join(module_dir,'share','salome','resources')
     module_doc_gui_dir=os.path.join(module_dir,'doc','salome','gui')
     module_doc_tui_dir=os.path.join(module_dir,'doc','salome','tui')
     module_doc_dir=os.path.join(module_dir,'doc','salome')
 
     if not os.path.exists(module_lib_py_dir):
-       print "Python directory %s does not exist" % module_lib_py_dir
-       return
+        print "Python directory %s does not exist" % module_lib_py_dir
+        return
 
     bin_dir=os.path.join(home_dir,'bin','salome')
     lib_dir=os.path.join(home_dir,'lib','salome')
     lib_py_dir=os.path.join(home_dir,'lib',py_version,'site-packages','salome')
-    lib_py_shared_dir=os.path.join(home_dir,'lib',py_version,'site-packages','salome','shared_modules')
+    lib_py_shared_dir=os.path.join(home_dir,'lib',py_version,
+                                   'site-packages','salome','shared_modules')
     share_dir=os.path.join(home_dir,'share','salome','resources')
     doc_gui_dir=os.path.join(home_dir,'doc','salome','gui')
     doc_tui_dir=os.path.join(home_dir,'doc','salome','tui')
@@ -102,13 +112,15 @@ Typical use is:
         rmtree(lib_dir)
         rmtree(share_dir)
         rmtree(doc_dir)
-
+        pass
+    
     #directory bin/salome : create it and link content
     mkdir(bin_dir)
     for fn in os.listdir(module_bin_dir):
-#        if os.path.splitext(fn)[1] not in (".pyc",".pyo"): #Compiled python are excluded
-           symlink(os.path.join(module_bin_dir, fn), os.path.join(bin_dir, fn))
-
+        # if os.path.splitext(fn)[1] not in (".pyc",".pyo"): #Compiled python are excluded
+        symlink(os.path.join(module_bin_dir, fn), os.path.join(bin_dir, fn))
+        pass
+    
     #directory lib/salome : create it and link content
     mkdir(lib_dir)
     for fn in os.listdir(module_lib_dir):
@@ -117,11 +129,21 @@ Typical use is:
     #directory lib/py_version/site-packages/salome : create it and link content
     mkdir(lib_py_shared_dir)
     for fn in os.listdir(module_lib_py_dir):
-#        if os.path.splitext(fn)[1] not in (".pyc",".pyo"): #Compiled python are excluded
-           symlink(os.path.join(module_lib_py_dir, fn), os.path.join(lib_py_dir, fn))
-    for fn in os.listdir(module_lib_py_shared_dir):
-#        if os.path.splitext(fn)[1] not in (".pyc",".pyo"): #Compiled python are excluded
-           symlink(os.path.join(module_lib_py_shared_dir, fn), os.path.join(lib_py_shared_dir, fn))
+        # if os.path.splitext(fn)[1] not in (".pyc",".pyo"): #Compiled python are excluded
+        if os.path.split(fn)[1] != "shared_modules":
+            symlink(os.path.join(module_lib_py_dir, fn), os.path.join(lib_py_dir, fn))
+            pass
+        pass
+    if os.path.exists(module_lib_py_shared_dir):
+        for fn in os.listdir(module_lib_py_shared_dir):
+            # if os.path.splitext(fn)[1] not in (".pyc",".pyo"): #Compiled python are excluded
+            symlink(os.path.join(module_lib_py_shared_dir, fn), os.path.join(lib_py_shared_dir, fn))
+            pass
+        pass
+    else:
+        print module_lib_py_shared_dir, " doesn't exist"
+        pass    
+
 
     #directory share/salome/resources : create it and link content
     mkdir(share_dir)
@@ -135,19 +157,25 @@ Typical use is:
             if fn == 'gui':continue
             if fn == 'tui':continue
             symlink(os.path.join(module_doc_dir, fn), os.path.join(doc_dir, fn))
-
+            pass
+        pass
+    
     #directory doc/salome/gui : create it and link content
     if os.path.exists(module_doc_gui_dir):
         mkdir(doc_gui_dir)
         for fn in os.listdir(module_doc_gui_dir):
             symlink(os.path.join(module_doc_gui_dir, fn), os.path.join(doc_gui_dir, fn))
-
+            pass
+        pass
+    
     #directory doc/salome/tui : create it and link content
     if os.path.exists(module_doc_tui_dir):
         mkdir(doc_tui_dir)
         for fn in os.listdir(module_doc_tui_dir):
             symlink(os.path.join(module_doc_tui_dir, fn), os.path.join(doc_tui_dir, fn))
-
+            pass
+        pass
+    
 if __name__ == '__main__':
     main()
-
+    pass