source: trunk/tcl/install.tcl @ 95

Last change on this file since 95 was 95, checked in by mmc, 17 years ago
  • Fixed an annoying bug in the scroller that would cause the device to jitter up and down in some cases. (1-barrier case of app-rtd)
  • Fixed cloud/mesh objects to allow different units for each of the various axes.
  • Fixed the install.tcl script to avoid popping up the notice about Rappture being installed when tclsh is running the script.
File size: 2.7 KB
Line 
1# ----------------------------------------------------------------------
2#  USAGE: tclsh install.tcl
3#
4#  Use this script to install the Rappture toolkit into an existing
5#  Tcl installation.
6# ======================================================================
7#  AUTHOR:  Michael McLennan, Purdue University
8#  Copyright (c) 2004  Purdue Research Foundation, West Lafayette, IN
9# ======================================================================
10
11# run this script from directory containing it
12cd [file dirname [info script]]
13
14set package "Rappture"
15set version "0.9"
16
17proc find {dir} {
18    set flist ""
19    foreach name [glob [file join $dir *]] {
20        lappend flist $name
21        if {[file isdirectory $name]} {
22            eval lappend flist [find $name]
23        }
24    }
25    return $flist
26}
27
28proc mkindex {dir} {
29    package require Itcl  ;# index Itcl files too!
30    auto_mkindex $dir *.tcl
31}
32
33proc fixperms {target perms} {
34    global tcl_platform
35    if {$tcl_platform(platform) == "unix"} {
36        file attributes $target -permissions $perms
37    }
38}
39
40
41set dir [file dirname [info library]]
42set targetdir [file join $dir $package$version]
43
44if {![file exists $targetdir]} {
45    puts "making directory $targetdir..."
46    file mkdir $targetdir
47}
48
49set origdir [pwd]
50foreach context {. ../gui} {
51    cd $context
52
53    foreach file [find .] {
54        set target [file join $targetdir $file]
55        if {[file isdirectory $file]} {
56            puts "making directory $target..."
57            catch {file mkdir $target}
58            fixperms $target ugo+rx
59        } else {
60            puts "installing $target..."
61            file copy -force $file $target
62            fixperms $target ugo+r
63        }
64    }
65}
66
67cd ..
68catch {file mkdir [file join $targetdir lib]}
69foreach file [find ./lib] {
70    set target [file join $targetdir $file]
71    if {[file isdirectory $file]} {
72        puts "making directory $target..."
73        catch {file mkdir $target}
74        fixperms $target ugo+rx
75    } else {
76        puts "installing $target..."
77        file copy -force $file $target
78        fixperms $target ugo+r
79    }
80}
81
82cd $origdir
83
84set fid [open [file join $targetdir pkgIndex.tcl] w]
85puts $fid "# Tcl package index file"
86puts $fid "package ifneeded $package $version \""
87puts $fid "  \[list lappend auto_path \[file join \$dir scripts\]\]"
88puts $fid "  namespace eval \[list Rappture \[list variable installdir \$dir\]\]"
89puts $fid "  package provide $package $version"
90puts $fid "\""
91close $fid
92
93mkindex [file join $targetdir scripts]
94
95if {[string match wish* [file tail [info nameofexecutable]]]} {
96    package require Tk
97    wm withdraw .
98    tk_messageBox -icon info -message "$package-$version INSTALLED"
99} else {
100    puts "== $package-$version INSTALLED"
101}
102exit 0
Note: See TracBrowser for help on using the repository browser.