summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-02-20 10:56:10 +0100
committerHarald Welte <laforge@gnumonks.org>2016-02-20 15:01:50 +0100
commit37ba7a9825c893563c98481681209de3ad6c9ec7 (patch)
tree6bfc9bcfcad07f22dda6402190b4df750214c859 /build
initial checkin of manuals to public repo
The manuals existed in different form for several years in an internal sysmocom repository. However, since they had just recently been converted from docboox-xml to asciidoc and all files have been re-shuffled for enabling the public release, there's not much point in keeping the history with git-filter-branch.
Diffstat (limited to 'build')
-rw-r--r--build/Makefile.asciidoc.inc17
-rw-r--r--build/Makefile.inc47
-rw-r--r--build/custom-dblatex.sty77
-rw-r--r--build/diag-filter.conf76
-rwxr-xr-xbuild/filter-wrapper.py12
-rw-r--r--build/mscgen-filter.conf22
6 files changed, 251 insertions, 0 deletions
diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc
new file mode 100644
index 0000000..73fa981
--- /dev/null
+++ b/build/Makefile.asciidoc.inc
@@ -0,0 +1,17 @@
+BUILDDIR = $(TOPDIR)/build
+
+# prepend the document name with the version numbe suffix
+#DOCS_VER = $(foreach P, $(ASCIIDOCS), $(P)-v$(shell xmllint --recover --xpath "//revnumber[position()=last()]/text()" $(P)-docinfo.xml 2>/dev/null))
+#PDFS = $(DOCS_VER:%=%.pdf)
+
+# generate list of PDFs that we're supposed to render
+ASCIIDOCPDFS = $(ASCIIDOCS:%=%.pdf)
+
+ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty
+
+cleanfiles += $(ASCIIDOCPDFS)
+
+all: $(ASCIIDOCPDFS)
+
+$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc
+ a2x -L --asciidoc-opts="-f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf" --dblatex-opts=" -s $(ASCIIDOCSTYLE)" -a docinfo $< || asciidoc -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf $<
diff --git a/build/Makefile.inc b/build/Makefile.inc
new file mode 100644
index 0000000..1c55304
--- /dev/null
+++ b/build/Makefile.inc
@@ -0,0 +1,47 @@
+# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/
+# Makefile from BitBake/OpenEmbedded manuals
+
+LIBOSMO_DIR := ~/source/gsm/libosmocore
+MERGE_DOC := $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl
+UPLOAD_PATH := generic@sysmocom-downloads:documents
+
+pdfs = $(patsubst %.xml,%.pdf,$(manuals))
+lint = $(patsubst %.xml,%.xml-lint,$(manuals))
+
+#cleanfiles = $(foreach i,$(types),$(topdir)/$(i))
+cleanfiles += $(pdfs) $(lint)
+
+ifdef DEBUG
+dblatex_quiet =
+define command
+ $(1)
+endef
+else
+dblatex_quiet = -q
+define command
+ @echo $(2) $(3)
+ @$(1)
+endef
+endif
+
+all: $(types)
+
+
+$(types): FORCE
+
+
+pdf: $(pdfs) $(manuals)
+
+
+# Lint the file
+%.xml-lint: %.xml FORCE
+ $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<)
+
+# Create a PDF file and lint it before
+%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE
+ $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<)
+
+upload: $(pdfs)
+ rsync -avz $(pdfs) $(UPLOAD_PATH)/
+
+FORCE:
diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty
new file mode 100644
index 0000000..80c1d5f
--- /dev/null
+++ b/build/custom-dblatex.sty
@@ -0,0 +1,77 @@
+%%
+%% This style is derived from the docbook one.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style]
+%% Just use the original package and pass the options.
+\RequirePackageWithOptions{docbook}
+
+% Sidebar is a boxed minipage that can contain verbatim.
+% Changed shadow box to double box.
+\renewenvironment{sidebar}[1][0.95\textwidth]{
+ \hspace{0mm}\newline%
+ \noindent\begin{Sbox}\begin{minipage}{#1}%
+ \setlength\parskip{\medskipamount}%
+}{
+ \end{minipage}\end{Sbox}\doublebox{\TheSbox}%
+}
+
+\usepackage{alltt}
+\usepackage{upquote}
+
+\def\Company{sysmocom - s.f.m.c. GmbH}
+
+\def\DBKcover{
+\ifthenelse{\equal{\DBKedition}{}}{\def\edhead{}}{\def\edhead{Ed. \DBKedition}}
+
+% interligne double
+\setlength{\oldbaselineskip}{\baselineskip}
+\setlength{\baselineskip}{2\oldbaselineskip}
+\textsf{
+\vfill
+\begin{center}
+ \includegraphics{../common/images/sysmocom.pdf}
+ \ \\ %
+ \huge{\Company}
+\end{center}
+\vspace{2.5cm}
+\begin{center}
+ \includegraphics{../common/images/osmocom.pdf}
+ \ \\ %
+ \vspace{0.5cm}
+ \huge{\textbf{\DBKtitle}}\\ %
+ \ifx\DBKsubtitle\relax\else%
+ \underline{\ \ \ \ \ \ \ \ \ \ \ }\\ %
+ \ \\ %
+ \huge{\textbf{\DBKsubtitle}}\\ %
+ \fi
+ \vspace*{2.5cm}
+ \large{by \DBKauthor}
+\end{center}
+\vfill
+\setlength{\baselineskip}{\oldbaselineskip}
+\hspace{1cm}
+\vspace{1cm}
+\begin{center}
+\begin{tabular}{p{7cm} p{7cm}}
+\Large{\DBKreference{} \edhead} & \\
+\end{tabular}
+\end{center}
+}
+
+% Format for the other pages
+%\newpage
+\setlength{\baselineskip}{\oldbaselineskip}
+}
+
+% left footer
+\def\DBKpublisher{}
+
+\def\maketitle{
+ \DBKcover
+ \DBKcopyright
+ \DBKlegalblock
+ \newpage
+ \lfoot[]{\DBKcopyright}
+ \DBKdomitete
+}
diff --git a/build/diag-filter.conf b/build/diag-filter.conf
new file mode 100644
index 0000000..d3d62ab
--- /dev/null
+++ b/build/diag-filter.conf
@@ -0,0 +1,76 @@
+#
+# AsciiDoc seqdiag/blockdiag/nwdiag/packetdiag/actdiag filter configuration file.
+#
+
+[seqdiag-filter-style]
+seqdiag-style=template="seqdiag-block",subs=(),posattrs=("style","target"),filter='seqdiag -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?svg}} - && echo " "'
+
+[blockdef-listing]
+template::[seqdiag-filter-style]
+
+[paradef-default]
+template::[seqdiag-filter-style]
+
+[seqdiag-block]
+template::[filter-image-pngsvg-blockmacro]
+
+[filter-image-pngsvg-blockmacro]
+{target%}{counter2:target-number}
+{target%}{set2:target:{docname}__{target-number}.{format={basebackend-docbook!png}{basebackend-docbook?svg}}}
+|
+template::[image-blockmacro]
+
+[blockdiag-filter-style]
+blockdiag-style=template="blockdiag-block",subs=(),posattrs=("style","target"),filter='blockdiag -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?svg}} - && echo " "'
+
+[blockdef-listing]
+template::[blockdiag-filter-style]
+
+[paradef-default]
+template::[blockdiag-filter-style]
+
+[blockdiag-block]
+template::[filter-image-pngsvg-blockmacro]
+
+
+
+[actdiag-filter-style]
+actdiag-style=template="actdiag-block",subs=(),posattrs=("style","target"),filter='actdiag -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?svg}} - && echo " "'
+
+[blockdef-listing]
+template::[actdiag-filter-style]
+
+[paradef-default]
+template::[actdiag-filter-style]
+
+[actdiag-block]
+template::[filter-image-pngsvg-blockmacro]
+
+
+
+[nwdiag-filter-style]
+nwdiag-style=template="nwdiag-block",subs=(),posattrs=("style","target"),filter='nwdiag -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?svg}} - && echo " "'
+
+[blockdef-listing]
+template::[nwdiag-filter-style]
+
+[paradef-default]
+template::[nwdiag-filter-style]
+
+[nwdiag-block]
+template::[filter-image-pngsvg-blockmacro]
+
+
+[packetdiag-filter-style]
+packetdiag-style=template="packetdiag-block",subs=(),posattrs=("style","target"),filter='packetdiag -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?svg}} - && echo " "'
+
+[blockdef-listing]
+template::[packetdiag-filter-style]
+
+[paradef-default]
+template::[packetdiag-filter-style]
+
+[packetdiag-block]
+template::[filter-image-pngsvg-blockmacro]
+
+
diff --git a/build/filter-wrapper.py b/build/filter-wrapper.py
new file mode 100755
index 0000000..82fec1b
--- /dev/null
+++ b/build/filter-wrapper.py
@@ -0,0 +1,12 @@
+#! /usr/bin/env python
+"""Simple wrapper for filter programs which ensures that a blank
+is returned as output. The purpose is to silence the
+AsciiDoc warning "no output from filter".
+"""
+
+import sys, subprocess
+
+p = subprocess.Popen(sys.argv[1:])
+sys.stdout.write(' ') # To suppress asciidoc 'no output from filter' warnings.
+sys.exit(p.wait())
+
diff --git a/build/mscgen-filter.conf b/build/mscgen-filter.conf
new file mode 100644
index 0000000..698d76a
--- /dev/null
+++ b/build/mscgen-filter.conf
@@ -0,0 +1,22 @@
+#
+# AsciiDoc mscgen filter configuration file.
+#
+
+[mscgen-filter-style]
+mscgen-style=template="mscgen-block",subs=(),posattrs=("style","target"),filter='../build/filter-wrapper.py mscgen -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?svg}} -'
+
+[blockdef-listing]
+template::[mscgen-filter-style]
+
+[paradef-default]
+template::[mscgen-filter-style]
+
+[mscgen-block]
+template::[filter-image-pngsvg-blockmacro]
+
+[filter-image-pngsvg-blockmacro]
+{target%}{counter2:target-number}
+{target%}{set2:target:{docname}__{target-number}.{format={basebackend-docbook!png}{basebackend-docbook?svg}}}
+|
+template::[image-blockmacro]
+