build manuals moved here from osmo-gsm-manuals.git

Moved to doc/manuals/, with full commit history, in preceding merge commit.
Now incorporate in the build system.

Build with:

$ autoreconf -fi
$ ./configure --enable-manuals
$ make

Shared files from osmo-gsm-manuals.git are found automatically if
- the repository is checked out in ../osmo-gsm-manuals; or
- if it osmo-gsm-manuals was installed with "make install"; or
- OSMO_GSM_MANUALS_DIR is set.

Related: OS#3385
Change-Id: I7270652de393a98748c0cdc51e626c17ab8f44c2
This commit is contained in:
Oliver Smith 2018-11-14 10:47:01 +01:00 committed by Neels Hofmeyr
parent dfb08d31fe
commit 47aab58ec3
8 changed files with 97 additions and 31 deletions

11
.gitignore vendored
View File

@ -53,3 +53,14 @@ debian/osmo-pcu/
debian/tmp/
osmo-pcu.pc
# manuals
doc/manuals/*.html
doc/manuals/*.svg
doc/manuals/*.pdf
doc/manuals/*__*.png
doc/manuals/*.check
doc/manuals/generated/
doc/manuals/osmomsc-usermanual.xml
doc/manuals/common
doc/manuals/build

View File

@ -157,6 +157,48 @@ AM_CONDITIONAL(ENABLE_VTY_TESTS, test "x$enable_vty_tests" = "xyes")
STD_DEFINES_AND_INCLUDES="-Wall"
AC_SUBST(STD_DEFINES_AND_INCLUDES)
# Generate manuals
AC_ARG_ENABLE(manuals,
[AS_HELP_STRING(
[--enable-manuals],
[Generate manual PDFs [default=no]],
)],
[osmo_ac_build_manuals=$enableval], [osmo_ac_build_manuals="no"])
AM_CONDITIONAL([BUILD_MANUALS], [test x"$osmo_ac_build_manuals" = x"yes"])
AC_ARG_VAR(OSMO_GSM_MANUALS_DIR, [path to common osmo-gsm-manuals files, overriding pkg-config and "../osmo-gsm-manuals"
fallback])
if test x"$osmo_ac_build_manuals" = x"yes"
then
# Find OSMO_GSM_MANUALS_DIR (env, pkg-conf, fallback)
if test -n "$OSMO_GSM_MANUALS_DIR"; then
echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from env)"
else
OSMO_GSM_MANUALS_DIR="$($PKG_CONFIG osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null)"
if test -n "$OSMO_GSM_MANUALS_DIR"; then
echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from pkg-conf)"
else
OSMO_GSM_MANUALS_DIR="../osmo-gsm-manuals"
echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (fallback)"
fi
fi
if ! test -d "$OSMO_GSM_MANUALS_DIR"; then
AC_MSG_ERROR("OSMO_GSM_MANUALS_DIR does not exist! Install osmo-gsm-manuals or set OSMO_GSM_MANUALS_DIR.")
fi
# Find and run check-depends
CHECK_DEPENDS="$OSMO_GSM_MANUALS_DIR/check-depends.sh"
if ! test -x "$CHECK_DEPENDS"; then
CHECK_DEPENDS="osmo-gsm-manuals-check-depends"
fi
if ! $CHECK_DEPENDS; then
AC_MSG_ERROR("missing dependencies for --enable-manuals")
fi
# Put in Makefile with absolute path
OSMO_GSM_MANUALS_DIR="$(realpath "$OSMO_GSM_MANUALS_DIR")"
AC_SUBST([OSMO_GSM_MANUALS_DIR])
fi
# https://www.freedesktop.org/software/systemd/man/daemon.html
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
@ -185,6 +227,7 @@ AC_OUTPUT(
doc/Makefile
doc/examples/Makefile
tests/Makefile
doc/manuals/Makefile
contrib/Makefile
contrib/systemd/Makefile
Makefile)

View File

@ -1 +1,4 @@
SUBDIRS = examples
SUBDIRS = \
examples \
manuals \
$(NULL)

View File

@ -1,11 +0,0 @@
TOPDIR = ..
ASCIIDOC = osmopcu-usermanual.adoc osmopcu-gb.adoc
include $(TOPDIR)/build/Makefile.asciidoc.inc
osmopcu-gb.pdf: gb/*.adoc gb/*.msc
osmopcu-usermanual.pdf: chapters/*.adoc
VTY_REFERENCE = osmopcu-vty-reference.xml
include $(TOPDIR)/build/Makefile.vty-reference.inc
include $(TOPDIR)/build/Makefile.common.inc

20
doc/manuals/Makefile.am Normal file
View File

@ -0,0 +1,20 @@
EXTRA_DIST = osmopcu-gb.adoc \
osmopcu-gb-docinfo.xml \
osmopcu-usermanual.adoc \
osmopcu-usermanual-docinfo.xml \
osmopcu-vty-reference.xml \
chapters \
gb \
vty
if BUILD_MANUALS
ASCIIDOC = osmopcu-usermanual.adoc osmopcu-gb.adoc
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc
osmopcu-gb.pdf: $(srcdir)/gb/*.adoc $(srcdir)/gb/*.msc
osmopcu-usermanual.pdf: $(srcdir)/chapters/*.adoc
VTY_REFERENCE = osmopcu-vty-reference.xml
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc
endif

View File

@ -60,7 +60,7 @@ OsmoBSC or the BSC component inside OsmoNITB.
.Overview of Gb link establishment
["mscgen"]
----
include::gb/gb-startup.msc[]
include::{srcdir}/gb/gb-startup.msc[]
----
[[ident]]
@ -84,12 +84,12 @@ they connect to.
This means that typically each OsmoPCU has one unique set of NSEI,
NSVCI and BVCI in your network.
include::gb/ns.adoc[]
include::{srcdir}/gb/ns.adoc[]
include::gb/bssgp.adoc[]
include::{srcdir}/gb/bssgp.adoc[]
include::../common/chapters/port_numbers.adoc[]
include::./common/chapters/port_numbers.adoc[]
include::../common/chapters/glossary.adoc[]
include::./common/chapters/glossary.adoc[]
include::../common/chapters/gfdl.adoc[]
include::./common/chapters/gfdl.adoc[]

View File

@ -5,26 +5,26 @@ OsmoPCU User Manual
Harald Welte <hwelte@sysmocom.de>
include::../common/chapters/preface.adoc[]
include::./common/chapters/preface.adoc[]
include::chapters/overview.adoc[]
include::{srcdir}/chapters/overview.adoc[]
include::chapters/running.adoc[]
include::{srcdir}/chapters/running.adoc[]
include::../common/chapters/vty.adoc[]
include::./common/chapters/vty.adoc[]
include::../common/chapters/logging.adoc[]
include::./common/chapters/logging.adoc[]
include::chapters/configuration.adoc[]
include::{srcdir}/chapters/configuration.adoc[]
include::chapters/counters.adoc[]
include::{srcdir}/chapters/counters.adoc[]
include::../common/chapters/gb.adoc[]
include::./common/chapters/gb.adoc[]
include::../common/chapters/port_numbers.adoc[]
include::./common/chapters/port_numbers.adoc[]
include::../common/chapters/bibliography.adoc[]
include::./common/chapters/bibliography.adoc[]
include::../common/chapters/glossary.adoc[]
include::./common/chapters/glossary.adoc[]
include::../common/chapters/gfdl.adoc[]
include::./common/chapters/gfdl.adoc[]

View File

@ -5,7 +5,7 @@
-->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML 5.0//EN"
"http://docbook.org/xml/5.0/dtd/docbook.dtd" [
<!ENTITY chapter-vty SYSTEM "../common/chapters/vty.xml">
<!ENTITY chapter-vty SYSTEM "./common/chapters/vty.xml">
<!ENTITY sections-vty SYSTEM "generated/docbook_vty.xml" >
]>