# -*- 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 114324 2013-12-05 08:44:51Z ryandesign@macports.org $

PortSystem		1.0
PortGroup		python 1.0

name			py-urlwatch
version	        1.15
license         BSD
python.versions         26 27 31
python.default_version  26
platforms		darwin
supported_archs noarch
maintainers		phw openmaintainer
description		a tool for monitoring webpages for updates
long_description	urlwatch helps you watch URLs and get notified (via email or \
in your terminal) of any changes. The change notification will include the URL \
that has changed and a unified diff of what has changed, and can also filter \
content via hooks, remove noise (always-changing website parts), etc.
homepage		http://thpinfo.com/2008/urlwatch/
master_sites	${homepage}
distname          urlwatch-${version}

checksums           md5     a0a739d4ea18f15c121e5f12bb75cbc9 \
                    sha1    3353c3222b5057742e2b6678200c7bdef2245278 \
                    rmd160  3f5e73b551b3d4aa1974ec8ff30d391b06f58e32

livecheck.type  regex
livecheck.url   ${homepage}
livecheck.regex "Current version: (\\d+(?:\\.\\d+)*)"

if {${name} ne ${subport}} {
    depends_build-append  port:py${python.version}-setuptools
    depends_lib-append    port:py${python.version}-futures

    pre-configure {
        if {${python.version}==32 || ${python.version}==31} {
            system "cd ${worksrcpath} && ${worksrcpath}/convert-to-python3.sh"
        }
    }
}
