install.tcl

Go to the documentation of this file.
00001 /* !/bin/sh*/
00002 /*  -*- Restart script using tclsh -*- \*/
00003 exec tclsh "$0" "$@"
00004 
00005  curdir =  [pwd]
00006 
00007 /*  Build one package*/
00008 /* */
00009 ret  {build} (type package_, type name) {
00010     global curdir
00011     
00012     puts "
00013 Checking system configuration..."
00014     exec_intercept_warning $package_name "./configure --exec-prefix=${curdir}/packages --prefix=${curdir}/packages --enable-threads"
00015     
00016     puts "
00017 Compiling package $package_name..."
00018     exec_intercept_warning $package_name "make"
00019     
00020     puts "
00021 Installing package $package_name..."
00022     exec_intercept_warning $package_name "make install"
00023 }
00024 
00025 /*  Execute a shell-command*/
00026 /*  and avoid interrupt by warnings on standard error stream*/
00027 /* */
00028 ret  {exec_intercept_warning} (type package_, type name , type shell_, type command) {
00029     # build an 'system exec' command (with redirection of standard error)
00030     # Intercept warnings issued on standard error and put them in file 'error.log'
00031     set command [concat exec $shell_command "2>error.log"]
00032     # Execute shell command
00033     set local_error [catch $command result]
00034     # Display results
00035     puts $result
00036     # If any error or warning
00037     if {[file exists error.log]} {
00038         # Display them
00039         puts [exec cat error.log]
00040     }
00041     # If error, stop execution
00042     if {$local_error != 0} {
00043         error "Generation of $package_name aborted"
00044     }
00045 }
00046 
00047 
00048 /*  Main*/
00049 
00050 cd package-source
00051 
00052 /*  Check presence of package uri (module of tcllib)*/
00053  error =  [catch {package require uri 1.2.1}]
00054 if {$error} {
00055         
00056     puts "
00057 /* */
00058 /*                                        #*/
00059 /*          Build package TclLib          #*/
00060 /*                                        #*/
00061 /* */
00062 "
00063     cd tcllib-1.10
00064     puts [exec ./installer.tcl -no-wait -no-gui -no-html -no-nroff -no-examples -pkg-path "${curdir}/packages/lib/tcllib-1.10" -no-apps]
00065     cd ..
00066 }
00067 
00068 /*  Check presence of package xml*/
00069  error =  [catch {package require xml 3.2}]
00070 if {$error} {
00071     puts "
00072 /* */
00073 /*                                        #*/
00074 /*          Build package XML             #*/
00075 /*                                        #*/
00076 /* */
00077 "
00078 
00079     puts "
00080 Building sub-package TclXML"
00081     cd tclxml-3.2
00082     build TclXML
00083 
00084     cd ..
00085 }
00086 
00087     puts "
00088 ===================================
00089     Installation done
00090 ==================================="
00091 

Generated on 21 Sep 2010 for Gui by  doxygen 1.6.1