# -*- 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
# $Id: Portfile 84765 2011-10-01 00:09:00Z dports@macports.org $

PortSystem      1.0

name            gtk-doc
version         1.18
categories      gnome devel
license         GPL-2+
installs_libs   no
platforms       darwin freebsd linux
supported_archs noarch
installs_libs   no
maintainers     devans openmaintainer
description     GTK+/GNOME API documentation generator

long_description \
    GTK-Doc generates API documentation from comments added to C code. \
    It is typically used to document the public API of GTK+  and GNOME \
    libraries, but it can also be used to document application code.

homepage        http://www.gtk.org/gtk-doc/
master_sites    gnome:sources/${name}/${version}/
use_bzip2       yes

checksums       sha1    ccc03d249f624ed5f88ecc857c6b454ddb1dd48b \
                rmd160  0c14e99a6b58f4d5930959543d0fa867afe416c8

depends_build   port:gnome-doc-utils \
                port:pkgconfig \
                path:lib/pkgconfig/glib-2.0.pc:glib2

# rarian is needed during post-activate
depends_lib     port:rarian \
                port:libxml2 \
                path:bin/perl:perl5 \
                port:docbook-xml \
                port:docbook-xsl

configure.perl ${prefix}/bin/perl
configure.args  --with-xml-catalog=${prefix}/etc/xml/catalog

# TODO Enable test support.

post-activate {
    ui_debug "Updating scrollkeeper database..."
    system "${prefix}/bin/scrollkeeper-update"
}

variant python25 conflicts python26 python27 description {Use python 2.5} {
    depends_lib-append      port:python25
    depends_run-append      port:py25-libxml2
    configure.python        ${prefix}/bin/python2.5
}
variant python26 conflicts python25 python27 description {Use python 2.6} {
    depends_lib-append      port:python26
    depends_run-append      port:py26-libxml2
    configure.python        ${prefix}/bin/python2.6
}
variant python27 conflicts python25 python26 description {Use python 2.7} {
    depends_lib-append      port:python27
    depends_run-append      port:py27-libxml2
    configure.python        ${prefix}/bin/python2.7
}

# Default to python 2.7
if {![variant_isset python25] && ![variant_isset python26]} {
    default_variants +python27
}

livecheck.type  regex
livecheck.url   http://ftp.gnome.org/pub/gnome/sources/${name}/?C=M&O=D
livecheck.regex {(\d+(?:\.\d+)*)/}
