### this file is sourced not run
PKGVER=3.1
PKGBUILD=1
PKGARCH=noarch

# BLFS 11.3
TARBALL=docbk31.zip
MD5SUM=432749c0c806dbae81c8bcb70da3b5d3
SRC_URL=https://www.docbook.org/sgml/$PKGVER/$TARBALL
BUNDLE=

SLACKREQ='' # sgml-common unzip build-time
SLACKDESC="docbook31-dtd: docbook31-dtd $PKGVER (Data Type Defitions (DTD) for DocBook)
docbook31-dtd: 
docbook31-dtd: The DocBook SGML DTD package contains document type definitions for 
docbook31-dtd: verification of SGML data files against the DocBook rule set. These 
docbook31-dtd: are useful for structuring books and software documentation to a 
docbook31-dtd: standard allowing you to utilize transformations already written for 
docbook31-dtd: that standard.
docbook31-dtd: 
docbook31-dtd: This package contains the DTD of Docbook 3.1.
docbook31-dtd: 
docbook31-dtd: 
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_check $SRC_DIR $TARBALL $MD5SUM &&
	mkdir tmp/docbook &&
	cd tmp/docbook &&
	unzip $SRC_DIR/$TARBALL
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/docbook* &&

	# BLFS 11.3: remove ENT from catalog, and replace DTDDECL to SGMLDECL
	sed -i -e '/ISO 8879/d' \
		   -e 's|DTDDECL "-//OASIS//DTD DocBook V3.1//EN"|SGMLDECL|g' \
		   docbook.cat &&

	install -v -d -m755 /usr/share/sgml/docbook/sgml-dtd-$PKGVER &&
	chown -R root:root . &&
	install -v docbook.cat /usr/share/sgml/docbook/sgml-dtd-$PKGVER/catalog &&
	cp -v -af *.dtd *.mod *.dcl /usr/share/sgml/docbook/sgml-dtd-$PKGVER &&

	# do the installation in doinst.sh
	mkdir /install && cp ../pkg/{doinst.sh,slack-uninstall.sh} /install &&
	
	pkg_build_slackdesc
}


