# -*- 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 120267 2014-05-21 08:38:08Z jwa@macports.org $

PortSystem 1.0
PortGroup python 1.0

name			py-gdbm
version			2.4.6
categories-append	databases
license			PSF
platforms		darwin
maintainers		nomaintainer
description		Python bindings to the GNU dbm library
long_description	${description}

homepage		http://docs.python.org/library/gdbm.html

python.versions 24 25 26 27 31 32 33 34

set setup_py "setup.py"
set cfile "gdbmmodule.c"
subport py24-gdbm {
    maintainers     fourdigits.nl:roel openmaintainer
    use_bzip2		yes
    checksums		sha1 cb1972a554a458f6a26d3e047b359251865d7c96 \
                    rmd160 0687989193dec2ac108142759281be7ddcf7f31e
    livecheck.regex	Python (2.4.\[0-9\]+)
}
subport py25-gdbm {
    maintainers     nomaintainer
    version         2.5.6
    use_bzip2		yes
    checksums		sha1 29f6dd41bf09c5e04311b367cbb7604fa016e699 \
                    rmd160 92f0a955971f187a7d50c6422168202ec551bf22
    livecheck.regex	Python (2.5.\[0-9\]+)
}
subport py26-gdbm {
    maintainers     mcalhoun openmaintainer
    version         2.6.9
    use_xz          yes
    checksums       md5 933a811f11e3db3d73ae492f6c3a7a76 \
                    rmd160 42edf7c9f2f64b77ab173de30ea453257c2c06b3 \
                    sha256 cae7bb995006ea5b703d9d28446f694894c441fe4bfb95d561c0ac908cd06e41
    livecheck.regex	Python (2.6.\[0-9\]+)
}
subport py27-gdbm {
    maintainers     jwa openmaintainer
    version         2.7.6
    use_xz			yes
    checksums       rmd160  8efc73a01a466d8fa16c5c1734c89be79c2c538a \
                    sha256  1fd68e81f8bf7386ff239b7faee9ba387129d2cf34eab13350bd8503a0bff6a1
    livecheck.regex	Python (2.7.\[0-9\]+)
}
subport py31-gdbm {
    maintainers     erickt openmaintainer
    version         3.1.5
    use_xz		    yes
    checksums		md5 20dd2b7f801dc97db948dd168df4dd52 \
                    rmd160 021362658310f9ea5f6825bf0919f160304f4833 \
                    sha256 035c4370354d901924ce0fd8df65c5452839f590ec1b9c17fae2ada3e5f3b4d7
    set setup_py "setup-py3k.py"
    set cfile "_gdbmmodule.c"
    livecheck.regex	Python (3.1.\[0-9\]+)
}
subport py32-gdbm {
    maintainers     nomaintainer
    version         3.2.5
    use_xz			yes
    checksums		md5 03c5843638c576d29b3321947facd22d \
                    rmd160 ee9a13e6744406c6b99078da38a6cbf290f64256 \
                    sha256 8ccb9645b9779fc4550055b2ebb21a724ab7a63dee45643286eb4f79b2f84116
    set setup_py "setup-py3k.py"
    set cfile "_gdbmmodule.c"
    livecheck.regex	Python (3.2.\[0-9\]+)
}
subport py33-gdbm {
    maintainers     jwa openmaintainer
    version         3.3.5
    epoch           20140309
    use_xz			yes
    checksums       rmd160  77398ecd76824983ad92c859f633e26675bacb4b \
                    sha256  abe99b484434503d8b23be0f243ec27139e743a4798cd71c1dce3cf40e63b6e5
    set setup_py "setup-py3k.py"
    set cfile "_gdbmmodule.c"
    livecheck.regex	Python (3.3.\[0-9\]+)
}
subport py34-gdbm {
    maintainers     jwa openmaintainer
    version         3.4.1
    epoch           20140519
    use_xz			yes
    checksums       rmd160  276fda8bd4ef515da83645ddd5f01eb0f68522a5 \
                    sha256  c595a163104399041fcbe1c5c04db4c1da94f917b82ce89e8944c8edff7aedc4
    set setup_py "setup-py3k.py"
    set cfile "_gdbmmodule.c"
    livecheck.regex	Python (3.4.\[0-9\]+)
}

distname		Python-${version}
master_sites	http://www.python.org/ftp/python/${version}/

if {${name} ne ${subport}} {
    depends_lib-append	port:gdbm

    dist_subdir		python${python.version}

    worksrcdir	${worksrcdir}/Modules

    extract.post_args	"| tar -xf - ${distname}/Modules/${cfile}"
    post-extract {
        file copy	${filespath}/${setup_py} ${worksrcpath}/setup.py
    }

    patch {
        reinplace "s|__VERSION__|${version}|g" ${worksrcpath}/setup.py
        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
    }
}

livecheck.type	regex
livecheck.url	http://www.python.org/download/releases/
