summaryrefslogtreecommitdiff
path: root/repo/devel/docbook4-xml/docbook4-xml.xibuild
blob: 36faa985a9c3d8a78672c025c629be6056ed4483 (plain)
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
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh

MAKEDEPS="unzip"
DEPS="libxml2 sgml-common"

PKG_VER=4.5
SOURCE=https://www.docbook.org/xml/$PKG_VER/docbook-xml-$PKG_VER.zip
DESC="A widely used XML scheme for writing documentation and help"

VERSIONS="4.5 4.4 4.3 4.2 4.1"

ADDITIONAL="
    https://www.docbook.org/xml/4.4/docbook-xml-4.4.zip
    https://www.docbook.org/xml/4.3/docbook-xml-4.3.zip
    https://www.docbook.org/xml/4.2/docbook-xml-4.2.zip
    https://www.docbook.org/xml/4.1/docbook-xml-4.1.zip
"

package () {
    for v in $VERSIONS; do 
        mkdir docbook-xml-$v
        cd docbook-xml-$v
        unzip -o ../docbook-xml-$v.zip
        install -m755 -d $PKG_DEST/usr/share/xml/docbook/xml-dtd-$v &&
        install -m755 -d $PKG_DEST/etc/xml &&
        chown -R root:root . &&
        cp -af docbook.cat *.dtd ent/ *.mod \
            $PKG_DEST/usr/share/xml/docbook/xml-dtd-$v

        cd ..
    done
}

postinstall () {
    for v in $VERSIONS; do 
        if [ ! -e /etc/xml/docbook ]; then
            xmlcatalog --noout --create /etc/xml/docbook
        fi
        xmlcatalog --noout --add "public" \
            "-//OASIS//DTD DocBook XML V$v//EN" \
            "http://www.oasis-open.org/docbook/xml/$v/docbookx.dtd" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "public" \
            "-//OASIS//DTD DocBook XML CALS Table Model V$v//EN" \
            "file:///usr/share/xml/docbook/xml-dtd-$v/calstblx.dtd" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "public" \
            "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
            "file:///usr/share/xml/docbook/xml-dtd-$v/soextblx.dtd" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "public" \
            "-//OASIS//ELEMENTS DocBook XML Information Pool V$v//EN" \
            "file:///usr/share/xml/docbook/xml-dtd-$v/dbpoolx.mod" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "public" \
            "-//OASIS//ELEMENTS DocBook XML Document Hierarchy V$v//EN" \
            "file:///usr/share/xml/docbook/xml-dtd-$v/dbhierx.mod" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "public" \
            "-//OASIS//ELEMENTS DocBook XML HTML Tables V$v//EN" \
            "file:///usr/share/xml/docbook/xml-dtd-$v/htmltblx.mod" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "public" \
            "-//OASIS//ENTITIES DocBook XML Notations V$v//EN" \
            "file:///usr/share/xml/docbook/xml-dtd-$v/dbnotnx.mod" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "public" \
            "-//OASIS//ENTITIES DocBook XML Character Entities V$v//EN" \
            "file:///usr/share/xml/docbook/xml-dtd-$v/dbcentx.mod" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "public" \
            "-//OASIS//ENTITIES DocBook XML Additional General Entities V$v//EN" \
            "file:///usr/share/xml/docbook/xml-dtd-$v/dbgenent.mod" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "rewriteSystem" \
            "http://www.oasis-open.org/docbook/xml/$v" \
            "file:///usr/share/xml/docbook/xml-dtd-$v" \
            /etc/xml/docbook &&
        xmlcatalog --noout --add "rewriteURI" \
            "http://www.oasis-open.org/docbook/xml/$v" \
            "file:///usr/share/xml/docbook/xml-dtd-$v" \
            /etc/xml/docbook
        if [ ! -e /etc/xml/catalog ]; then
            xmlcatalog --noout --create /etc/xml/catalog
        fi 
        xmlcatalog --noout --add "delegatePublic" \
            "-//OASIS//ENTITIES DocBook XML" \
            "file:///etc/xml/docbook" \
            /etc/xml/catalog &&
        xmlcatalog --noout --add "delegatePublic" \
            "-//OASIS//DTD DocBook XML" \
            "file:///etc/xml/docbook" \
            /etc/xml/catalog &&
        xmlcatalog --noout --add "delegateSystem" \
            "http://www.oasis-open.org/docbook/" \
            "file:///etc/xml/docbook" \
            /etc/xml/catalog &&
        xmlcatalog --noout --add "delegateURI" \
            "http://www.oasis-open.org/docbook/" \
            "file:///etc/xml/docbook" \
            /etc/xml/catalog
    done
}