# -*- 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

PortSystem          1.0
PortGroup           python 1.0

name                py-pygresql
python.rootname     PyGreSQL
version             6.0
revision            0

categories-append   databases
license             Permissive
maintainers         nomaintainer

description         Python module that interfaces to a PostgreSQL database
long_description    PyGreSQL is an open-source Python module that \
                    interfaces to a PostgreSQL database. It embeds the \
                    PostgreSQL query library to allow easy use of the \
                    powerful PostgreSQL features from a Python script.

homepage            https://www.pygresql.org/

checksums           rmd160  6d7f4d332fabfdced3edd53c5f75b874b7bcd3b7 \
                    sha256  19b0c1e95d00aadd423f44a0be8efcd9938c1ec83a338da456bfbd4416815409 \
                    size    271585

python.versions     312

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

    post-patch {
        reinplace "s|\'pg_config|\'${prefix}/lib/postgresql16/bin/pg_config|g" \
            ${worksrcpath}/setup.py
    }

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        file copy ${worksrcpath}/docs ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} LICENSE.txt README.rst ${destroot}${docdir}
    }
}
