Repository: spack/spack

Issue:
gtk-doc build fails: configure: could not find DocBook XML DTD V4.3 in XML catalog
### Steps to reproduce the issue

`gtk-doc` fails during config stage using:

- spack@develop [f0875b2](https://github.com/spack/spack/commit/f0875b2fef8e495809854141785c1fc7f5d86407)

- Ubuntu 20.04, GCC 9.3.0
- Docker container: `ecpe4s/ubuntu20.04-runner-x86_64:2021-07-01`

Spec: [gtk-doc-spack.yaml.txt](https://github.com/spack/spack/files/6984545/gtk-doc_spack.yaml.txt)

How to reproduce:
```
$ git clone https://github.com/spack/spack
$ cd spack
$ git checkout f0875b2
$ . share/spack/setup-env.sh
$ spack env create test ~/gtk-doc-spack.yaml
$ spack env activate test
$ spack buildcache keys -it
$ spack concretize -f
$ spack install
==> Installing gtk-doc-1.32-2z5hjsgkzaemspqqxlgfaerb5wrdhean
==> No binary for gtk-doc-1.32-2z5hjsgkzaemspqqxlgfaerb5wrdhean found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/08/0890c1f00d4817279be51602e67c4805daf264092adc58f9c04338566e8225ba.tar.gz
==> Applied patch /root/spack/var/spack/repos/builtin/packages/gtk-doc/build.patch
==> gtk-doc: Executing phase: 'autoreconf'
==> gtk-doc: Executing phase: 'configure'
==> Error: ProcessError: Command exited with status 1:
    '/tmp/root/spack-stage/spack-stage-gtk-doc-1.32-2z5hjsgkzaemspqqxlgfaerb5wrdhean/spack-src/configure' '--prefix=/root/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/gtk-doc-1.32-2z5hjsgkzaemspqqxlgfaerb5wrdhean'

1 error found in build log:
     126    checking for dblatex... no
     127    checking for fop... no
     128    configure: WARNING: neither dblatex nor fop found, so no pdf output from xml
     129    checking for XML catalog...
     130    checking for xmlcatalog... /root/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-9.3.0/libxml2-2.9.10-qlt5ajqqmtin3atqcycnv67oex63cvny/bin/xmlcatalo
            g
     131    checking for DocBook XML DTD V4.3 in XML catalog... not found
  >> 132    configure: error: could not find DocBook XML DTD V4.3 in XML catalog

See build log for details:
  /tmp/root/spack-stage/spack-stage-gtk-doc-1.32-2z5hjsgkzaemspqqxlgfaerb5wrdhean/spack-build-out.txt
```

### Information on your system

```
* **Spack:** 0.16.2-3907-f0875b2fef
* **Python:** 3.8.5
* **Platform:** linux-ubuntu20.04-zen3
* **Concretizer:** original
```

### Additional information

Build log: [gtk-doc-build-out.txt](https://github.com/spack/spack/files/6984553/gtk-doc-build-out.txt)

Configure log: [spack-build-02-configure-out.txt](https://github.com/spack/spack/files/6984557/spack-build-02-configure-out.txt)

@lee218llnl @adamjstewart 

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:
So, may this related, I recognized that after #24300 the name for the xml catalogs changes from `catalog.xml` to `catalog`, hence I had to reinstall  `docbook-xsl` and `docbook-xml` to fix this.

 I just checked, I install these to packages one commit before the PR, ie 970bf4318c, them `XML_CATALOG_FILES` points to `catalog.xml`, but after checking out th PR commit, ie 4fd8640586816d59693b264bcbd5e1378b0963ff, the export `XML_CATALOG_FILES` now points to the `catalog` file after loading, which does not exist, because the package was not rebuild and have only `catalog.xml`, but not a `catalog` file.

The `XML_CATALOG_FILES` points to the file with the entities, so the name itself should not matter. The `gtk-doc package builds fine on a CentOS-7 system. That likely means that the system installed catalog is, or is not, coming into play, possibly due to the environment variable being ignored.
It could also be something amiss with the entities in the docbook packages. I will look into that as well.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/gtk-doc/package.py b/var/spack/repos/builtin/packages/gtk-doc/package.py
--- a/var/spack/repos/builtin/packages/gtk-doc/package.py
+++ b/var/spack/repos/builtin/packages/gtk-doc/package.py
@@ -42,3 +42,9 @@ def url_for_version(self, version):
         """Handle gnome's version-based custom URLs."""
         url = 'https://gitlab.gnome.org/GNOME/gtk-doc/-/archive/GTK_DOC_{0}/gtk-doc-GTK_DOC_{0}.tar.gz'
         return url.format(version.underscored)
+
+    def configure_args(self):
+        args = [
+            '--with-xml-catalog={0}'.format(self.spec['docbook-xml'].package.catalog)
+        ]
+        return args


Test patch: