source: trunk/dports/_resources/port1.0/group/select-1.0.tcl @ 100379

Last change on this file since 100379 was 100379, checked in by raimue@…, 7 years ago

group/select-1.0:
Allow installation of select files with a different name

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1# et:ts=4
2# select-1.0.tcl
3#
4# $Id: select-1.0.tcl 100379 2012-12-10 09:29:24Z raimue@macports.org $
5#
6# Copyright (c) 2009 The MacPorts Project
7# Copyright (c) 2009 Rainer Mueller <raimue@macports.org>
8# All rights reserved.
9#
10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions are
12# met:
13#
14# 1. Redistributions of source code must retain the above copyright
15#    notice, this list of conditions and the following disclaimer.
16# 2. Redistributions in binary form must reproduce the above copyright
17#    notice, this list of conditions and the following disclaimer in the
18#    documentation and/or other materials provided with the distribution.
19# 3. Neither the name of Apple Computer, Inc. nor the names of its
20#    contributors may be used to endorse or promote products derived from
21#    this software without specific prior written permission.
22#
23# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34#
35
36options select.group select.file
37
38default select.group ""
39default select.file ""
40
41namespace eval select {}
42
43proc select::install {group file {name ""}} {
44    global prefix destroot frameworks_dir applications_dir developer_dir
45
46    # Optional argument specifies file name
47    if {${name} == ""} {
48        set name [file tail ${file}]
49    }
50
51    xinstall -m 755 -d ${destroot}${prefix}/etc/select/${group}
52    xinstall -m 644 ${file} ${destroot}${prefix}/etc/select/${group}/${name}
53
54    reinplace s|\${prefix}|${prefix}|g ${destroot}${prefix}/etc/select/${group}/${name}
55    reinplace s|\${frameworks_dir}|${frameworks_dir}|g ${destroot}${prefix}/etc/select/${group}/${name}
56    reinplace s|\${applications_dir}|${applications_dir}|g ${destroot}${prefix}/etc/select/${group}/${name}
57    reinplace s|\${developer_dir}|${developer_dir}|g ${destroot}${prefix}/etc/select/${group}/${name}
58}
59
60post-destroot {
61    if {${select.file} != "" && ${select.group} != ""} {
62        select::install ${select.group} ${select.file}
63    } else {
64        ui_debug "PortGroup select: select.group or select.file not set"
65    }
66}
Note: See TracBrowser for help on using the repository browser.