From e79095ddcca8fc13135003be7a7553e758f6477c Mon Sep 17 00:00:00 2001 From: Craig Small Date: Thu, 31 Oct 2019 20:48:15 +1100 Subject: [PATCH] build-sys: Install translated manpages References: procps-ng/procps#146 --- NEWS | 1 + man-po/Makefile.am | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 0a009857..b6ed9524 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ procps-ng-NEXT ---------------- * docs: Use correct symbols for -h option in free.1 Debian #898774 * docs: ps.1 now warns about command name length issue #101 + * docs: install translated man pages issue #146 * pgrep: Match on runstate issue #109, Debian #919381 * snice: Fix matching on pid merge #89 * top: can now exploit 256-color terminals issue #96 diff --git a/man-po/Makefile.am b/man-po/Makefile.am index c9d8a9f1..7bba57fe 100644 --- a/man-po/Makefile.am +++ b/man-po/Makefile.am @@ -7,7 +7,7 @@ get-trans: rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man-ps/ ps rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man-top/ top -translate-mans: dist-man-paths $(translated_MANS) +translate-mans: $(translated_MANS) base_langs = $(patsubst %.po,%,$(wildcard *.po)) top_langs = $(patsubst %.po,%,$(notdir $(wildcard top/*.po))) @@ -66,15 +66,19 @@ $(MAN_POT): $(MAN_POT_FILES) $(eval po4a_manfiles := $(foreach manfile,$^,$(addprefix -m , $(manfile)))) $(PO4A_UPDATEPO) -o translate_joined=MT -o noarg=ME -f man $(po4a_manfiles) -p $@ -dist_man_MANS = $(foreach lang, $(all_langs), $(foreach section, $(MAN_SECTIONS), $(wildcard $(lang)/man$(section)/*.$(section)))) +man_MANS := $(foreach lang, $(all_langs), $(foreach section, $(MAN_SECTIONS), $(wildcard $(lang)/man$(section)/*.$(section)))) dist-hook: translate-mans echo $(translated_MANS) -dist-man-paths: - echo $(top_langs) - @for p in $(man_paths) ; do \ - echo " $(MKDIR_P) '$$p'"; \ +install-data-local: translate-mans + for l in $(base_langs) ; do \ + for sect in `ls $$l` ; do \ + $(MKDIR_P) $(DESTDIR)$(mandir)/$$l/$$sect ; \ + for file in `ls $$l/$$sect` ; do \ + $(INSTALL_DATA) $$l/$$sect/$$file $(DESTDIR)$(mandir)/$$l/$$sect ; \ + done ; \ + done ; \ done # My Makefile-fu fails me here, I cannot see how to have double-wildcards