File: mkIndex.tcl

package info (click to toggle)
tclcurl 0.9.5-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 764 kB
  • ctags: 222
  • sloc: ansic: 1,804; tcl: 712; sh: 212; makefile: 42
file content (118 lines) | stat: -rw-r--r-- 2,797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# mkIndex.tcl --
#
#	This script generates a pkgIndex.tcl file for an installed extension.
#
# Copyright (c) 1999 Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
# Notes:
#
# If you redefine $(libdir) using the configure switch --libdir=, then
# this script will probably fail for you.
#
# UNIX:
#      exec_prefix
#           |
#           |
#           |
#          lib
#          / \
#         /   \
#        /     \
#   PACKAGE   (.so files)
#       |
#       |
#       |
#  pkgIndex.tcl
#
# WIN:
#      exec_prefix
#          / \
#         /   \
#        /     \
#      bin     lib
#       |        \
#       |         \
#       |          \
# (.dll files)   PACKAGE
#                    |
#                    |
#                    |
#                pkgIndex.tcl
       
# The pkg_mkIndex routines from Tcl 8.2 and later support stub-enabled
# extensions.  Notify the user if this is not a valid tcl shell.
# Exit with a status of 0 so that the make-install process does not stop.

if {[catch {package require Tcl 8.2} msg]} {
    puts stderr "**WARNING**"
    puts stderr $msg
    puts stderr "Could not build pkgIndex.tcl file.  You must create one by hand"
    exit 0
}

source ./package.tcl

# The name of the library(s) should be passed in as arguments.

set libraryList $argv

# Nativepath --
#
#	Convert a Cygnus style path to a native path
#
# Arguments:
#	pathName	Path to convert
#
# Results:
#	The result is the native name of the input pathName.
#	On Windows, this is z:/foo/bar, on Unix the input pathName is
#	returned.

proc Nativepath {pathName} {
    global tcl_platform

    if {![string match $tcl_platform(platform) unix]} {
	if {[regexp {//(.)/(.*)} $pathName null driveLetter pathRemains]} {
	    set pathName $driveLetter:/$pathRemains
	} else {
          set pathName [exec cygpath -w $pathName]
	}
    }
    return $pathName
}

set prefix "/usr"
set exec_prefix "/usr"

set exec_prefix [Nativepath $exec_prefix] 

set libdir ${exec_prefix}/lib
set package tclcurl
set version 0.95

cd $libdir
puts "Making pkgIndex.tcl in [file join [pwd] $package]"

if {$tcl_platform(platform) == "unix"} {
    if {[llength $libraryList] > 0} {
	set libraryPathList {}
	foreach lib $libraryList {
	    lappend libraryPathList [file join .. $lib]
	}
	puts "eval pkg_mkIndex $package$version $libraryPathList *.tcl"
	eval pkg_mkIndex $package$version $libraryPathList *.tcl
    }
} else {
    if {[llength $libraryList] > 0} {
	set libraryPathList {}
	foreach lib $libraryList {
	    lappend libraryPathList [file join .. .. bin $lib]
	}
	puts "eval pkg_mkIndex $package$version $libraryPathList *.tcl"
	eval pkg_mkIndex $package$version $libraryPathList *.tcl
    }
}