debian: create -doc subpackage with pdf manuals

I have verified, that the resulting debian packages build in my own OBS
namespace (see the -doc packages):
https://download.opensuse.org/repositories/home:/osmith42/Debian_9.0/all/
https://build.opensuse.org/project/show/home:osmith42

Depends: Ib7251cca9116151e473798879375cd5eb48ff3ad (osmo-ci)
Related: OS#3899
Change-Id: I4a327bac68769892634236c573c313c7859c6199
diff --git a/debian/control b/debian/control
index 23c39ce..debf669 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,8 @@
                libosmo-abis-dev,
                libosmo-netif-dev,
                libsqlite3-dev,
-               sqlite3
+               sqlite3,
+               osmo-gsm-manuals-dev
 Standards-Version: 3.9.6
 Vcs-Browser: http://cgit.osmocom.org/osmo-hlr
 Vcs-Git: git://git.osmocom.org/osmo-hlr
@@ -57,3 +58,12 @@
   and External USSD Entities (EUSEs) using this library to implement clients.
   .
   This package contains the development headers.
+
+Package: osmo-hlr-doc
+Architecture: all
+Section: doc
+Priority: optional
+Depends: ${misc:Depends}
+Description: ${misc:Package} PDF documentation
+ Various manuals: user manual, VTY reference manual and/or
+ protocol/interface manuals.
diff --git a/debian/osmo-hlr-doc.install b/debian/osmo-hlr-doc.install
new file mode 100644
index 0000000..f876859
--- /dev/null
+++ b/debian/osmo-hlr-doc.install
@@ -0,0 +1 @@
+usr/share/doc/osmo-hlr-doc/*.pdf
diff --git a/debian/rules b/debian/rules
index 9e97c6c..f5a79fb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,4 +17,8 @@
 	dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)
 
 override_dh_auto_configure:
-	dh_auto_configure -- --with-systemdsystemunitdir=/lib/systemd/system
+	dh_auto_configure -- --with-systemdsystemunitdir=/lib/systemd/system --enable-manuals
+
+# Don't create .pdf.gz files (barely saves space and they can't be opened directly by most pdf readers)
+override_dh_compress:
+	dh_compress -X.pdf
diff --git a/doc/manuals/Makefile.am b/doc/manuals/Makefile.am
index 687698f..9e1295a 100644
--- a/doc/manuals/Makefile.am
+++ b/doc/manuals/Makefile.am
@@ -15,6 +15,7 @@
   VTY_REFERENCE = osmohlr-vty-reference.xml
   include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
 
+  OSMO_REPOSITORY = osmo-hlr
   include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc
 endif