# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8::et:sw=4:ts=4:sts=4
# $Id: Portfile 114337 2013-12-05 12:53:47Z g5pw@macports.org $

PortSystem          1.0
PortGroup           github 1.0
PortGroup           xcode 1.0

github.setup        tomaz appledoc 2.2 v
maintainers         g5pw openmaintainer
categories          devel
description         ${name} is a documentation generator for Xcode
long_description    ${name} is command line tool that helps Objective-C \
                    developers generate Apple-like source code documentation \
                    from specially formatted source code comments. It\'s designed \
                    to take as readable source code comments as possible for the \
                    input and use comments as well as surrounding source code to \
                    generate visually appealing documentation in the form of \
                    HTML as well as fully indexed and browsable Xcode \
                    documentation set.
homepage            http://gentlebytes.com/${name}/
license             BSD

checksums           rmd160  7049aee126baed721c3e6fdc3ec066766b47bcd8 \
                    sha256  7d86ff332c679a697dd62318585a413b09802881f4dc73ee9ae0217a8977847f

xcode.target        appledoc
xcode.configuration Release
xcode.destroot.path ${prefix}/bin

xcode.destroot.settings \
                    OTHER_CFLAGS='-DCOMPILE_TIME_DEFAULT_TEMPLATE_PATH=@\"${destroot}${prefix}/share/${name}/Templates\"'

pre-fetch {
    if {${os.platform} eq "darwin" && ${os.major} < 11} {
        ui_error "${name} is only supported on OS X 10.7 Lion or later."
        return -code error "unsupported platform version"
    }
}

post-destroot {
    xinstall -d ${destroot}${prefix}/share/${name}
    copy ${worksrcpath}/Templates ${destroot}${prefix}/share/${name}/
}
