From bbae053ca8bce46639f74f88dc9f687fe53e7c86 Mon Sep 17 00:00:00 2001 From: Gaetan Nadon Date: Thu, 17 Jun 2010 14:45:14 -0400 Subject: specs: translate, format, process, install and distribute. Makefile copied from libSM. Signed-off-by: Gaetan Nadon --- configure.ac | 2 + specs/.gitignore | 8 ++ specs/Makefile.am | 80 ++++++++++++++++++- specs/macros.t | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 315 insertions(+), 1 deletion(-) create mode 100644 specs/.gitignore create mode 100644 specs/macros.t diff --git a/configure.ac b/configure.ac index ded41dd..08ec061 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,9 @@ m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.6 or later before running autoconf/autogen])]) XORG_MACROS_VERSION(1.6) XORG_DEFAULT_OPTIONS +XORG_ENABLE_SPECS XORG_WITH_XMLTO(0.0.20) +XORG_WITH_GROFF AM_CONFIG_HEADER(config.h) # Check for progs diff --git a/specs/.gitignore b/specs/.gitignore new file mode 100644 index 0000000..84d7456 --- /dev/null +++ b/specs/.gitignore @@ -0,0 +1,8 @@ +# Add & Override for this directory and it's subdirectories +*.html +*.ps +*.txt +*.html.raw +*.ps.raw +*.txt.raw +/images diff --git a/specs/Makefile.am b/specs/Makefile.am index a7e4709..74669fd 100644 --- a/specs/Makefile.am +++ b/specs/Makefile.am @@ -1 +1,79 @@ -EXTRA_DIST = recordlib.ms xtestlib.ms +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +EXTRA_DIST = macros.t recordlib.ms xtestlib.ms + +if ENABLE_SPECS +if HAVE_GROFF_MS +doc_DATA = recordlib.txt recordlib.ps recordlib.html xtestlib.txt xtestlib.ps xtestlib.html +imagesdir = $(docdir)/images + +CLEANFILES = $(doc_DATA) +MOSTLYCLEANFILES = index.* + +install-data-local: + test -z "$(imagesdir)" || $(mkdir_p) "$(DESTDIR)$(imagesdir)" + @d="$(srcdir)/images/"; \ + list=`ls $$d`; \ + for p in $$list; do \ + echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(imagesdir)/$$p'"; \ + $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(imagesdir)/$$p"; \ + done; + +uninstall-local: + @if test -n $(DESTDIR)$(imagesdir); then \ + if test -d $(DESTDIR)$(imagesdir); then \ + list=`ls $(DESTDIR)$(imagesdir)`; \ + for p in $$list; do \ + echo " rm -f '$(DESTDIR)$(imagesdir)/$$p'"; \ + rm -f "$(DESTDIR)$(imagesdir)/$$p"; \ + done \ + fi; \ + fi; + +mostlyclean-local: + @rm -fr images + +# Pass version string as a troff string for substitution +GROFF_DEFS = -dxV="$(PACKAGE_STRING)" + +# -t to run through tbl +GROFF_FLAGS = -t -ms $(GROFF_DEFS) $(srcdir)/macros.t + +SUFFIXES = .ms .ps .txt .html + +.ms.ps: + -$(AM_V_GEN) $(GROFF) -Tps $(GROFF_FLAGS) $< 2> index.$@.raw > $@ + @if grep '^[^1-9.]' index.$@.raw | grep -v warning; then exit 1; \ + else test $$? -le 1; fi + +.ms.txt: + $(AM_V_GEN) env GROFF_NO_SGR=TRUE $(GROFF) -Tutf8 $(GROFF_FLAGS) \ + $< 2> index.$@.raw > $@ + +.ms.html: + $(AM_V_GEN) $(GROFF) -Thtml -P-Dimages -P-I$*-image $(GROFF_FLAGS) $< 2> index.$@.raw > $@ + +endif HAVE_GROFF_MS +endif ENABLE_SPECS + diff --git a/specs/macros.t b/specs/macros.t new file mode 100644 index 0000000..cbc599b --- /dev/null +++ b/specs/macros.t @@ -0,0 +1,226 @@ +.\" $Xorg: macros.t,v 1.3 2000/08/17 19:42:51 cpqbld Exp $ +.\" macros.t -- macros for X Consortium documents +.\" Revised and commented by smarks 93.12.20. +.\" +.\" global setup: set ragged right, assign string variables +.\" +.na +.ie n \{\ +.ds Q \&" +.ds U \&" +.ds - \%-- +.\} +.el \{\ +.ds Q `\h'-\w'\^'u'` +.ds U '\h'-\w'\^'u'' +.ds - \(em +.\} +.\" +.\" --- Ds --- displayed text (like .DS) with no keep +.\" .Ds is obsolete. Change to something from this table: +.\" for this use instead +.\" .Ds .ID +.\" .Ds n .LD (where "n" is a number) +.\" (Numbers don't work in these macros, so ".Ds 5" +.\" comes out the same as ".Ds 0".) +.\" +.de Ds +.nf +.\\$1D \\$2 \\$1 +.ft 1 +.ps \\n(PS +.if \\n(VS>=40 .vs \\n(VSu +.if \\n(VS<=39 .vs \\n(VSp +.. +.de D +.ID \\$1 +.. +.de 0D +.LD +.. +.\" backward compatibility for the Xt spec +.de 5D +.LD +.. +.\" +.\" --- De --- obsolete: use .DE instead +.\" +.de De +.DE +.. +.\" +.\" --- FD --- +.\" +.de FD +.LP +.KS +.TA .5i 3i +.ta .5i 3i +.nf +.. +.\" +.\" --- FN --- +.\" +.de FN +.fi +.KE +.LP +.. +.\" +.\" --- IN --- send an index entry to the stderr +.\" +.de IN +.tm \\n%:\\$1:\\$2:\\$3 +.. +.\" +.\" --- C{ --- +.\" +.de C{ +.KS +.nf +.D +.\" +.\" choose appropriate monospace font +.\" the imagen conditional, 480, +.\" may be changed to L if LB is too +.\" heavy for your eyes... +.\" +.ie "\\*(.T"480" .ft L +.el .ie "\\*(.T"300" .ft L +.el .ie "\\*(.T"202" .ft PO +.el .ie "\\*(.T"aps" .ft CW +.el .ft R +.ps \\n(PS +.ie \\n(VS>40 .vs \\n(VSu +.el .vs \\n(VSp +.. +.\" +.\" --- C} --- +.\" +.de C} +.DE +.R +.. +.\" +.\" --- Pn --- like PN, but use $2; $1 and $3 abut +.\" +.de Pn +.IN \\$2 +.ie t \\$1\fB\^\\$2\^\fR\\$3 +.el \\$1\fI\^\\$2\^\fP\\$3 +.. +.\" +.\" --- PN --- put $1 in boldface and add index entry; $2 abuts +.\" +.de PN +.IN \\$1 +.ie t \fB\^\\$1\^\fR\\$2 +.el \fI\^\\$1\^\fP\\$2 +.. +.\" +.\" --- hI --- add index entry for $1 as header file +.\" +.de hI +.IN <\\$1> +.IN Files <\\$1> +.IN Headers <\\$1> +.. +.\" +.\" --- hN --- put $1 in boldface as header and add index entry; $2 abuts +.\" +.de hN +.hI \\$1 +.ie t <\fB\\$1\fR>\\$2 +.el <\fI\\$1\fP>\\$2 +.. +.\" +.\" --- NT --- +.\" +.de NT +.br +.ne 7 +.ds NO Note +.if \\n(.$ .ds NO \\$1 +.ie n .sp +.el .sp 10p +.ce +\\*(NO +.ie n .sp +.el .sp 5p +.if '\\$1'C' .ce 99 +.if '\\$2'C' .ce 99 +.\" .QS/.QE macros don't exist in older versions of -ms +.ie \\n(GS .QS +.el \{\ +. in +5n +. ll -5n +.\} +.R +.. +.\" +.\" --- NE --- Note End (doug kraft 3/85) +.\" +.de NE +.ce 0 +.ie \\n(GS .QE +.el \{\ +. in -5n +. ll +5n +.\} +.ie n .sp +.el .sp 10p +.. +.\" +.\" --- nH --- numbered header (like NH) but with automatic TOC entry +.\" usage: .nH level "section title, preferable in quotes" +.\" +.de nH +.NH \\$1 +\\$2 +.XS +\\*(SN \\$2 +.XE +.. +.\" +.\" --- sM --- put start-marker in margin +.\" +.de sM +.KS +.sp 1 +\\h'-0.5i'\\L'-1v'\\v'1p'\\l'1v'\\v'1v-1p' +.sp -1 +.. +.\" +.\" --- eM --- put end-marker in margin +.\" +.de eM +.sp -1 +\\h'-0.5i'\\L'-1v'\\v'1v+1p'\\l'1v'\\v'-1p' +.sp 1 +.KE +.. +.\" +.\" --- YZ --- finish up; $1 is the starting page number of the TOC +.\" +.de YZ +. \" Force there to be an even number of pages, so the table of +. \" contents doesn't end up on the back of the last page in +. \" the case of duplex printing. +.if o .bp +. \" Emit a .pn directive with one plus the last page number. + \" This will be the number of the first page of the index. +.nr YZ \\n%+1 +.tm .pn \\n(YZ +. \" Issue the table of contents, setting roman numerals, +. \" and redefining the footer to use them. +.bp \\$1 +.af PN i +.EF ''\\\\\\\\n(PN'' +.OF ''\\\\\\\\n(PN'' +. \" Why all the backslashes? This string is evaluated +. \" three times: 1) during the definition of this macro, +. \" 2) when the .EF and .OF macros are expanded, and 3) +. \" when the bottom-of-page trap is invoked. Thus, +. \" eight backslashes are reduced to one in the final output. +.PX +.. -- cgit v1.2.1