NAME="sgml-common"
DESC="Contains install-catalog which is useful for creating and maintaining centralized SGML catalogs"
VERSION="0.6.3"
FILES=(
  "https://sourceware.org/ftp/docbook-tools/new-trials/SOURCES/sgml-common-$VERSION.tgz"
  "https://www.linuxfromscratch.org/patches/blfs/12.0/sgml-common-$VERSION-manpage-1.patch"
)
HASHES=(
  "103c9828f24820df86e55e7862e28974"
  "50d93af704a0869faf8fedf5d23b1a9f90fff6499f4c11cf4addb5e460b7b58b"
)
DEPENDS=()

PACKAGE() {
  tar xf $NAME-$VERSION.tgz
  cd $NAME-$VERSION

  patch -Np1 -i ../sgml-common-$VERSION-manpage-1.patch 
  autoreconf -f -i

  ./configure --prefix=/usr --sysconfdir=/etc
  make && make DESTDIR=$ROOTDIR install
  make DESTDIR=$ROOTDIR docdir=/usr/share/doc install

  install-catalog --add /etc/sgml/sgml-ent.cat \
    $ROOTDIR/usr/share/sgml/sgml-iso-entities-8879.1986/catalog &&

  install-catalog --add /etc/sgml/sgml-docbook.cat \
    $ROOTDIR/etc/sgml/sgml-ent.cat

  cd .. && rm -rf $NAME-$VERSION
}
