[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 05/06: build: Build man pages.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 05/06: build: Build man pages. |
Date: |
Wed, 27 Jan 2016 10:24:12 +0000 |
civodul pushed a commit to branch master
in repository shepherd.
commit 4edc9f1e4351e8d9067793f7ef41452e740fa611
Author: Ludovic Courtès <address@hidden>
Date: Wed Jan 27 11:08:59 2016 +0100
build: Build man pages.
* Makefile.am (AM_V_HELP2MAN, AM_V_HELP2MAN_, AM_V_HELP2MAN_0)
(HELP2MANFLAGS): New variables.
(man-page-target): New function.
(shepherd.1): New target.
(dist_man1_MANS, dist_man8_MANS): New variables.
* configure.ac: Use AM_MISSING_PROG for 'HELP2MAN'.
---
.gitignore | 2 ++
Makefile.am | 27 +++++++++++++++++++++++++++
configure.ac | 2 ++
3 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index fd74e03..7cb94f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,3 +51,5 @@ Makefile
/tests/sigint.trs
/tests/status-sexp.log
/tests/status-sexp.trs
+/*.1
+/*.8
diff --git a/Makefile.am b/Makefile.am
index 99c20ec..a8535b1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,6 +65,33 @@ CLEANFILES = \
info_TEXINFOS = shepherd.texi
SUBDIRS = examples
+AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
+AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
+AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
+
+HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME)
+
+define man-page-target
+
+%.$(1): modules/shepherd/scripts/%.scm
+ -$$(AM_V_HELP2MAN)LANGUAGE= \
+ $(HELP2MAN) --output="$$@" --section=$(1) \
+ $(HELP2MANFLAGS) \
+ "$(top_builddir)/`basename "$$@" .$(1)`"
+
+endef
+
+# Create targets for sections 1 and 8.
+$(eval $(foreach section,1 8,$(call man-page-target,$(section))))
+
+shepherd.1: modules/shepherd.scm
+ -$(AM_V_HELP2MAN)LANGUAGE= \
+ $(HELP2MAN) --output="$@" $(HELP2MANFLAGS) \
+ "$(top_builddir)/shepherd"
+
+dist_man1_MANS = shepherd.1 herd.1
+dist_man8_MANS = halt.8 reboot.8
+
# Things not automatically included in the distribution.
EXTRA_DIST = $(templates) QUESTIONS fdl-1.3.texi ChangeLog-2003
diff --git a/configure.ac b/configure.ac
index 26ce88a..339167c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,6 +89,8 @@ AC_SUBST([RB_POWER_OFF])
AC_MSG_RESULT([done])
+dnl Manual pages.
+AM_MISSING_PROG([HELP2MAN], [help2man])
dnl Finish.
AC_CONFIG_FILES([Makefile
- [shepherd] branch master updated (88c6a20 -> 83567c4), Ludovic Courtès, 2016/01/27
- [shepherd] 06/06: Default system-wide config file is now /etc/shepherd.scm., Ludovic Courtès, 2016/01/27
- [shepherd] 01/06: Canonicalize the running value to valid read syntax., Ludovic Courtès, 2016/01/27
- [shepherd] 03/06: Move commands to (shepherd scripts xyz)., Ludovic Courtès, 2016/01/27
- [shepherd] 04/06: build: Install Guile modules to the usual place., Ludovic Courtès, 2016/01/27
- [shepherd] 02/06: Add the list of conflicting services to the status sexp., Ludovic Courtès, 2016/01/27
- [shepherd] 05/06: build: Build man pages.,
Ludovic Courtès <=