# SliTaz package receipt.
PACKAGE="docbook-xml"
VERSION="4.5"
CATEGORY="development"
SHORT_DESC="A widely used XML scheme for writing documentation and help. (version 4.5)"
MAINTAINER="slaxemulator@gmail.com"
LICENSE="MIT"
TARBALL="$PACKAGE-$VERSION.zip"
WEB_SITE="https://docbook.org/"
WGET_URL="https://www.docbook.org/xml/$VERSION/$TARBALL"
DEPENDS="libxml2-tools libxml2 docbook-xml-412 docbook-xml-42 docbook-xml-43 docbook-xml-44"
# What is the latest version available today?
current_version()
{
wget -O - http://www.docbook.org/xml/ 2>/dev/null | \
sed 's|
|&\n|g' | sed '/>4\.5/!d;/[0-9][Cb]/d;s|.*">||;s|/<.*||' | sort -Vr | sed q
}
# Rules to configure and make the package.
compile_rules()
{
mkdir -p $DESTDIR/usr/share/xml/docbook/xml-dtd-$VERSION
cp -dRf docbook.cat *.dtd ent/ *.mod \
$DESTDIR/usr/share/xml/docbook/xml-dtd-$VERSION
}
# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
mkdir -p $fs
cp -a $install/usr $fs
}
post_install()
{
[ -d "$1/etc/xml" ] || mkdir -p "$1/etc/xml"
if [ -f "$1/etc/xml/docbook-xml" ]; then
chroot "$1/" xmlcatalog --noout /etc/xml/docbook-xml
else
chroot "$1/" xmlcatalog --noout --create /etc/xml/docbook-xml
fi
if [ "$1" ]; then
mv -f "$1/etc/resolv.conf" "$1/etc/recolv.conf.$$" 2> /dev/null
cp /etc/resolv.conf "$1/etc/resolv.conf"
fi
# V4.1.2
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.1.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" \
"/etc//xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML CALS Table Model V4.1.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/calstblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML CALS Table Model V4.1.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/calstblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/soextblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Information Pool V4.1.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/dbpoolx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.1.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/dbhierx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Additional General Entities V4.1.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/dbgenent.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Notations V4.1.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/dbnotnx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Character Entities V4.1.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.1.2/dbcentx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/4.1.2" \
"file:///usr/share/xml/docbook/xml-dtd-4.1.2" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/4.1.2" \
"file:///usr/share/xml/docbook/xml-dtd-4.1.2" \
"/etc/xml/docbook-xml"
# V4.2
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook CALS Table Model V4.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.2/calstblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
"http://www.oasis-open.org/docbook/xml/4.2/soextblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook Information Pool V4.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.2/dbpoolx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook Document Hierarchy V4.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.2/dbhierx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Additional General Entities V4.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.2/dbgenent.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Notations V4.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.2/dbnotnx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Character Entities V4.2//EN" \
"http://www.oasis-open.org/docbook/xml/4.2/dbcentx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/4.2" \
"file:///usr/share/xml/docbook/xml-dtd-4.2" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/4.2" \
"file:///usr/share/xml/docbook/xml-dtd-4.2" \
"/etc/xml/docbook-xml"
# V4.3
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.3//EN" \
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook CALS Table Model V4.3//EN" \
"http://www.oasis-open.org/docbook/xml/4.3/calstblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
"http://www.oasis-open.org/docbook/xml/4.3/soextblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook Information Pool V4.3//EN" \
"http://www.oasis-open.org/docbook/xml/4.3/dbpoolx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook Document Hierarchy V4.3//EN" \
"http://www.oasis-open.org/docbook/xml/4.3/dbhierx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Additional General Entities V4.3//EN" \
"http://www.oasis-open.org/docbook/xml/4.3/dbgenent.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Notations V4.3//EN" \
"http://www.oasis-open.org/docbook/xml/4.3/dbnotnx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Character Entities V4.3//EN" \
"http://www.oasis-open.org/docbook/xml/4.3/dbcentx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/4.3" \
"file:///usr/share/xml/docbook/xml-dtd-4.3" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/4.3" \
"file:///usr/share/xml/docbook/xml-dtd-4.3" \
"/etc/xml/docbook-xml"
# V4.4
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook CALS Table Model V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/calstblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/htmltblx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/soextblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook Information Pool V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/dbpoolx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/dbhierx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Additional General Entities V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/dbgenent.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Notations V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/dbnotnx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook Character Entities V4.4//EN" \
"http://www.oasis-open.org/docbook/xml/4.4/dbcentx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/4.4" \
"file:///usr/share/xml/docbook/xml-dtd-4.4" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/4.4" \
"file:///usr/share/xml/docbook/xml-dtd-4.4" \
"/etc/xml/docbook-xml"
# V4.5
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.5//EN" \
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML CALS Table Model V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/calstblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/soextblx.dtd" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Information Pool V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbpoolx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbhierx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/htmltblx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Notations V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbnotnx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Character Entities V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbcentx.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Additional General Entities V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbgenent.mod" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/4.5" \
"file:///usr/share/xml/docbook/xml-dtd-4.5" \
"/etc/xml/docbook-xml"
chroot "$1/" xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/4.5" \
"file:///usr/share/xml/docbook/xml-dtd-4.5" \
"/etc/xml/docbook-xml"
if [ -f "$1/etc/xml/catalog" ]; then
chroot "$1/" xmlcatalog --noout /etc/xml/catalog
else
chroot "$1/" xmlcatalog --noout --create /etc/xml/catalog
fi
chroot "$1/" xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//ENTITIES DocBook XML" \
"file:///etc/xml/docbook-xml" \
"/etc/xml/catalog"
chroot "$1/" xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//DTD DocBook XML" \
"file:///etc/xml/docbook-xml" \
"/etc/xml/catalog"
chroot "$1/" xmlcatalog --noout --add "delegateSystem" \
"http://www.oasis-open.org/docbook/" \
"file:///etc/xml/docbook-xml" \
"/etc/xml/catalog"
chroot "$1/" xmlcatalog --noout --add "delegateURI" \
"http://www.oasis-open.org/docbook/" \
"file:///etc/xml/docbook-xml" \
"/etc/xml/catalog"
if [ -n "$1" ]; then
mv -f "$1/etc/resolv.conf.$$" "$1/etc/recolv.conf" 2> /dev/null
fi
}
post_remove()
{
xmlcatalog --noout --del file:///etc/xml/docbook-xml "$1/etc/xml/catalog"
}