# $Id: Portfile 67783 2010-05-18 11:17:19Z jmr@macports.org $

PortSystem 1.0
PortGroup select 1.0

name                    python_select
version                 0.3
categories              sysutils
platforms               darwin
license                 BSD
maintainers             raimue
description             Switch the default python interpreter
long_description        python_select lets you switch the default python interpreter. \
                        python_select symlinks the standard python executables \
                        in the MacPorts prefix to the selected version.

homepage                http://svn.macports.org/repository/macports/contrib/select/
master_sites            ${homepage}
distname                select-${version}
checksums               md5     b24cecd12fc5567e544b25c5df34a255 \
                        sha1    4aa312d7e0b9ede1ef015fcd941ff53a0329127a \
                        rmd160  f121d366cdecc7d5331040abfd153334399d80d5

if {[info exists supported_archs]} {
    supported_archs noarch
} else {
    universal_variant no
}

configure.args          --mandir=${prefix}/share/man --name=python

# install all files
post-destroot {
    select::install python ${filespath}/base
    select::install python ${filespath}/none
}

platform darwin 8 {
    post-destroot {
        select::install python ${filespath}/python23-apple
    }

    post-activate {
        if {[exec ${prefix}/bin/${name} -s] == "none"} {
            system "${destroot}${prefix}/bin/${name} python23-apple"
        }
    }
}

platform darwin 9 {
    post-destroot {
        select::install python ${filespath}/python25-apple
    }

    post-activate {
        if {[exec ${prefix}/bin/${name} -s] == "none"} {
            system "${prefix}/bin/${name} python25-apple"
        }
    }
}

platform darwin 10 {
    post-destroot {
        select::install python ${filespath}/python26-apple
    }

    post-activate {
        if {[exec ${prefix}/bin/${name} -s] == "none"} {
            system "${prefix}/bin/${name} python26-apple"
        }
    }
}

livecheck.type     none

# Documentation for python ports:
#   PortGroup select 1.0
#   select.group            python
#   select.file             ${filespath}/python[string map {. {}} ${branch}]
