Ticket #31241: Portfile

File Portfile, 2.1 KB (added by singingwolfboy@…, 13 years ago)

Unified py*-django port

Line 
1# $Id: Portfile 79396 2011-06-12 22:00:31Z deric@macports.org $
2
3PortSystem          1.0
4PortGroup           python 1.0
5
6name                py-django
7version             1.3.1
8python.versions     24 25 26 27
9categories-append   www
10platforms           darwin
11maintainers         deric
12homepage            http://www.djangoproject.com
13description         Django is a high-level Python Web framework
14long_description    Django is a high-level Python Web framework that \
15                    encourages rapid development and clean, pragmatic \
16                    design.
17
18set branch          [join [lrange [split ${version} .] 0 1] .]
19master_sites        http://media.djangoproject.com/releases/${branch}/
20distname            Django-${version}
21checksums           rmd160  baf14da8d25eb9852a7989e1a1be7d9fd0e21d3a \
22                    sha256  af9118c4e8a063deb0b8cda901fcff2b805e7cf496c93fd43507163f3cde156b
23
24depends_lib-append  port:py${python.version}-distribute
25
26variant bash_completion {
27    depends_run-append  port:bash-completion
28   
29    post-patch {
30        reinplace "s|django-admin.py|django-admin-${python.branch}.py|g" \
31            ${worksrcpath}/extras/django_bash_completion
32    }
33   
34    post-destroot {
35        xinstall -d ${destroot}${prefix}/etc/bash_completion.d
36        xinstall -m 644 ${worksrcpath}/extras/django_bash_completion \
37            ${destroot}${prefix}/etc/bash_completion.d/django-admin-${python.branch}.py
38    }
39}
40
41# we want *-2.7.py not *.py-2.7
42python.link_binaries no
43post-destroot   {
44    set docdir ${prefix}/share/doc/${subport}
45    xinstall -d ${docdir}
46    xinstall -m 644 -W ${worksrcpath} AUTHORS INSTALL LICENSE README \
47        ${destroot}${docdir}
48           
49    file copy ${worksrcpath}/docs ${destroot}${docdir}/docs
50       
51    # To avoid conflict between py*-django
52    ln -s ${python.prefix}/bin/django-admin.py \
53        ${destroot}${prefix}/bin/django-admin-${python.branch}.py
54}
55
56livecheck.type      regex
57livecheck.url       http://www.djangoproject.com/download/
58livecheck.regex     "The latest official version is (1\.\[0-9\]+\.\[0-9\]+)"
59