# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 76557 2011-02-28 06:34:19Z jmr@macports.org $

PortSystem      1.0

name            docbook-xml-5.0
version         [lindex [split $name -] 2]
categories      textproc
platforms       darwin
license         MIT
maintainers     nomaintainer
supported_archs noarch
description     Version $version of the DocBook XML DTDs

long_description \
    Version $version of the DocBook XML DTDs, which provide a structured,\
    semantic markup format for books and documentation, especially for\
    computer hardware and software.


homepage        http://www.docbook.org/xml/$version/
master_sites    $homepage
distname        docbook-$version
use_zip         yes

checksums       md5     2411c19ed4fb141f3fa3d389fae40736 \
                sha1    49f274e67efdee771300cba4da1f3e4bc00be1ec \
                rmd160  3fc1b6a1c6f94b77223ad9139676d5b8d8f36786

depends_run     port:xmlcatmgr

use_configure   no

build {}

set bookdir     ${prefix}/share/xml/docbook/${version}

destroot {
    xinstall -d $destroot[file dirname $bookdir]
    copy $worksrcpath $destroot$bookdir
}

post-activate {
    if {[catch {exec xmlcatmgr lookup $bookdir/catalog.xml}]} {
        system "xmlcatmgr add nextCatalog $bookdir/catalog.xml"
    }
}

if {${registry.format} == "receipt_flat"} {
    notes \
"######################################################################
# As the flat registry format does not support post-deactivate hooks,
# you will need to ensure that you manually remove the catalog
# entry for this port when you uninstall it.  To do so, run
# \"xmlcatmgr remove nextCatalog ${bookdir}/catalog.xml\".
######################################################################"
}

# This will remove the catalog entry for this port.
post-deactivate {
    system "xmlcatmgr remove nextCatalog ${bookdir}/catalog.xml"
}

livecheck.type  none
