Ticket #28166: Portfile

File Portfile, 5.0 KB (added by jclift@…, 13 years ago)

Updated version of the portfile, with dest_subdir, supported_arches noarch, and xinstall -W.

Line 
1# -*- 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
2# $Id$
3
4PortSystem 1.0
5name            xhtml1
6version         2.0
7categories      textproc
8maintainers     redhat.com:jclift
9description     A reformulation of HTML 4 in XML 1.0
10homepage        http://www.w3.org/TR/xhtml1/
11platforms       darwin
12supported_archs noarch
13distfiles       xhtml1.tgz
14
15long_description The Second Edition of XHTML 1.0, a reformulation \
16                of HTML 4 as an XML 1.0 application, and three DTDs \
17                corresponding to the ones defined by HTML 4. \
18                These DTDs are useful for validating or processing \
19                world wide web pages with XML tools.
20
21master_sites    http://www.w3.org/TR/xhtml1/
22
23checksums       md5 1fdad567eecb5deb8e32e3892cfe0074 \
24                sha1 6fb14e70047f4b56681cd64032ca5ec5eb9396cd \
25                rmd160 923b346b4cd7e2fac147692c95abca93cacfc828
26
27depends_run port:xmlcatmgr
28
29use_configure   no
30build           {}
31
32dist_subdir     ${name}/${version}
33set instdir     share/xml/html/4
34
35destroot        { 
36        xinstall -m 755 -d ${destroot}${prefix}/${instdir}
37        xinstall -m 644 -W ${workpath}/xhtml1-20020801/DTD/ xhtml.soc xhtml-lat1.ent xhtml-special.ent xhtml-symbol.ent xhtml1-frameset.dtd xhtml1-strict.dtd xhtml1-transitional.dtd xhtml1.dcl ${destroot}${prefix}/${instdir}
38}
39
40post-activate {
41    # xmlcatmgr as installed by MacPorts defaults to using
42    # ${prefix}/etc/xml/docbook (for XML) and ${prefix}/etc/xml/docbook (for
43    # SGML) if no catalog is specified, but we'll specify the path just in case
44    # users have another installation of xmlcatmgr and happen to have it before
45    # ${prefix}/bin in their PATH.
46    set catalog.xml ${prefix}/etc/xml/catalog
47
48    # Make the directory if it doesn't exist
49    if {![file exists ${prefix}/etc/xml]} {
50        xinstall -m 755 -d ${prefix}/etc/xml
51    }
52
53    # Create the catalog file if it doesn't exist
54    if {![file exists ${catalog.xml}]} {
55        system "xmlcatmgr create -c ${catalog.xml}"
56    }
57
58    # Add the entries to the catalog
59    system "xmlcatmgr add public '-//W3C//DTD XHTML 1.0 Strict//EN' '${prefix}/${instdir}/xhtml1-strict.dtd'"
60    system "xmlcatmgr add public '-//W3C//DTD XHTML 1.0 Transitional//EN' '${prefix}/${instdir}/xhtml1-transitional.dtd'"
61    system "xmlcatmgr add public '-//W3C//DTD XHTML 1.0 Frameset//EN' '${prefix}/${instdir}/xhtml1-frameset.dtd'"
62    system "xmlcatmgr add public '-//W3C//ENTITIES Latin 1 for XHTML//EN' '${prefix}/${instdir}/xhtml-lat1.ent'"
63    system "xmlcatmgr add public '-//W3C//ENTITIES Special for XHTML//EN' '${prefix}/${instdir}/xhtml-special.ent'"
64    system "xmlcatmgr add public '-//W3C//ENTITIES Symbols for XHTML//EN' '${prefix}/${instdir}/xhtml-symbol.ent'"
65    system "xmlcatmgr add rewriteSystem 'http://www.w3.org/TR/xhtml1/DTD/' '${prefix}/${instdir}/'"
66    system "xmlcatmgr add rewriteSystem 'http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/' '${prefix}/${instdir}/'"
67    system "xmlcatmgr add rewriteURI 'http://www.w3.org/TR/xhtml1/DTD/' '${prefix}/${instdir}/'"
68    system "xmlcatmgr add rewriteURI 'http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/' '${prefix}/${instdir}/'"
69}
70
71if {${registry.format} == "receipt_flat"} {
72    notes \
73"######################################################################
74# As the flat registry format does not support post-deactivate hooks,
75# you will need to ensure that you manually remove the catalog
76# entres for this port when you uninstall it.  To do so, run
77# \"xmlcatmgr remove public '-//W3C//DTD XHTML 1.0 Strict//EN'\"
78# \"xmlcatmgr remove public '-//W3C//DTD XHTML 1.0 Transitional//EN'\"
79# \"xmlcatmgr remove public '-//W3C//DTD XHTML 1.0 Frameset//EN'\"
80# \"xmlcatmgr remove public '-//W3C//ENTITIES Latin 1 for XHTML//EN'\"
81# \"xmlcatmgr remove public '-//W3C//ENTITIES Special for XHTML//EN'\"
82# \"xmlcatmgr remove public '-//W3C//ENTITIES Symbols for XHTML//EN'\"
83# \"xmlcatmgr remove rewriteSystem 'http://www.w3.org/TR/xhtml1/DTD/'\"
84# \"xmlcatmgr remove rewriteSystem 'http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/'\"
85# \"xmlcatmgr remove rewriteURI 'http://www.w3.org/TR/xhtml1/DTD/'\"
86# \"xmlcatmgr remove rewriteURI 'http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/'\"
87######################################################################"
88}
89
90# This will remove the catalog entries for this port.
91post-deactivate {
92    system "xmlcatmgr remove public '-//W3C//DTD XHTML 1.0 Strict//EN'"
93    system "xmlcatmgr remove public '-//W3C//DTD XHTML 1.0 Transitional//EN'"
94    system "xmlcatmgr remove public '-//W3C//DTD XHTML 1.0 Frameset//EN'"
95    system "xmlcatmgr remove public '-//W3C//ENTITIES Latin 1 for XHTML//EN'"
96    system "xmlcatmgr remove public '-//W3C//ENTITIES Special for XHTML//EN'"
97    system "xmlcatmgr remove public '-//W3C//ENTITIES Symbols for XHTML//EN'"
98    system "xmlcatmgr remove rewriteSystem 'http://www.w3.org/TR/xhtml1/DTD/'"
99    system "xmlcatmgr remove rewriteSystem 'http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/'"
100    system "xmlcatmgr remove rewriteURI 'http://www.w3.org/TR/xhtml1/DTD/'"
101    system "xmlcatmgr remove rewriteURI 'http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/'"
102}
103
104livecheck.type  none
105