# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 119103 2014-04-17 10:38:10Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-celery
version             3.1.11
revision            0
categories-append   devel
platforms           darwin
license             BSD
supported_archs     noarch

python.versions     26 27 32 33

maintainers         stromnov openmaintainer

description         Distributed Task Queue

long_description    Celery is an asynchronous task queue/job queue based \
                    on distributed message passing

homepage            http://celeryproject.org/
master_sites        http://pypi.python.org/packages/source/c/celery/

distname            celery-${version}

checksums           rmd160  e778c924c6ce2c3c43cee399636cc5636a5c83a2 \
                    sha256  7614e789a997a540bab589ca763f1006c6881e64479e8a03f72b225c25ff5250

# celery 3.1+ requires Python 2.7 or 3.3
if {${name} ne ${subport} && [lsearch {26 32} ${python.version}] != -1} {
    version             3.0.24
    revision            0
    checksums           rmd160  b77c412d25258e01e98ef3e5d3d0e106dcff079a \
                        sha256  68620192ec0b2212e64c307b5588c6c02f6a56e21160f3f3323653f7e44aafdf
    distname            celery-${version}
}

if {${name} ne ${subport}} {
    # celery depends on pkg_resources from setuptools
    depends_lib-append  port:py${python.version}-setuptools \
                        port:py${python.version}-kombu \
                        port:py${python.version}-anyjson \
                        port:py${python.version}-tz \
                        port:py${python.version}-billiard \
                        port:py${python.version}-amqp

    depends_run-append  port:celery_select

    select.group        celery
    select.file         ${filespath}/py${python.version}-celery

    notes "
To make the Python ${python.branch} version of py-celery the one that is run\
when you execute the commands without a version suffix, e.g. 'celeryd' or\
'celeryctl', run:

port select --set ${select.group} [file tail ${select.file}]
"

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${master_sites}
    livecheck.regex     {celery-(\d+(?:\.\d+)*)\.[tz]}
}
