source: trunk/base/src/port1.0/portmain.tcl @ 3954

Last change on this file since 3954 was 3954, checked in by fkr, 17 years ago

Bug:
Submitted by: wbb4@
Reviewed by:
Approved by:
Obtained from:

enabled uninstall to work properly when version in dports-tree is not equal
installed version.
also add's installed check, so a port is not accidently installed over an existing
version.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 3.8 KB
RevLine 
[1503]1# et:ts=4
[357]2# portmain.tcl
[214]3#
[1638]4# Copyright (c) 2002 - 2003 Apple Computer, Inc.
[357]5# All rights reserved.
[214]6#
[357]7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
16#    may be used to endorse or promote products derived from this software
17#    without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30#
[214]31
32# the 'main' target is provided by this package
33# main is a magic target and should not be replaced
34
35package provide portmain 1.0
36package require portutil 1.0
37
[1015]38set com.apple.main [target_new com.apple.main main]
[2118]39target_provides ${com.apple.main} main
[214]40
[219]41# define options
[2568]42options prefix name version revision epoch categories maintainers
[1697]43options long_description description homepage
44options workdir worksrcdir filedir distname portdbpath libpath distpath sources_conf os.platform os.version os.arch os.endian platforms default_variants
[1033]45
[577]46# Export options via PortInfo
[2568]47options_export name version revision epoch categories maintainers platforms description long_description homepage
[866]48
[1033]49# Assign option procedure to default_variants
50option_proc default_variants handle_default_variants
51
[1514]52# Hard coded version number for resource location
[1515]53default portresourcepath {[file join $portsharepath resources/port1.0]}
[672]54default distpath {[file join $portdbpath distfiles]}
[366]55default workdir work
[472]56default workpath {[file join $portpath $workdir]}
[408]57default prefix /opt/local
[1790]58default x11prefix /usr/X11R6
[1514]59default destdir destroot
60default destpath {${workpath}/${destdir}}
[1697]61# destroot is provided as a clearer name for the "destpath" variable
62default destroot {${destpath}}
[214]63default filedir files
[962]64default revision 0
[2568]65default epoch 0
[472]66default distname {${portname}-${portversion}}
[610]67default worksrcdir {$distname}
[748]68default filesdir {files}
69default filespath {[file join $portpath $filesdir]}
70default worksrcpath {[file join $workpath $worksrcdir]}
[214]71
[961]72# Compatibility namespace
73default portname {$name}
74default portversion {$version}
75default portrevision {$revision}
[2568]76default portepoch {$epoch}
[957]77
78# Platform Settings
79set os_arch $tcl_platform(machine)
80if {$os_arch == "Power Macintosh"} { set os_arch "powerpc" }
81
82default os.platform {[string tolower $tcl_platform(os)]}
83default os.version {$tcl_platform(osVersion)}
84default os.arch {$os_arch}
[1500]85# Remove trailing "Endian"
86default os.endian {[string range $tcl_platform(byteOrder) 0 [expr [string length $tcl_platform(byteOrder)] - 7]]}
[957]87
[866]88# Select implicit variants
[957]89if {[info exists os.platform] && ![info exists variations(${os.platform})]} { variant_set ${os.platform}}
90if {[info exists os.arch] && ![info exists variations(${os.arch})]} { variant_set ${os.arch} }
[866]91
[295]92proc main {args} {
[214]93    return 0
94}
Note: See TracBrowser for help on using the repository browser.