commit c93beb82887523c938911d317a8a1b1fee85a766 Author: xhaa123 Date: Tue Apr 30 21:22:32 2024 +0800 docbook-4.5-dtd 4.5-1 diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..5d0ad90 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,45 @@ +# This is an example PKGBUILD file. Use this as a start to creating your own, +# and remove these comments. For more information, see 'man PKGBUILD'. +# NOTE: Please fill out the license field for your package! If it is unknown, +# then please put 'unknown'. + +# Maintainer: Future Linux Team +pkgname=docbook-4.5-dtd +pkgver=4.5 +pkgrel=1 +pkgdesc="Document type definitions for verification of SGML data files against the DocBook rule set" +arch=('x86_64') +url="https://www.docbook.org/sgml" +license=('MIT') +depends=('sgml-common') +install=${pkgname}.install +source=(https://www.docbook.org/sgml/${pkgver}/docbook-${pkgver}.zip) +sha256sums=(8043e514e80c6c19cb146b5d37937d1305bf3abf9b0097c36df7f70f611cdf43) + +prepare() { + + sed -i -e '/ISO 8879/d' \ + -e '/gml/d' docbook.cat + + cat >> docbook.cat << "EOF" + + -- Begin Single Major Version catalog changes -- + +PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "docbook.dtd" +PUBLIC "-//OASIS//DTD DocBook V4.3//EN" "docbook.dtd" +PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "docbook.dtd" +PUBLIC "-//OASIS//DTD DocBook V4.1//EN" "docbook.dtd" +PUBLIC "-//OASIS//DTD DocBook V4.0//EN" "docbook.dtd" + + -- End Single Major Version catalog changes -- + +EOF +} + +package() { + + install -v -d ${pkgdir}/usr/share/sgml/docbook/sgml-dtd-${pkgver} + + install -v docbook.cat ${pkgdir}/usr/share/sgml/docbook/sgml-dtd-${pkgver}/catalog + cp -v -af *.dtd *.mod *.dcl ${pkgdir}/usr/share/sgml/docbook/sgml-dtd-${pkgver} +} diff --git a/docbook-4.5-dtd.install b/docbook-4.5-dtd.install new file mode 100644 index 0000000..fbb70f1 --- /dev/null +++ b/docbook-4.5-dtd.install @@ -0,0 +1,27 @@ +# This is a default template for a post-install scriptlet. +# Uncomment only required functions and remove any functions +# you don't need (and this header). + +post_install() { + install-catalog --add /etc/sgml/sgml-docbook-dtd-4.5.cat \ + /usr/share/sgml/docbook/sgml-dtd-4.5/catalog + + install-catalog --add /etc/sgml/sgml-docbook-dtd-4.5.cat \ + /etc/sgml/sgml-docbook.cat +} + +pre_upgrade() { + pre_remove $1 +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + install-catalog --remove /etc/sgml/sgml-docbook-dtd-4.5.cat \ + /usr/share/sgml/docbook/sgml-dtd-4.5/catalog + + install-catalog --remove /etc/sgml/sgml-docbook-dtd-4.5.cat \ + /etc/sgml/sgml-docbook.cat +}