Ticket #32453: Portfile

File Portfile, 2.9 KB (added by shirshegsm@…, 12 years ago)
Line 
1# -*- 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
2# $Id: Portfile 87112 2011-11-10 20:53:51Z snc@macports.org $
3
4PortSystem 1.0
5PortGroup python 1.0
6
7name                    py-psycopg2
8version                 2.4.2
9python.versions 24 25 26 27
10python.default_version  27
11categories              python databases
12maintainers             snc openmaintainer
13license             LGPL-3+
14platforms               darwin freebsd
15description             A python DBAPI-2.0-compliant database adapter for postgresql
16long_description        Psycopg2 is a postgresql database adapter for python. \
17                        It's fully compliant to python's DBAPI-2.0. psycopg is \
18                        designed for heavily multi-threaded applications \
19                        featuring connection pooling.
20
21homepage                http://www.initd.org/software/initd/psycopg/
22
23set branch          [join [lrange [split ${version} .] 0 1] -]
24master_sites            http://www.psycopg.org/psycopg/tarballs/PSYCOPG-${branch}/
25distname                psycopg2-${version}
26
27checksums           rmd160  ec0fe7573260773b5e701f00ea365a1b7d4cc329 \
28                    sha256  16c2ad8b19039888354944c75f25da40c22f91a79d230ed2aedeabf9d3b585b9
29
30if {$subport != $name} {
31    depends_lib-append  port:openssl
32
33    patchfiles          patch-setup.cfg.diff
34
35    post-patch {
36
37        if {[variant_isset postgresql83]} {
38            reinplace \
39                s|@PG_CONFIG@|${prefix}/lib/postgresql83/bin/pg_config|g \
40                ${worksrcpath}/setup.cfg
41        }
42
43        if {[variant_isset postgresql84]} {
44            reinplace \
45                s|@PG_CONFIG@|${prefix}/lib/postgresql84/bin/pg_config|g \
46                ${worksrcpath}/setup.cfg
47        }
48
49        if {[variant_isset postgresql90]} {
50            reinplace \
51                s|@PG_CONFIG@|${prefix}/lib/postgresql90/bin/pg_config|g \
52                ${worksrcpath}/setup.cfg
53        }
54
55        if {[variant_isset postgresql91]} {
56            reinplace \
57                s|@PG_CONFIG@|${prefix}/lib/postgresql91/bin/pg_config|g \
58                ${worksrcpath}/setup.cfg
59        }
60    }
61
62    livecheck.type      none
63} else {
64    livecheck.url       ${master_sites}
65    livecheck.regex     psycopg2-(\\d+(\\.\\d+)+)${extract.suffix}
66}
67
68
69if {![variant_isset postgresql83] && ![variant_isset postgresql84] && ![variant_isset postgresql90] && ![variant_isset postgresql91]} {
70    default_variants    +postgresql91
71}
72
73variant postgresql83 conflicts postgresql84 postgresql90 postgresql91 description "Build using postgresql v8.3" {
74    depends_lib-append port:postgresql83
75}
76
77variant postgresql84 conflicts postgresql83 postgresql90 postgresql91 description "Build using postgresql v8.4" {
78    depends_lib-append port:postgresql84
79}
80
81variant postgresql90 conflicts postgresql83 postgresql84 postgresql91 description "Build using postgresql v9.0" {
82    depends_lib-append port:postgresql90
83}
84
85variant postgresql91 conflicts postgresql83 postgresql84 postgresql90 description "Build using postgresql v9.1" {
86    depends_lib-append port:postgresql91
87}