[PATCH libX11 2/2] specs: build compose keys tables in specs/i18n/compose

Gaetan Nadon memsize at videotron.ca
Sun Jul 17 09:01:12 PDT 2011


Build the tables article together with the rest of the specs.
Make it transparent that the source in generated in nls.
Reuse docbook.am and get all the features such as olink.

The docbook article file stem and id must be the same. The new name
for the main article is libX11-keys. The new installation location
is $docdir/libX11/i18n/compose.

The nls dir retains the role of generating the DocBook/XML source
but does not build neither installs output formats or generated source.

The tables article now has to specify that each included locale
section is a dependency. It did not matter before as they were web links.

The xorg-sgml-doctools masterdb shall be updated to include this new doc.
Install location moved from doc/libX11/Compose to doc/libX11/i18n/compose.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am                                  |    1 +
 configure.ac                                 |   15 ++++
 docbook.am                                   |   34 +++++----
 nls/Makefile.am                              |   99 +-------------------------
 nls/xmlrules.in                              |   59 ---------------
 specs/i18n/Makefile.am                       |    2 +-
 specs/i18n/compose/Makefile.am               |   28 +++++++
 {nls => specs/i18n/compose}/compose-chart.pl |    2 +-
 8 files changed, 68 insertions(+), 172 deletions(-)
 delete mode 100644 nls/xmlrules.in
 create mode 100644 specs/i18n/compose/Makefile.am
 rename {nls => specs/i18n/compose}/compose-chart.pl (99%)

diff --git a/Makefile.am b/Makefile.am
index 49c32bf..39e4bd9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,7 @@ ORDER=src modules
 else
 ORDER=modules src
 endif
+# Order: nls before specs
 SUBDIRS=include $(ORDER) nls man specs
 
 ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index a449ba8..9eafeaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -421,6 +421,20 @@ X11_LOCALEDIR="${X11_LOCALEDATADIR}"
 AX_DEFINE_DIR(XLOCALEDIR, X11_LOCALEDIR, [Location of libX11 locale data])
 AC_SUBST(X11_LOCALEDIR)
 
+locales="\
+ am_ET.UTF-8  armscii-8   C           el_GR.UTF-8  en_US.UTF-8  fi_FI.UTF-8 \
+ georgian-academy         georgian-ps ibm-cp1133   iscii-dev    isiri-3342 \
+ iso8859-1    iso8859-10  iso8859-11  iso8859-13   iso8859-14   iso8859-15 \
+ iso8859-2    iso8859-3   iso8859-4   iso8859-5    iso8859-6    iso8859-7 \
+ iso8859-8    iso8859-9   iso8859-9e  ja           ja.JIS       ja_JP.UTF-8\
+ ja.S90       ja.SJIS     ja.U90      ko           koi8-c       koi8-r \
+ koi8-u       ko_KR.UTF-8 microsoft-cp1251         microsoft-cp1255 \
+ microsoft-cp1256         mulelao-1   nokhchi-1    pt_BR.UTF-8  ru_RU.UTF-8 \
+ tatar-cyr    th_TH       th_TH.UTF-8 tscii-0      vi_VN.tcvn   vi_VN.viscii \
+ zh_CN        zh_CN.gb18030           zh_CN.gbk    zh_CN.UTF-8  zh_HK.big5 \
+ zh_HK.big5hkscs          zh_HK.UTF-8 zh_TW        zh_TW.big5   zh_TW.UTF-8"
+AC_SUBST(locales)
+
 XKEYSYMDB="${X11_DATADIR}/XKeysymDB"
 AX_DEFINE_DIR(XKEYSYMDB, XKEYSYMDB, [Location of keysym database])
 
@@ -451,6 +465,7 @@ AC_CONFIG_FILES([Makefile
 		nls/Makefile
 		specs/Makefile
 		specs/i18n/Makefile
+		specs/i18n/compose/Makefile
 		specs/i18n/framework/Makefile
 		specs/i18n/localedb/Makefile
 		specs/i18n/trans/Makefile
diff --git a/docbook.am b/docbook.am
index 2ffb7e6..fc1a694 100644
--- a/docbook.am
+++ b/docbook.am
@@ -3,8 +3,10 @@
 #
 # Variables set by the calling Makefile:
 # shelfdir: the location where the docs/specs are installed. Typically $(docdir)
-# docbook:  the main DocBook/XML file, no chapters, appendix or image files
-# chapters: all files pulled in by an XInclude statement and images.
+# docbook:  the git stored main DocBook/XML file, no chapters, appendix or image files
+# chapters: all git stored files pulled in by an XInclude statement and images.
+# gen_docbook: set this variable when DocBook/XML source is generated and not stored in git
+# gen_chapters: set this variable when XInclude source is generated and not stored in git
 #
 
 #
@@ -14,10 +16,10 @@
 # for an explanation on documents classification.
 #
 
-# DocBook/XML generated output formats to be installed
-shelf_DATA =
+# DocBook/XML generated source and generated output formats to be installed
+shelf_DATA = $(gen_chapters) $(gen_docbook)
 
-# DocBook/XML file with chapters, appendix and images it includes
+# Any in-git docbook, article, appendix or section source xml and images
 dist_shelf_DATA = $(docbook) $(chapters)
 
 if HAVE_XMLTO
@@ -45,21 +47,22 @@ XMLTO_FO_FLAGS = \
 	-x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
 endif HAVE_STYLESHEETS
 
-shelf_DATA += $(docbook:.xml=.html)
-%.html: %.xml  $(chapters)
+shelf_DATA += $(docbook:.xml=.html) $(gen_docbook:.xml=.html)
+%.html: %.xml  $(chapters) $(gen_chapters)
 	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $<
 
 if HAVE_FOP
-shelf_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
-%.pdf: %.xml $(chapters)
+shelf_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps) \
+	$(gen_docbook:.xml=.pdf) $(gen_docbook:.xml=.ps)
+%.pdf: %.xml $(chapters) $(gen_chapters)
 	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $<
-%.ps: %.xml $(chapters)
+%.ps: %.xml $(chapters) $(gen_chapters)
 	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $<
 endif HAVE_FOP
 
 if HAVE_XMLTO_TEXT
-shelf_DATA += $(docbook:.xml=.txt)
-%.txt: %.xml $(chapters)
+shelf_DATA += $(docbook:.xml=.txt) $(gen_docbook:.xml=.txt)
+%.txt: %.xml $(chapters) $(gen_chapters)
 	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $<
 endif HAVE_XMLTO_TEXT
 
@@ -72,7 +75,8 @@ if HAVE_STYLESHEETS
 if HAVE_XSLTPROC
 
 # DocBook/XML generated document cross-reference database
-shelf_DATA += $(docbook:.xml=.html.db) $(docbook:.xml=.fo.db)
+shelf_DATA += $(docbook:.xml=.html.db) $(docbook:.xml=.fo.db) \
+	$(gen_docbook:.xml=.html.db) $(gen_docbook:.xml=.fo.db)
 
 # Generate DocBook/XML document cross-reference database
 # Flags for the XSL Transformation processor generating xref target databases
@@ -82,11 +86,11 @@ XSLTPROC_FLAGS =					\
 	--stringparam collect.xref.targets "only"	\
 	--nonet --xinclude
 
-%.html.db: %.xml  $(chapters)
+%.html.db: %.xml  $(chapters) $(gen_chapters)
 	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \
 	http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl $<
 
-%.fo.db: %.xml $(chapters)
+%.fo.db: %.xml $(chapters) $(gen_chapters)
 	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \
 	http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $<
 
diff --git a/nls/Makefile.am b/nls/Makefile.am
index 94019a7..7dc4308 100644
--- a/nls/Makefile.am
+++ b/nls/Makefile.am
@@ -1,14 +1,10 @@
 
 x11localedir = $(X11_LOCALEDATADIR)
-specdir = $(docdir)/Compose
 CLEANFILES =
-XMLTO_FLAGS =
 SUFFIXES =
 
-include $(top_srcdir)/nls/xmlrules.in
-
 EXTRA_DIST = locale.alias.pre compose.dir.pre locale.dir.pre \
-	compose-check.pl compose-chart.pl
+	compose-check.pl
 
 x11locale_DATA = locale.alias locale.dir compose.dir
 
@@ -18,68 +14,6 @@ CLEANFILES += \
 	locale.dir locale.dir.l1 locale.dir.l2 \
 	XLC_LOCALE
 
-locales = \
-	am_ET.UTF-8		\
-	armscii-8		\
-	C			\
-	el_GR.UTF-8		\
-	en_US.UTF-8		\
-	fi_FI.UTF-8		\
-	georgian-academy	\
-	georgian-ps		\
-	ibm-cp1133		\
-	iscii-dev		\
-	isiri-3342		\
-	iso8859-1		\
-	iso8859-10		\
-	iso8859-11		\
-	iso8859-13		\
-	iso8859-14		\
-	iso8859-15		\
-	iso8859-2		\
-	iso8859-3		\
-	iso8859-4		\
-	iso8859-5		\
-	iso8859-6		\
-	iso8859-7		\
-	iso8859-8		\
-	iso8859-9		\
-	iso8859-9e		\
-	ja			\
-	ja.JIS			\
-	ja_JP.UTF-8		\
-	ja.S90			\
-	ja.SJIS			\
-	ja.U90			\
-	ko			\
-	koi8-c			\
-	koi8-r			\
-	koi8-u			\
-	ko_KR.UTF-8		\
-	microsoft-cp1251	\
-	microsoft-cp1255	\
-	microsoft-cp1256	\
-	mulelao-1		\
-	nokhchi-1		\
-	pt_BR.UTF-8		\
-	ru_RU.UTF-8		\
-	tatar-cyr		\
-	th_TH			\
-	th_TH.UTF-8		\
-	tscii-0			\
-	vi_VN.tcvn		\
-	vi_VN.viscii		\
-	zh_CN			\
-	zh_CN.gb18030		\
-	zh_CN.gbk		\
-	zh_CN.UTF-8		\
-	zh_HK.big5		\
-	zh_HK.big5hkscs		\
-	zh_HK.UTF-8		\
-	zh_TW			\
-	zh_TW.big5		\
-	zh_TW.UTF-8
-
 include $(top_srcdir)/cpprules.in
 
 # Global data files
@@ -103,16 +37,8 @@ locale.dir: locale.dir.pre
 	cat locale.dir.l2 locale.dir.l1 > locale.dir
 
 if HAVE_PERL
-doc_sources = Compose/index.xml
-
-Compose/index.xml:
-	@$(MKDIR_P) $(@D)
-	$(AM_V_GEN)$(PERL) $(srcdir)/compose-chart.pl \
-	 --index --output="$@" $(locales)
-
-clean-local: clean-Compose-dir
-clean-Compose-dir:
-	-rm -rf Compose
+TESTS_ENVIRONMENT = $(PERL)
+TESTS = $(srcdir)/compose-check.pl
 endif HAVE_PERL
 
 
@@ -124,22 +50,3 @@ nobase_x11locale_DATA = $(locales:%=%/XLC_LOCALE) $(locales:%=%/Compose)
 EXTRA_DIST += $(nobase_x11locale_DATA:%=%.pre)
 CLEANFILES += $(nobase_x11locale_DATA)
 
-if HAVE_PERL
-TESTS_ENVIRONMENT = $(PERL)
-TESTS = $(srcdir)/compose-check.pl
-
-COMPOSE_CHARTS = $(locales:%=%/Compose.xml)
-nodist_noinst_DATA = $(locales:%=Compose/%.xml)
-CLEANFILES += $(COMPOSE_CHARTS) $(doc_sources)
-
-XMLTO_FLAGS += -o $(@D)
-
-%/Compose.xml: %/Compose
-	$(AM_V_GEN)$(PERL) $(srcdir)/compose-chart.pl \
-	 --locale="$(@D)" --output="$@" $<
-
-Compose/%.xml: %/Compose.xml
-	@$(MKDIR_P) $(@D)
-	$(AM_V_GEN)cp $< $@
-
-endif HAVE_PERL
diff --git a/nls/xmlrules.in b/nls/xmlrules.in
deleted file mode 100644
index 5a6be24..0000000
--- a/nls/xmlrules.in
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# 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.
-#
-
-if HAVE_XMLTO
-spec_DATA = $(doc_sources:.xml=.html)
-
-if HAVE_FOP
-spec_DATA += $(doc_sources:.xml=.ps) $(doc_sources:.xml=.pdf)
-endif
-
-if HAVE_XMLTO_TEXT
-spec_DATA += $(doc_sources:.xml=.txt)
-endif
-
-if HAVE_STYLESHEETS
-XMLTO_FLAGS += 			\
-	-m $(XSL_STYLESHEET)	\
-	--stringparam img.src.path=$(abs_builddir)/	\
-	--stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
-endif
-
-CLEANFILES += $(spec_DATA)
-
-%.txt: %.xml $(dist_spec_DATA)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $<
-
-%.html: %.xml $(dist_spec_DATA)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $<
-
-%.pdf: %.xml $(dist_spec_DATA)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $<
-
-%.ps: %.xml $(dist_spec_DATA)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop ps $<
-
-chunked-html: $(doc_sources)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) -o html xhtml $(doc_sources)
-
-endif HAVE_XMLTO
diff --git a/specs/i18n/Makefile.am b/specs/i18n/Makefile.am
index 019d56a..a69a51e 100644
--- a/specs/i18n/Makefile.am
+++ b/specs/i18n/Makefile.am
@@ -21,4 +21,4 @@
 # DEALINGS IN THE SOFTWARE.
 #
 
-SUBDIRS=framework localedb trans
+SUBDIRS=compose framework localedb trans
diff --git a/specs/i18n/compose/Makefile.am b/specs/i18n/compose/Makefile.am
new file mode 100644
index 0000000..99b9a4b
--- /dev/null
+++ b/specs/i18n/compose/Makefile.am
@@ -0,0 +1,28 @@
+if ENABLE_SPECS
+if HAVE_PERL
+
+# Main DocBook/XML files (DOCTYPE book)
+gen_docbook = libX11-keys.xml
+
+# Included chapters, appendix, images
+gen_chapters = $(locales:%=%.xml)
+
+# The location where the DocBook/XML generated formats are installed
+shelfdir = $(docdir)/i18n/compose
+
+# Generate DocBook/XML output formats with or without stylesheets
+include $(top_srcdir)/docbook.am
+
+# Generated DocBook/XML source files using a perl script
+%.xml: $(top_builddir)/nls/%/Compose
+	$(AM_V_GEN)$(PERL) $(srcdir)/compose-chart.pl \
+	 --locale="$(@:.xml=)" --output="$@" $<
+
+libX11-keys.xml: $(locales:%=%.xml)
+	$(AM_V_GEN)$(PERL) $(srcdir)/compose-chart.pl \
+	 --index --output="$@" $(locales)
+
+endif HAVE_PERL
+endif ENABLE_SPECS
+
+EXTRA_DIST =  compose-chart.pl
diff --git a/nls/compose-chart.pl b/specs/i18n/compose/compose-chart.pl
similarity index 99%
rename from nls/compose-chart.pl
rename to specs/i18n/compose/compose-chart.pl
index 053c860..e2ac850 100755
--- a/nls/compose-chart.pl
+++ b/specs/i18n/compose/compose-chart.pl
@@ -82,7 +82,7 @@ if ($make_index) {
 	    qq(<?xml version="1.0" encoding="$charset" ?>),
 	    q(<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"),
 	    q( "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">),
-	    q(<article id="compose-index">),
+	    q(<article id="libX11-keys">),
 	    q(  <articleinfo>),
 	    q(    <title>Xlib Compose Key Charts</title>),
 	    q(  </articleinfo>),
-- 
1.7.4.1



More information about the xorg-devel mailing list