# -*- 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 79016 2011-05-30 13:46:39Z devans@macports.org $

PortSystem      1.0
PortGroup       python26 1.0

name            deluge
version         1.3.2
categories      net gnome python
license         GPL-3 OpenSSL SSLeay
maintainers     devans openmaintainer
description     A GNOME BitTorrent client.
long_description \
                Deluge is a GNOME client for the BitTorrent network written in python.
homepage        http://www.deluge-torrent.org
platforms       darwin

master_sites    http://download.deluge-torrent.org/source/

dist_subdir     python/${name}/${version}_${revision}

use_bzip2       yes

checksums       md5     f9e46e054c92e4fdd190eb17827a0bca \
                sha1    56e356942b5d60a65d1009e4bfd78d2452b7c445 \
                rmd160  8365925af3ed8cd20a4b24d03f6e832933edd6ac

depends_lib-append \
                port:libtorrent-rasterbar \
                port:boost \
                port:dbus-python26 \
                port:librsvg \
                port:py26-chardet \
                port:py26-game \
                port:py26-gtk \
                port:py26-notify-python \
                port:py26-distribute \
                port:py26-xdg \
                port:py26-twisted \
                port:py26-twisted-web2 \
                port:py26-openssl \
                port:py26-mako

if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} {
    depends_lib-delete port:boost
    pre-configure {
        ui_error "
****
**** ${name} requires port boost installed with variant +python26.
**** Please do the following then try installing ${name} again:
****
****     sudo port install boost +python26
****

"
        return -code error "incompatible boost installation"
    }
}

build.env       PYTHON_CFLAGS="-I${prefix}/include -I${prefix}/include/boost" \
                PYTHON_LDFLAGS=-L${prefix}/lib \
                CFLAGS="-I${prefix}/include -I${prefix}/include/boost" \
                CC=${configure.cc} CXX=${configure.cxx} CPP=${configure.cpp}

livecheck.type  regex
livecheck.url   http://download.deluge-torrent.org/source/
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
