Change in osmo-gsm-manuals[master]: *filter.conf/*.sty: use symlinks to build, common

osmith gerrit-no-reply at
Wed Nov 21 15:12:53 UTC 2018

osmith has submitted this change and it was merged. ( )

Change subject: *filter.conf/*.sty: use symlinks to build, common

*filter.conf/*.sty: use symlinks to build, common

$(OSMO_GSM_MANUALS_DIR) is used in most places to reference to the top
dir, which contains "build" and "common". But not in the asciidoc
mscgen filter configurations, and in the custom LaTeX style. They have
../common or ../build hardcoded, which won't work anymore when the
project specific files will be in another repository.

Update the Makefiles to create symlinks to "build" and "common" in the
dir where the build was started. Use ./common in the files that had
../common hardcoded, and do the same for ./build.

Update the comment to refer to common targets in
general, so we don't need to list each single one there (like the new
'common' and 'build' targets).

I've also thought about using variables there, but this would only work
for the asciidoc files, not for the .sty file. We would need to
generate the latter from another file and replace the variable
dynamically. Having the symlinks instead seemed to be slightly easier.

(moving manuals to project repositories 7/19)

Related: OS#3385
Change-Id: I4cfd1a9ef482d382f10cdf060e8e2cba81852864
M .gitignore
M build/
M build/
M build/
M build/custom-dblatex.sty
M build/mscgen-filter.conf
M build/python2-filter.conf
7 files changed, 25 insertions(+), 8 deletions(-)

  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Neels Hofmeyr: Looks good to me, approved

diff --git a/.gitignore b/.gitignore
index 30bc93e..b174bb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,7 @@
+# symlinks to shared dirs (needed for out-of-tree builds)
diff --git a/build/ b/build/
index 18cfa88..6b57c7d 100644
--- a/build/
+++ b/build/
@@ -54,7 +54,8 @@
 		$(OSMO_GSM_MANUALS_DIR)/common/*/*.adoc \
-		$(OSMO_GSM_MANUALS_DIR)/common/images/*
+		$(OSMO_GSM_MANUALS_DIR)/common/images/* \
+		build common
 	@test -n "$(BUILD_RELEASE)" && echo -e "\n\n\
 	  NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\
 	        and remove three lines starting with '% \"DRAFT\" on first page'\n" \
@@ -64,7 +65,11 @@
-$(ASCIIDOC_CHECKS): %.check: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(OSMO_GSM_MANUALS_DIR)/common/chapters/*.adoc $(ASCIIDOC_DEPS)
+$(ASCIIDOC_CHECKS): %.check: %.adoc %-docinfo.xml \
+		$(OSMO_GSM_MANUALS_DIR)/common/chapters/*.adoc \
+		build common
 	asciidoc -v $(ASCIIDOC_OPTS) $< > $@ 2>&1
 	# Make absolutely sure that the %.check target is updated.
 	touch $@
diff --git a/build/ b/build/
index 6a210bc..efd56f6 100644
--- a/build/
+++ b/build/
@@ -3,9 +3,14 @@
 # Other makefiles like and add
 # entries to UPLOAD_FILES and CLEAN_FILES.
-# Include this file at the end to have 'upload' and 'clean' targets.
+# Include this file at the end to have the common targets (upload, clean etc.).
 UPLOAD_PATH ?= generic at sysmocom-downloads:documents
+SYMLINKS = common build
+	ln -s $(OSMO_GSM_MANUALS_DIR)/$@ $@
 upload: $(UPLOAD_FILES)
 	rsync -avz $(UPLOAD_FILES) $(UPLOAD_PATH)/
diff --git a/build/ b/build/
index b69fcea..4d015a7 100644
--- a/build/
+++ b/build/
@@ -32,6 +32,6 @@
 	xmllint --xinclude --postvalid --noout $<
 # Create a PDF file and lint it before
-%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS)
+%.pdf: %.xml %.xml-lint $(DOCBOOKS_DEPS) build common
 	dblatex $(dblatex_quiet) -P draft.mode=no $<
diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty
index 606b9ab..16931ad 100644
--- a/build/custom-dblatex.sty
+++ b/build/custom-dblatex.sty
@@ -1,5 +1,6 @@
 %% This style is derived from the docbook one.
+%% "${OSMO_GSM_MANUALS_DIR}/common" is symlinked to ./common when building.
 \ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style]
@@ -40,13 +41,13 @@
-  \includegraphics{../common/images/sysmocom.pdf}
+  \includegraphics{./common/images/sysmocom.pdf}
   \ \\ %
-  \includegraphics{../common/images/osmocom.pdf}
+  \includegraphics{./common/images/osmocom.pdf}
   \ \\ %
   \huge{\textbf{\DBKtitle}}\\ %
diff --git a/build/mscgen-filter.conf b/build/mscgen-filter.conf
index ce3cb3f..fa8f03e 100644
--- a/build/mscgen-filter.conf
+++ b/build/mscgen-filter.conf
@@ -1,9 +1,10 @@
 # AsciiDoc mscgen filter configuration file.
+# ${OSMO_GSM_MANUALS}/build is symlinked to ./build when building.
-mscgen-style=template="mscgen-block",subs=(),posattrs=("style","target"),filter='../build/ mscgen -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?png}} -'
+mscgen-style=template="mscgen-block",subs=(),posattrs=("style","target"),filter='./build/ mscgen -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -T{format={basebackend-docbook!png}{basebackend-docbook?png}} -'
diff --git a/build/python2-filter.conf b/build/python2-filter.conf
index ca2ddaf..812c7c2 100644
--- a/build/python2-filter.conf
+++ b/build/python2-filter.conf
@@ -1,9 +1,10 @@
 # AsciiDoc mscgen filter configuration file.
+# ${OSMO_GSM_MANUALS}/build is symlinked to ./build when building.
-python2-style=template="python2-block",subs=(),posattrs=("style","target"),filter='../build/ python2 - --output="{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}"'
+python2-style=template="python2-block",subs=(),posattrs=("style","target"),filter='./build/ python2 - --output="{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}"'

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4cfd1a9ef482d382f10cdf060e8e2cba81852864
Gerrit-Change-Number: 11798
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at>
Gerrit-Reviewer: osmith <osmith at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list