#!/bin/vtcl # If you improve something in this script, please send a letter # on one of these addresses: opole@pios.gov.pl or kkhrebeniuk@qnx.com # set OK "" while {($OK != "y") && ($OK != "Y")} { puts -nonewline "Where to install SO4: " gets stdin to puts -nonewline "Is it correct: $to ? (y|n): " gets stdin OK } puts "Installing to $to. Wait for Installation Done info" set to [string trimright $to "/"] set darr(PD_PROGDIR) $to set darr(PREDEFINED_PROGDIR) $to set currdir [pwd] set realname "" if {[file exists $currdir/setup.ins]} { if {[file exists $currdir/setup.txt]} { catch {exec mv $currdir/setup.txt $currdir/setup.txt.bak} } puts -nonewline "Transforming setup.ins to unix format ... " exec /usr/bin/dtox setup.ins > setup.txt puts "done." set file [open "$currdir/setup.txt" r] } else { puts "Installation instructions file: setup.ins is missing." exit } sleep 2 while {[gets $file line] >=0} { if [regexp "^Directory DIR*" $line] { set DIRNR [lindex $line 1] set line2 "" while {![cequal $line2 End]} { gets $file line2 set line2 [string trimleft $line2 " \t"] set line2 [string trimright $line2 ";"] set ditems [split $line2 "="] set ditem1 [lindex $ditems 0] set ditem1 [string trim $ditem1] set ditem2 [lindex $ditems 1] set ditem2 [string trim [string trim $ditem2] "\""] if {[cequal $ditem2 "Work folder"]} { set ditem2 WorkFolder } if {[cequal $ditem1 DosName]} { set darr($DIRNR) $ditem2 } if {[cequal $ditem1 ParentID]} { set darr($DIRNR) $darr($ditem2)/$darr($DIRNR) set KAT $darr($DIRNR) } } ;# End of second while (directories section) if {![file isdirectory $KAT]} { puts "Making directory: $KAT" mkdir -path $KAT } } ;# End of first if if [regexp "^File FILE_*" $line] { set line2 "" while {![cequal $line2 End]} { gets $file line2 set line2 [string trimleft $line2 " \t"] set line2 [string trimright $line2 ";"] set fitems [split $line2 "="] set fitem1 [lindex $fitems 0] set fitem1 [string trim $fitem1] set fitem2 [lindex $fitems 1] set fitem2 [string trim [string trim $fitem2] "\""] if {[cequal $fitem1 PackedName]} { set f_file $fitem2 } if {[cequal $fitem1 Name]} { set realname $fitem2 } if {[cequal $fitem1 ArchiveFiles]} { set realname "" } if {[cequal $fitem1 Dir]} { set DIR $darr($fitem2) } if {[cequal $fitem1 UnixRights]} { set urights $fitem2 } } ;# End of third while (files) if {![file exists $f_file]} { puts "File $f_file doesn't exist in current directory. Can't continue" exit } if {![cequal $realname ""]} { puts "Extracting file: $f_file ($realname) to $DIR" set name [exec unzip -nd $DIR $f_file] set wy [string trim [lindex [split $name \n] 1]] set wy [lindex [split $wy " "] 1] catch {exec mv $wy $DIR/$realname} if {![cequal $urights 0]} { catch {chmod 0$urights $DIR/$realname} } } else { puts "Extracting file: $f_file (subarchive) to $DIR" set name [exec unzip -nd $DIR $f_file] set name [split $name \n] set n [llength $name] for {set i 1} {$i < $n} {incr i} { set files($i) [string trim [lindex [lindex $name $i] 1]] puts $files($i) if {![cequal $urights 0]} { catch {chmod 0$urights $files($i)} } } } } ;# End of second if } close $file puts "All programm files are extracted. Wait for final tailoring." foreach res {svt36401.res vcl36401 set36401} { if {[file exists $currdir/$res]} { exec cp $res $to/bin } else { puts "Important resource file: $res is missing. You have to obtain it from somewhere and copy to $to/bin directory." } } if {[file exists libc.so.5.4.44]} { exec cp libc.so.5.4.44 $to/lib cd $to/lib link -sym libc.so.5.4.44 libc.so link -sym libc.so.5.4.44 libc.so.5 } else { puts "\nLibrary file libc.so.5.4.44 is missing. It should be copied to $to/lib directory and symlinked to libc.so and libc.so.5 in this directory." } cd $currdir if {[file exists libm.so.5.0.9]} { exec cp libm.so.5.0.9 $to/lib cd $to/lib link -sym libm.so.5.0.9 libm.so link -sym libm.so.5.0.9 libm.so.5 } else { puts "\nLibrary file libm.so.5.0.9 is missing. It should be copied to $to/lib directory and symlinked to libm.so and libm.so.5 in this directory." } puts "\nInstallation Done" puts "Insert lxrun after word exec in last line of $to/bin/soffice file." puts "And don't forget to set LINUX_ROOT environment variable."