From 5816573f7b51ed5b6b84e3c0c71dd5243483edaa Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 16 Feb 2006 10:43:15 +0000 Subject: [PATCH] New --- etc/.cvsignore | 4 ++++ etc/Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ etc/gfs-config.rnc | 40 ++++++++++++++++++++++++++++++++++++++++ etc/gfs-example.xml | 32 ++++++++++++++++++++++++++++++++ etc/gfs-itunes.xml | 37 +++++++++++++++++++++++++++++++++++++ etc/gfs-minimal.xml | 8 ++++++++ 6 files changed, 165 insertions(+) create mode 100644 etc/.cvsignore create mode 100644 etc/Makefile create mode 100644 etc/gfs-config.rnc create mode 100644 etc/gfs-example.xml create mode 100644 etc/gfs-itunes.xml create mode 100644 etc/gfs-minimal.xml diff --git a/etc/.cvsignore b/etc/.cvsignore new file mode 100644 index 0000000..4c42229 --- /dev/null +++ b/etc/.cvsignore @@ -0,0 +1,4 @@ +gfs-config.rng +gfs-config.xsd +explain.xsd +gfs-config.dtd diff --git a/etc/Makefile b/etc/Makefile new file mode 100644 index 0000000..0c2df91 --- /dev/null +++ b/etc/Makefile @@ -0,0 +1,44 @@ +# $Id: Makefile,v 1.1 2006-02-16 10:43:15 mike Exp $ + +# This doesn't actually build anything, it just tests whether the +# configuration files here correspond with the schema. The master +# schema is in Relax-NG Compact (.rnc) format: this cannot be used +# directly as xmllint does not support it; but from this, we generate +# schemas expressed in Relax-NG XML (.rng), XML Schema (.xsd) and XML +# DTD (.dtd), each of which is then tested. + +test: test-rng test-xsd test-dtd + +test-rng: test-rng-example test-rng-itunes test-rng-minimal +test-rng-%: gfs-%.xml gfs-config.rng + xmllint --noout --relaxng gfs-config.rng $< + +test-xsd: test-xsd-example test-xsd-itunes test-xsd-minimal +test-xsd-%: gfs-%.xml gfs-config.xsd + xmllint --noout --schema gfs-config.xsd $< + +test-dtd: + @echo "# DTD testing skipped due to lack of namespace support" +#test-dtd: test-dtd-example test-dtd-itunes test-dtd-minimal +test-dtd-%: gfs-%.xml gfs-config.dtd + xmllint --noout --dtdvalid gfs-config.dtd $< + +gfs-config.rng: gfs-config.rnc + rm -f $@ + trang $? $@ + chmod ugo-w $@ + +# Trang generates "explain.xsd" as a side-effect +gfs-config.xsd: gfs-config.rnc + rm -f $@ explain.xsd + trang $? $@ + chmod ugo-w $@ explain.xsd + +gfs-config.dtd: gfs-config.rnc + rm -f $@ + trang $? $@ + chmod ugo-w $@ + +clean: + rm -f gfs-config.rng gfs-config.xsd explain.xsd gfs-config.dtd + diff --git a/etc/gfs-config.rnc b/etc/gfs-config.rnc new file mode 100644 index 0000000..612ad76 --- /dev/null +++ b/etc/gfs-config.rnc @@ -0,0 +1,40 @@ +# $Id: gfs-config.rnc,v 1.1 2006-02-16 10:43:15 mike Exp $ + +namespace explain = "http://explain.z3950.org/dtd/2.0/" +namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" + +yazgfs = element yazgfs { attlist.yazgfs, listen*, server+ } +attlist.yazgfs &= empty +listen = element listen { attlist.listen, text } +attlist.listen &= attribute id { text }? +server = + element server { + attlist.server, host?, directory?, config?, cql2rpn?, explain? + } +attlist.server &= + attribute id { text }?, + attribute listenref { text }? +host = element host { attlist.host, text } +attlist.host &= empty +directory = element directory { attlist.directory, text } +attlist.directory &= empty +config = element config { attlist.config, text } +attlist.config &= empty +cql2rpn = element cql2rpn { attlist.cql2rpn, text } +attlist.cql2rpn &= empty +# It's a shame that we have to include a partial ZeeRex DTD here +explain = element explain:explain { attlist.explain, serverInfo? } +attlist.explain &= + [ a:defaultValue = "false" ] + attribute authoritative { "true" | "false" }?, + attribute id { text }? +serverInfo = + element explain:serverInfo { attlist.serverInfo, explainHost, port, database } +attlist.serverInfo &= empty +explainHost = element explain:host { attlist.explainHost, text } +attlist.explainHost &= empty +port = element explain:port { attlist.port, text } +attlist.port &= empty +database = element explain:database { attlist.database, text } +attlist.database &= empty +start = yazgfs diff --git a/etc/gfs-example.xml b/etc/gfs-example.xml new file mode 100644 index 0000000..ef4a5bc --- /dev/null +++ b/etc/gfs-example.xml @@ -0,0 +1,32 @@ + + + + tcp:@:9900 + unix:/var/tmp/socket + + server1.mydomain + /var/www/s1 + config.cfg + + + server2.mydomain + /var/www/s2 + config.cfg + ../etc/pqf.properties + + + server2.mydomain + 9900 + a + + + + + /var/www/s3 + config.cfg + + diff --git a/etc/gfs-itunes.xml b/etc/gfs-itunes.xml new file mode 100644 index 0000000..edad1ec --- /dev/null +++ b/etc/gfs-itunes.xml @@ -0,0 +1,37 @@ + + + + + + tcp:@:1234 + + + + + + ./ + + + db/zebra.cfg + + + + db/cql2pqf.txt + + + + + localhost + 1234 + k2-oai + + + + + + diff --git a/etc/gfs-minimal.xml b/etc/gfs-minimal.xml new file mode 100644 index 0000000..6dcb52d --- /dev/null +++ b/etc/gfs-minimal.xml @@ -0,0 +1,8 @@ + + + + + zebra.cfg + ../tab/pqf.properties + + -- 1.7.10.4