# -*- 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 106290 2013-05-21 18:56:58Z 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

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.8
    use_xz          yes
    checksums       md5 b5b2b42e6f855fcd6f38942422a710bd \
                    rmd160 39f51b4fc14f90da1560ec8ddf9d0d66c8724b5f \
                    sha256 39c5fd7c66d57a09e739605e64a4bba7552e1a094dd4ce062a207095011b80ac
    livecheck.regex	Python (2.6.\[0-9\]+)
}
subport py27-gdbm {
    maintainers     jwa openmaintainer
    version         2.7.5
    use_xz			yes
    checksums		md5 5eea8462f69ab1369d32f9c4cd6272ab \
                    rmd160 baa7ad7d82cb4dc0a70b6a7aded43b7b78b0067e \
                    sha256 f33c4cab167dc69e10962e1cebf1c0768e2d0e8575648130c20e6bda84551db1
    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.2
    epoch           20130516
    use_xz			yes
    checksums       rmd160  59af4ddcc99757da5044e395093cf45e1ec7333c \
                    sha256  745b32c4b810e36fa66346198dbc2e313524fd68888922b85005656825e64b43
    set setup_py "setup-py3k.py"
    set cfile "_gdbmmodule.c"
    livecheck.regex	Python (3.3.\[0-9\]+)
}

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

if {$subport != $name} {
    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/
