build-sys: update man translation makefile

This is based upon the Makefile.am for psmisc
This commit is contained in:
Craig Small 2019-11-28 21:53:43 +11:00
parent bfada70a8a
commit 0e9e30e6ae
4 changed files with 62 additions and 24 deletions

1
.gitignore vendored
View File

@ -29,6 +29,7 @@ libtool
ltmain.sh ltmain.sh
m4/ m4/
man-po/translated man-po/translated
man-po/*.pot
Makefile Makefile
Makefile.in Makefile.in
missing missing

7
man-po/.gitignore vendored
View File

@ -1,8 +1 @@
*.pot *.pot
/de/
/fr/
/pl/
/pt_BR/
/sv/
/uk/
/zh_CN/

View File

@ -6,32 +6,76 @@
# make -C man-po po4a-dist # make -C man-po po4a-dist
# To update man page translations # To update man page translations
dist_man_MANS = \
../free.1 \
../pgrep.1 \
../pkill.1 \
../pmap.1 \
../uptime.1 \
../vmstat.8 \
../w.1 \
../ps/procps.1
if !CYGWIN
dist_man_MANS += \
../pwdx.1 \
../tload.1 \
../sysctl.8 \
../sysctl.conf.5 \
../ps/ps.1
endif
translated_MANS = $(wildcard translated/*/*.[1-9]) translated_MANS = $(wildcard translated/*/*.[1-9])
translated_MAN_sections=$(subst .,,$(sort $(suffix $(translated_MANS)))) translated_MAN_sections=$(subst .,,$(sort $(suffix $(translated_MANS))))
translated_langs = $(notdir $(wildcard translated/*)) translated_langs = $(notdir $(wildcard translated/*))
EXTRA_DIST = po4a.cfg $(translated_MANS) EXTRA_DIST = po4a.cfg \
procps-man.pot \
$(translated_MANS)
LINGUAS_DIST=$(subst .po,,$(wildcard $(srcdir)/*.po))
# If the user has not defined it let's use the default.
LINGUAS ?= $(LINGUAS_DIST)
PO4A_V = $(PO4A_V_@AM_V@)
PO4A_V_ = $(PO4A_V_@AM_DEFAULT_V@)
PO4A_V_0 = @echo " PO4A $@";
PO4A_OPTS = --srcdir $(srcdir) --destdir $(CURDIR) \
--package-name $(PACKAGE) --package-version $(VERSION) \
--msgid-bugs-address "Procps list <procps@freelists.org>"
if USE_PO4A if USE_PO4A
po4a-dist: update-po:
-@po4a -M utf-8 -k 0 po4a.cfg $(PO4A_V) $(PO4A) $(PO4A_OPTS) --force $(srcdir)/po4a.cfg
#clean-local:
# rm -rf translated/$(LINGUAS_DIST)
#
procps-man.pot:
# parafiles = $(patsubst %,-m%,$(subst :, ,$(dist_man_MANS)))
# parafiles = $(dist_man_MANS:doc=Ente)
po4a-gettextize -M utf8 --option groff_code=verbatim --option generated --option untranslated="a.RE,\|" --option unknown_macros=untranslated -f man $(patsubst %,-m%,$(subst :, ,$(dist_man_MANS))) -p $@
endif endif
install-data-local: install-data-local:
for l in $(translated_langs) ; do \ for lang in $(LINGUAS) ; do \
for sect in $(translated_MAN_sections) ; do \ files=""; \
manpages=`ls translated/$$l/*.$$sect 2>/dev/null` ; \ for trans in $(notdir $(dist_man_MANS)); do \
if [ -n "$$manpages" ] ; then \ if [ -f $(CURDIR)/translated/$$lang/$$trans ]; then \
$(MKDIR_P) $(DESTDIR)$(mandir)/$$l/man$$sect ; \ files="$$files $(CURDIR)/translated/$$lang/$$trans"; \
for file in `ls translated/$$l/*.$$sect` ; do \ elif [ -f $(srcdir)/translated/$$lang/$$trans ]; then \
$(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/$$l/man$$sect ; \ files="$$files $(srcdir)/translated/$$lang/$$trans"; \
done ; \ fi; \
fi ; \ done; \
done ; \ $(MAKE) install-man \
mandir="$(mandir)/$$lang" \
man_MANS="" \
dist_man_MANS="$$files"; \
done done
.PHONY = translated_langs po4a-dist

View File

@ -1,4 +1,4 @@
[po_directory] . [po4a_paths] procps-man.pot $lang:$lang.po
[type: man] ../free.1 $lang:translated/$lang/free.1 \ [type: man] ../free.1 $lang:translated/$lang/free.1 \
add_$lang:?add_$lang/$lang.add opt:"-k 80" add_$lang:?add_$lang/$lang.add opt:"-k 80"