osmith has uploaded this change for review. ( https://gerrit.osmocom.org/12073


Change subject: add manuals from osmo-gsm-manuals.git
......................................................................

add manuals from osmo-gsm-manuals.git

Move to doc/manuals/, with full commit history. 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 was installed
with "make install". Otherwise OSMO_GSM_MANUALS_DIR needs to be set.

Related: OS#3385
Change-Id: I1317131ed6765fec996344fc6ed08350187b615b
---
M .gitignore
M configure.ac
M doc/Makefile.am
D doc/manuals/Makefile
A doc/manuals/Makefile.am
M doc/manuals/osmosipconnector-usermanual.adoc
M doc/manuals/osmosipconnector-vty-reference.xml
7 files changed, 85 insertions(+), 22 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/73/12073/1

diff --git a/.gitignore b/.gitignore
index 87bed96..0fa1ce0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,14 @@
 osmo-sip-connector
 .tarball-version
 .version
+
+# 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
diff --git a/configure.ac b/configure.ac
index cdb42a5..407bd9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,6 +77,48 @@
 AC_MSG_RESULT([$enable_ext_tests])
 AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")

+# 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])],,
@@ -101,6 +143,7 @@
 AC_OUTPUT(
        src/Makefile
        tests/Makefile
+       doc/manuals/Makefile
        contrib/Makefile
        contrib/systemd/Makefile
        doc/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index aee2d7b..15f36b7 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1 +1,4 @@
-SUBDIRS = examples
+SUBDIRS = \
+       examples \
+       manuals \
+       $(NULL)
diff --git a/doc/manuals/Makefile b/doc/manuals/Makefile
deleted file mode 100644
index cd3bb89..0000000
--- a/doc/manuals/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-TOPDIR = ..
-
-ASCIIDOC = osmosipconnector-usermanual.adoc
-ASCIIDOC_DEPS = chapters/*.adoc
-include $(TOPDIR)/build/Makefile.asciidoc.inc
-
-VTY_REFERENCE = osmosipconnector-vty-reference.xml
-include $(TOPDIR)/build/Makefile.vty-reference.inc
-
-include $(TOPDIR)/build/Makefile.common.inc
diff --git a/doc/manuals/Makefile.am b/doc/manuals/Makefile.am
new file mode 100644
index 0000000..1a9b5b9
--- /dev/null
+++ b/doc/manuals/Makefile.am
@@ -0,0 +1,16 @@
+EXTRA_DIST = osmosipconnector-usermanual.adoc \
+    osmosipconnector-usermanual-docinfo.xml \
+    osmosipconnector-vty-reference.xml \
+    chapters \
+    vty
+
+if BUILD_MANUALS
+  ASCIIDOC = osmosipconnector-usermanual.adoc
+  ASCIIDOC_DEPS = $(srcdir)/chapters/*.adoc
+  include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc
+
+  VTY_REFERENCE = osmosipconnector-vty-reference.xml
+  include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
+
+  include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc
+endif
diff --git a/doc/manuals/osmosipconnector-usermanual.adoc 
b/doc/manuals/osmosipconnector-usermanual.adoc
index 72f6c1f..72d7127 100644
--- a/doc/manuals/osmosipconnector-usermanual.adoc
+++ b/doc/manuals/osmosipconnector-usermanual.adoc
@@ -6,23 +6,23 @@
 Daniel Willmann <[email protected]>


-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::../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[]

diff --git a/doc/manuals/osmosipconnector-vty-reference.xml 
b/doc/manuals/osmosipconnector-vty-reference.xml
index fe22a99..0eeb952 100644
--- a/doc/manuals/osmosipconnector-vty-reference.xml
+++ b/doc/manuals/osmosipconnector-vty-reference.xml
@@ -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"  >
 ]>


--
To view, visit https://gerrit.osmocom.org/12073
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1317131ed6765fec996344fc6ed08350187b615b
Gerrit-Change-Number: 12073
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>

Reply via email to