# $Id: Portfile 119128 2014-04-17 22:39:00Z pixilla@macports.org $
# -*- 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       xmlcatalog 1.0

name            docbook-xsl
version         1.78.1
revision        1
categories      textproc
license         MIT Permissive
description     The docbook xsl stylesheets
long_description \
    The DocBook XSL stylesheets are the official stylesheets for transforming\
    DocBook XML documents into other document formats via XSLT.
platforms       darwin
maintainers     nomaintainer
master_sites    sourceforge:docbook
homepage        http://docbook.sourceforge.net/
depends_run     port:xmlcatmgr

use_bzip2       yes

distfiles-append \
                ${name}-doc-${version}${extract.suffix}

checksums       ${distname}${extract.suffix} \
                sha1    1d668c845bb43c65115d1a1d9542f623801cfb6f \
                rmd160  1f29e74eaab655673ced47b7a011c35c4d1e5187 \
                ${name}-doc-${version}${extract.suffix} \
                sha1    bf69dc152a9f983a1af197d9041b8c4dc894dd5d \
                rmd160  78f6b1bc4ca2de024addd4ab9092dc929fd4d3aa

supported_archs noarch
use_configure   no
build           {}
set srcxslpaths "assembly catalog.xml common eclipse epub epub3 extensions fo \
                highlighting html htmlhelp images javahelp lib manpages params \
                profiling roundtrip slides template tools webhelp website \
                xhtml xhtml-1_1 xhtml5 \
                VERSION VERSION.xsl"
set srcdocpaths "AUTHORS BUGS README RELEASE-NOTES.html RELEASE-NOTES.txt \
                TODO VERSION NEWS COPYING doc"
set instxsldir  "share/xsl/${name}"
set instdocdir  "share/doc/${name}"

xml.catalog "${prefix}/${instxsldir}/catalog.xml"

destroot {
    foreach pathname "${instxsldir} ${instdocdir}" {
        xinstall -m 755 -d ${destroot}${prefix}/${pathname}
    }
    foreach pathname ${srcxslpaths} {
        copy ${worksrcpath}/${pathname} ${destroot}${prefix}/${instxsldir}
    }
    foreach pathname ${srcdocpaths} {
        copy ${worksrcpath}/${pathname} ${destroot}${prefix}/${instdocdir}
    }
}

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 ${prefix}/${instxsldir}/catalog.xml\".
######################################################################"
}

livecheck.url       http://docbook.sourceforge.net/release/xsl/
livecheck.regex "=\"(\\d+(?:\\.\\d+)*)"
