source: trunk/dports/_resources/port1.0/group/github-1.0.tcl @ 89040

Last change on this file since 89040 was 89040, checked in by ryandesign@…, 8 years ago

github-1.0.tcl: fix default git.branch value when github.tag_prefix is empty

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1# $Id: github-1.0.tcl 89040 2012-01-18 13:32:38Z ryandesign@macports.org $
2#
3# Copyright (c) 2012 The MacPorts Project
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met:
9#
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 The MacPorts Project nor the names of its
16#    contributors may be used to endorse or promote products derived from
17#    this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30#
31#
32# This PortGroup sets up default behaviors for projects hosted at github.
33#
34# Usage:
35#
36#   PortGroup               github 1.0
37#   github.setup            author project version [tag_prefix]
38
39options github.author github.project github.version github.tag_prefix github.homepage github.master_sites
40
41default github.homepage {https://github.com/${github.author}/${github.project}}
42default github.master_sites {${github.homepage}/tarball/[join ${github.tag_prefix} ""]${github.version}}
43
44proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""}} {
45    global github.author github.project github.version github.tag_prefix github.homepage github.master_sites
46   
47    github.author           ${gh_author}
48    github.project          ${gh_project}
49    github.version          ${gh_version}
50    github.tag_prefix       ${gh_tag_prefix}
51   
52    name                    ${github.project}
53    version                 ${github.version}
54    homepage                ${github.homepage}
55    git.url                 ${github.homepage}.git
56    git.branch              [join ${github.tag_prefix}]${github.version}
57    master_sites            ${github.master_sites}
58    distname                ${github.project}-${github.version}
59   
60    post-extract {
61        if {"standard" == ${fetch.type} && ${master_sites} == ${github.master_sites} && [llength ${distfiles}] > 0} {
62            move [glob ${workpath}/*] ${worksrcpath}
63        }
64    }
65   
66    livecheck.type          regex
67    livecheck.url           ${github.homepage}/tags
68    livecheck.regex         tarball/[join ${github.tag_prefix} ""](\[^"\]+)
69}
Note: See TracBrowser for help on using the repository browser.