open-sp: install man pages and docs

Remove the `--disable-doc-build` option and set the XML_CATALOG env
variable so that http:// sysids get resolved to local catalog files and
we don't have disallowed-network-access-in-xsltproc problems (hat tip:
ilovezfs)

This gives us manpages, which were previously not being generated, and
the rest of the docs

Also, add simple open-sp test by writing out an SGML file, then reading
and assert its validity with onsgmls.

`onsgmls` non-zero return status is a test failure.

Closes #16544.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
Matt Patterson 2017-08-08 11:30:00 +02:00 committed by ilovezfs
parent 1b98748c9d
commit 9033ab7971

View file

@ -12,14 +12,35 @@ class OpenSp < Formula
sha256 "d7b79be390f3c2b2a823e1156d896200db397dffb6cb6e6712d27539e05ca18b" => :yosemite sha256 "d7b79be390f3c2b2a823e1156d896200db397dffb6cb6e6712d27539e05ca18b" => :yosemite
end end
depends_on "docbook" => :build
depends_on "ghostscript" => :build
depends_on "xmlto" => :build
def install def install
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
system "./configure", "--disable-debug", "--disable-dependency-tracking", system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}", "--prefix=#{prefix}",
"--mandir=#{man}", "--mandir=#{man}",
"--disable-doc-build",
"--enable-http", "--enable-http",
"--enable-default-catalog=#{etc}/sgml/catalog", "--enable-default-catalog=#{etc}/sgml/catalog"
"--enable-default-search-path=#{HOMEBREW_PREFIX}/share/sgml"
system "make", "pkgdatadir=#{share}/sgml/opensp", "install" system "make", "pkgdatadir=#{share}/sgml/opensp", "install"
end end
test do
(testpath/"eg.sgml").write <<-EOS.undent
<!DOCTYPE TESTDOC [
<!ELEMENT TESTDOC - - (TESTELEMENT)+>
<!ELEMENT TESTELEMENT - - (#PCDATA)>
]>
<TESTDOC>
<TESTELEMENT>Hello</TESTELEMENT>
</TESTDOC>
EOS
system "#{bin}/onsgmls", "--warning=type-valid", "eg.sgml"
end
end end