Ticket #34659: Portfile

File Portfile, 1.5 KB (added by lockhart (Thomas Lockhart), 12 years ago)

Full portfile to upgrade version, fix broken port, and use subports for various python versions.

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 80379 2011-07-11 03:46:07Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup python 1.0
6
7name                py-geoip
8version             1.2.7
9categories          python net
10platforms           darwin
11maintainers         freebsd.org:miwi
12description         Python module for accessing the GeoIP C library
13long_description    ${description}
14
15homepage            http://www.maxmind.com/app/python
16master_sites        http://www.maxmind.com/download/geoip/api/python/
17distname            GeoIP-Python-${version}
18
19checksums           sha1    0af5f5d06bc81b5427019d28ba029e8c31dec9eb \
20                    rmd160  4abb50a70ce15e8305e786593ddd2de15efed129
21
22python.versions     24 25 26 27
23python.default_version 24
24
25if {${name} != ${subport}} {
26    depends_lib-append port:libgeoip
27
28    post-patch {
29        reinplace "s|/usr/local|${prefix}|g" \
30            ${worksrcpath}/setup.py
31    }
32
33    post-destroot {
34        xinstall -m 644 -W ${worksrcpath} ChangeLog LICENSE README \
35            ${destroot}${prefix}/share/doc/${subport}
36        xinstall -m 644 -W ${worksrcpath} test.py test_city.py test_org.py \
37            ${destroot}${prefix}/share/doc/${subport}/examples
38    }
39    livecheck.type      none
40} else {
41    livecheck.type      regex
42    livecheck.url       ${master_sites}
43    livecheck.regex     "GeoIP-Python-(\\d+(\\.\\d+)+)${extract.suffix}"
44}