Ticket #43095: dateutil-Portfile

File dateutil-Portfile, 2.0 KB (added by wichert@…, 10 years ago)

Updated Portfile

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 117990 2014-03-18 15:07:09Z mmoll@macports.org $
3
4PortSystem        1.0
5PortGroup         python 1.0
6
7name              py-dateutil
8set my_name       python-dateutil
9version           2.2
10platforms         darwin
11supported_archs   noarch
12maintainers       dh ram openmaintainer
13license           BSD
14
15description       powerful extensions to the standard python datetime module
16long_description  ${description}
17
18homepage          http://labix.org/python-dateutil
19master_sites      https://pypi.python.org/packages/source/p/python-dateutil
20distname          ${my_name}-${version}
21
22checksums         md5 c1f654d0ff7e33999380a8ba9783fd5c \
23                  sha1 fbafcd19ea0082b3ecb17695b4cb46070181699f \
24                  rmd160 e72e546d762ffb3c2c952fcc77031352a9992b27
25
26python.versions   24 25 26 27 31 32 33 34
27
28if {${name} ne ${subport}} {
29    depends_build port:py${python.version}-setuptools
30    depends_run   path:${python.pkgd}/pytz:py${python.version}-tz
31
32    test.run          yes
33    test.cmd          ${python.bin} test.py
34    test.target
35    test.env          PYTHONPATH=${worksrcpath}/build/lib
36
37    post-destroot {
38      set docdir ${prefix}/share/doc/${subport}
39      xinstall -d ${destroot}${docdir}
40      xinstall -m 0644 -W ${worksrcpath} LICENSE README NEWS ${destroot}${docdir}
41    }
42}
43
44if {${name} eq ${subport}} {
45    livecheck.type    regex
46    livecheck.regex   /${my_name}-(\\d+(?:\\.\\d+)*)
47} elseif {${subport} eq "py27-dateutil"} {
48    livecheck.type    regex
49    livecheck.regex   /${my_name}-(1.(\\d+)*)
50} else {
51    livecheck.type    none
52}
53
54subport py32-dateutil {
55    pre-activate {
56        set regref [registry_open $subport $version $revision $portvariants ""]
57        foreach f [registry_prop_retr $regref imagefiles] {
58            if {[file extension $f] == ".pyc" && [file exists $f] && [registry_file_registered $f] == "0"} {
59                file delete -force $f
60            }
61        }
62    }
63}