From 34e65653df4a18513c0fc87bd57f8f123fa63580 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>
Date: Thu, 4 Jul 2019 22:34:07 +0200
Subject: [PATCH] Add install-txt target to Makefile

This allows to easily export translated manpage sources in another repository.
---
 Makefile        | 2 +-
 makefile.locale | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 3940967..755db26 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ EN_SOURCES = $(wildcard en/*.txt)
 LANGUAGE_PO = $(wildcard po/*.po)
 ALL_LANGUAGES = $(subst po/documentation.,,$(subst .po,,$(LANGUAGE_PO)))
 
-L10N_BUILD_TARGETS = all man html install doc-l10n install-l10n
+L10N_BUILD_TARGETS = all man html install doc-l10n install-l10n install-txt
 L10N_CLEAN_TARGETS = clean mrproper
 L10N_TARGETS = $(L10N_CLEAN_TARGETS) $(L10N_BUILD_TARGETS)
 
diff --git a/makefile.locale b/makefile.locale
index 5578a5e..b6ac090 100644
--- a/makefile.locale
+++ b/makefile.locale
@@ -13,7 +13,7 @@ vpath %rb  . .. ../..
 
 ifdef mandir
 tmp_mandir := $(mandir)
-mandir = $(temp_mandir)/$(lang)
+mandir = $(tmp_mandir)/$(lang)
 else
 mandir = $(prefix)/share/man/$(lang)
 endif
@@ -55,6 +55,10 @@ html: $(HTML_FILTER)
 
 all doc-l10n: man html
 
+install-txt:
+	install -d -m 755 $(prefix)/$(lang)
+	install *.txt -m 644 $(prefix)/$(lang)
+
 clean:
 	rm -f *.1 *.html
 
-- 
GitLab