osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13597
Change subject: Makefile.common.inc: add {,un}install targets
......................................................................
Makefile.common.inc: add {,un}install targets
Allow installing generated pdfs with 'make install' in all Osmocom
projects using osmo-gsm-manuals. This makes proper debian packaging of
the manuals easier.
Autotools will automatically run this file's install target, when
running 'make install' in the top source dir. Do not install anything,
when OSMO_GSM_MANUALS_NO_INSTALL is set, and set this variable for the
tests dir, so we don't install the test pdfs.
Related: OS#3899
Change-Id: I66f33172fa410681acbaef4592e9405627948705
---
M build/Makefile.common.inc
M tests/Makefile.am
2 files changed, 22 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals
refs/changes/97/13597/1
diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc
index aaad088..b13bda1 100644
--- a/build/Makefile.common.inc
+++ b/build/Makefile.common.inc
@@ -3,12 +3,16 @@
# Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add
# entries to UPLOAD_FILES and CLEAN_FILES.
#
-# Include this file at the end to have the common targets (upload, clean etc.).
+# Include this file at the end to have the common targets (upload, clean,
install etc.).
SSH_COMMAND = ssh -o
'UserKnownHostsFile=$(OSMO_GSM_MANUALS_DIR)/build/known_hosts' -p 48
UPLOAD_PATH ?= generic@sysmocom-downloads:documents
SYMLINKS = common build
CLEAN_FILES += $(SYMLINKS)
+PDF_FILES = $(patsubst %.adoc,%.pdf,$(ASCIIDOC)) $(patsubst
%.xml,%.pdf,$(VTY_REFERENCE))
+
+# Prefix (Makefile.am sets this to configure's --prefix when including)
+prefix ?= /usr/local
$(SYMLINKS):
ln -s $(OSMO_GSM_MANUALS_DIR)/$@ $@
@@ -25,3 +29,17 @@
mkdir -p out
cp *.pdf out
rsync -avz -e "$(SSH_COMMAND)" ./out/
[email protected]:web-files/latest/
+
+install: $(PDF_FILES)
+ if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \
+ for i in $(PDF_FILES); do \
+ install -vDm644 "$$i"
"$(DESTDIR)$(prefix)/share/doc/osmocom/$$i" || exit 1; \
+ done; \
+ fi
+
+uninstall:
+ if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \
+ for i in $(PDF_FILES); do \
+ rm -v "$(DESTDIR)$(prefix)/share/doc/osmocom/$$i"; \
+ done; \
+ fi
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 32f23b0..7dc9544 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,6 +3,9 @@
test-vty-reference.xml \
vty
+# Do not install any of the test pdfs
+OSMO_GSM_MANUALS_NO_INSTALL = 1
+
# Generate adoc file that includes all chapters
ASCIIDOC = test-usermanual.adoc
ASCIIDOC_DEPS =
--
To view, visit https://gerrit.osmocom.org/13597
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705
Gerrit-Change-Number: 13597
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>