# -*- 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                trac-devel
conflicts           trac
set my_name         trac
set proj_name       Trac
version             1.4.3
revision            1

categories          devel python
platforms           {darwin any}
maintainers         nomaintainer
# modified BSD, see http://trac.edgewall.org/wiki/TracLicense
license             BSD

description         Wiki and issue tracking system.
long_description    Trac is an enhanced wiki and issue tracking system for \
                    software development projects. Trac uses a minimalistic approach to \
                    web-based software project management.

supported_archs     noarch

homepage            https://trac.edgewall.org/
python.rootname     ${proj_name}
dist_subdir         ${my_name}

checksums           rmd160  aa218a0368a527049489daa1a27afddb2948f6b9 \
                    sha256  c93ceed9abee6e3c7789f469862e82a3b9bf3405be73aae3221b5c259e062d21 \
                    size    5650083

python.default_version \
                    27

depends_lib-append  \
                    port:py${python.version}-babel \
                    port:py${python.version}-docutils \
                    port:py${python.version}-genshi \
                    port:py${python.version}-jinja2 \
                    port:py${python.version}-pygments \
                    port:py${python.version}-sqlite \
                    port:py${python.version}-textile \
                    port:py${python.version}-tz

notes {
    See http://projects.edgewall.com/trac/wiki/TracInstall for information on setting up a new trac environment.
}

variant postgres description {Build with postgresql support instead of sqlite} {
    depends_lib-delete port:py${python.version}-sqlite
    depends_lib-append port:py${python.version}-psycopg2
}

variant mysql description {Build with mysql support instead of sqlite} {
    depends_lib-delete port:py${python.version}-sqlite
    depends_lib-append port:py${python.version}-pymysql

    notes-append "\
\nWarning: Trac supports the MySQL database backend, although there are a couple of Known Issues.
See http://trac.edgewall.org/wiki/MySqlDb for more detailed information.
"
}

variant subversion description {Build with subversion support} {
    depends_lib-append port:subversion-python${python.version}bindings
}

default_variants-append \
                    +subversion

post-destroot   {
    file mkdir ${destroot}${prefix}/share/trac/
    file copy ${worksrcpath}/contrib \
        ${destroot}${prefix}/share/trac/contrib
    system "ln -sf ${python.prefix}/bin/trac-admin \
        ${destroot}${prefix}/bin/trac-admin"
    system "ln -sf ${python.prefix}/bin/tracd \
        ${destroot}${prefix}/bin/tracd"
}
