From 1a6c702a5964a0bb74dcb8a9d1c29e629f4de731 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>
Date: Fri, 8 May 2020 18:48:36 +0200
Subject: [PATCH] Compile manpages according to their volume number

---
 .gitignore      |  4 +++-
 makefile.locale | 28 +++++++++++++++++++++++-----
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index d6e3e5d..00dc1dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,13 @@
 po4a.conf
 po4a-stamp
 Gemfile.lock
-*/*.txt
+**/*.txt
 */*.1
+*/*.7
 */*.html
 */*.xml
 */*.dep+
 !en/*.txt
 po/*.mo
 po4a/
+.weblate
\ No newline at end of file
diff --git a/makefile.locale b/makefile.locale
index 6f6ae7b..dda2756 100644
--- a/makefile.locale
+++ b/makefile.locale
@@ -1,6 +1,11 @@
 vpath GIT-VERSION-FILE . ..
 
-MAN_FILTER = $(wildcard git*.txt)
+MAN1_SOURCE = $(wildcard git-*.txt)
+MAN1_SOURCE += $(wildcard git.txt*)
+
+MAN7_SOURCE = $(wildcard gitglossary.txt*)
+
+MAN_FILTER = $(MAN1_SOURCE) $(MAN7_SOURCE)
 HTML_FILTER = $(patsubst %.txt,%.html,$(MAN_FILTER))
 
 
@@ -55,10 +60,23 @@ $(HTML_FILTER): %.html: %.txt
 	$(QUIET_ASCIIDOC)asciidoctor -b xhtml5 \
         $(ASCIIDOC_EXTRA) $<
 
-MANPAGES=$(patsubst %.txt,%.1,$(MAN_FILTER))
-$(MANPAGES): %.1: %.txt
+MAN1_PAGES=$(patsubst %.txt,%.1,$(MAN1_SOURCE))
+MAN5_PAGES=$(patsubst %.txt,%.5,$(MAN5_SOURCE))
+MAN7_PAGES=$(patsubst %.txt,%.7,$(MAN7_SOURCE))
+
+MANPAGES=$(MAN1_PAGES) $(MAN5_PAGES) $(MAN7_PAGES)
+
+$(MAN1_PAGES): %.1: %.txt
 	$(QUIET_ASCIIDOC)asciidoctor -b manpage -o $@ \
-        $(ASCIIDOC_EXTRA) $<
+        $(ASCIIDOC_EXTRA)  -amanvolnum=1 $<
+
+$(MAN5_PAGES): %.5: %.txt
+	$(QUIET_ASCIIDOC)asciidoctor -b manpage -o $@ \
+        $(ASCIIDOC_EXTRA)  -amanvolnum=5 $<
+
+$(MAN7_PAGES): %.7: %.txt
+	$(QUIET_ASCIIDOC)asciidoctor -b manpage -o $@ \
+        $(ASCIIDOC_EXTRA)  -amanvolnum=7 $<
 
 man: $(MANPAGES)
 html: $(HTML_FILTER)
@@ -71,7 +89,7 @@ install-txt:
 	[ -z "$$(ls *.html 2>/dev/null)" ] || install *.html -m 644 $(prefix)/$(lang)
 
 clean:
-	rm -f *.1 *.html
+	rm -f *.1 *.5 *7 *.html
 
 endif
 
-- 
GitLab