public
Description: Git mirror of the MacPorts svn repo
Homepage: http://www.macports.org
Clone URL: git://github.com/kballard/macports.git
Boey Maun Suang (author)
Tue Jun 19 02:21:30 -0700 2007
commit  f0fe84a03bff32deb64607b3752a1e288cb42ba6
tree    969755010aac45f99a2393014e51d47ef2b76dfb
parent  71f7e16b2a9ef8828387825778ac594a0d18f89c
macports / dports / textproc / docbook-xsl / Portfile
100644 91 lines (79 sloc) 3.575 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# $Id$
 
PortSystem 1.0
 
name docbook-xsl
version 1.72.0
categories textproc
description the docbook xsl stylesheets
platforms darwin
maintainers boeyms@macports.org openmaintainer@macports.org
master_sites sourceforge:docbook
homepage http://docbook.sourceforge.net/
depends_run port:xmlcatmgr
 
use_bzip2 yes
checksums [suffix ${distname}] md5 b38b895d47ef7058e4d42b52fdae23f4 \
            sha1 d2b4411652b14842ff77fc51fd675408f76e8147 \
            rmd160 4df75842c4cda825ba5f36f5e5235e796e49b1bb
 
use_configure no
build {}
set srcxslpaths "catalog.xml common eclipse extensions fo highlighting \
                html htmlhelp images javahelp lib manpages params \
                profiling roundtrip slides template tools xhtml VERSION"
set srcdocpaths "BUGS ChangeHistory.xml.zip README RELEASE-NOTES.html \
                RELEASE-NOTES.xml TODO VERSION NEWS COPYING"
set instxsldir "share/xsl/${name}"
set instdocdir "share/doc/${name}"
 
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}
    }
}
post-activate {
    # xmlcatmgr as installed by MacPorts defaults to using
    # ${prefix}/etc/xml/docbook (for XML) and ${prefix}/etc/xml/docbook (for
    # SGML) if no catalog is specified, but we'll specify the path just in case
    # users have another installation of xmlcatmgr and happen to have it before
    # ${prefix}/bin in their PATH.
    set catalog.xml ${prefix}/etc/xml/catalog
 
    # Make the directory if it doesn't exist
    if {![file exists ${prefix}/etc/xml]} {
        xinstall -m 755 -d ${prefix}/etc/xml
    }
 
    # Create the catalog file if it doesn't exist
    if {![file exists ${catalog.xml}]} {
        system "xmlcatmgr create -c ${catalog.xml}"
    }
 
    # Add the nextCatalog entry to the catalog if it doesn't exist
    if {[catch {exec xmlcatmgr lookup ${prefix}/${instxsldir}/catalog.xml}]} {
        system "xmlcatmgr add nextCatalog ${prefix}/${instxsldir}/catalog.xml"
    }
 
    # Once MacPorts does get a post-deactivate hook, this should change to
    # auto-detect whether or not the user's installed version has the hook, and
    # only print the message if it doesn't.
    ui_msg \
    "######################################################################"
    ui_msg "# As MacPorts does not currently have a post-deactivate hook,\
        \n# you will need to ensure that you manually remove the catalog\
        \n# entry for this port when you uninstall it. To do so, run\
        \n# \"xmlcatmgr remove nextCatalog ${prefix}/${instxsldir}/catalog.xml\"."
    ui_msg \
    "######################################################################"
}
 
# This will remove the catalog entry for this port once a post-deactivate hook
# has been implemented.
#post-deactivate {
# system "xmlcatmgr remove nextCatalog ${prefix}/${instdir}/catalog.xml"
#}
 
variant doc description {Install full DocBook XSL documentation} {
    distfiles-append [suffix ${name}-doc-${version}]
    checksums-append [suffix ${name}-doc-${version}] \
                        md5 f6b71552c992f16f477f0513f569985c \
                        sha1 0103bbe3fd96fb95ca5469b02c7033b27feba2a7 \
                        rmd160 815b58e965b80cccccd50dad57abb972ea8aa9ee
    lappend srcdocpaths doc
}