2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
# *.po and *.pot are kept in VCS and generated by po4a-dist command
|
|
|
|
# translated/* are put in distribution but not found in VCS
|
2014-06-28 19:08:13 +05:30
|
|
|
#
|
2021-02-15 16:06:57 +05:30
|
|
|
# run:
|
2022-08-29 13:37:43 +05:30
|
|
|
# rm po-man/man.stamp
|
|
|
|
# make -C po-man man.stamp
|
2021-02-15 16:06:57 +05:30
|
|
|
# To update man page translations
|
|
|
|
|
2022-03-21 16:03:11 +05:30
|
|
|
# Not sure why this needs to be repeated from the top-level Makefile but it does
|
|
|
|
dist_man_MANS = \
|
2022-08-29 13:37:43 +05:30
|
|
|
../man/free.1 \
|
|
|
|
../man/pgrep.1 \
|
|
|
|
../man/pkill.1 \
|
|
|
|
../man/pmap.1 \
|
|
|
|
../man/uptime.1 \
|
|
|
|
../man/vmstat.8 \
|
|
|
|
../man/procps.3 \
|
|
|
|
../man/procps_pids.3 \
|
|
|
|
../man/procps_misc.3
|
2021-02-15 16:06:57 +05:30
|
|
|
|
|
|
|
translated_MANS = $(wildcard translated/*/*.[1-9])
|
|
|
|
translated_MAN_sections=$(subst .,,$(sort $(suffix $(translated_MANS))))
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
translated_langs = $(notdir $(wildcard translated/*))
|
2014-06-28 19:08:13 +05:30
|
|
|
|
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
EXTRA_DIST = po4a.cfg \
|
|
|
|
procps-man.pot \
|
|
|
|
$(translated_MANS)
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
# Extract the list of languages from the po4a config file.
|
|
|
|
LINGUAS_DIST = $(shell sed -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po4a.cfg)
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
# If the user has not defined it let's use the default.
|
|
|
|
LINGUAS ?= $(LINGUAS_DIST)
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
PO4A_V = $(PO4A_V_@AM_V@)
|
|
|
|
PO4A_V_ = $(PO4A_V_@AM_DEFAULT_V@)
|
|
|
|
PO4A_V_0 = @echo " PO4A $@";
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
PO4A_OPTS = --srcdir $(srcdir) --destdir $(CURDIR) \
|
|
|
|
--package-name $(PACKAGE) --package-version $(VERSION) \
|
|
|
|
--msgid-bugs-address "Procps list <procps@freelists.org>"
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
all-local: all-local-@USE_PO4A@
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
all-local-no:
|
|
|
|
all-local-yes: man.stamp
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
# FIXME: Use a stamp file until po4a supports them internally.
|
|
|
|
man.stamp:
|
|
|
|
$(PO4A_V) $(PO4A) $(PO4A_OPTS) $(srcdir)/po4a.cfg
|
|
|
|
$(AM_V_at) touch $@
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
clean-local: clean-local-@USE_PO4A@
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
clean-local-no:
|
|
|
|
clean-local-yes:
|
|
|
|
rm -rf $(LINGUAS_DIST)
|
|
|
|
$(AM_V_at) rm -f man.stamp
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
.PHONY: update-po
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
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 $@
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2022-03-23 12:26:20 +05:30
|
|
|
update-po:
|
|
|
|
$(PO4A_V) $(PO4A) $(PO4A_OPTS) --force $(srcdir)/po4a.cfg
|
|
|
|
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
install-data-local:
|
|
|
|
for lang in $(LINGUAS) ; do \
|
|
|
|
files=""; \
|
|
|
|
for trans in $(notdir $(dist_man_MANS)); do \
|
|
|
|
if [ -f $(CURDIR)/$$lang/$$trans ]; then \
|
|
|
|
files="$$files $(CURDIR)/$$lang/$$trans"; \
|
|
|
|
elif [ -f $(srcdir)/$$lang/$$trans ]; then \
|
|
|
|
files="$$files $(srcdir)/$$lang/$$trans"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2021-02-24 15:28:28 +05:30
|
|
|
$(MAKE) -C .. install-man \
|
2021-02-15 16:06:57 +05:30
|
|
|
mandir="$(mandir)/$$lang" \
|
|
|
|
man_MANS="" \
|
|
|
|
dist_man_MANS="$$files"; \
|
|
|
|
done
|
|
|
|
|
|
|
|
uninstall-local:
|
|
|
|
for lang in $(LINGUAS); do \
|
|
|
|
files=""; \
|
|
|
|
for trans in $(notdir $(dist_man_MANS)); do \
|
|
|
|
if [ -f $(CURDIR)/$$lang/$$trans ]; then \
|
|
|
|
files="$$files $(CURDIR)/$$lang/$$trans"; \
|
|
|
|
elif [ -f $(srcdir)/$$lang/$$trans ]; then \
|
|
|
|
files="$$files $(srcdir)/$$lang/$$trans"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2021-02-24 15:28:28 +05:30
|
|
|
$(MAKE) -C .. uninstall-man \
|
2021-02-15 16:06:57 +05:30
|
|
|
mandir="$(mandir)/$$lang" \
|
|
|
|
man_MANS="" \
|
|
|
|
dist_man_MANS="$$files"; \
|
|
|
|
done
|
2014-06-28 19:08:13 +05:30
|
|
|
|
2021-02-15 16:06:57 +05:30
|
|
|
dist-hook: man.stamp
|
|
|
|
cp $(srcdir)/man.stamp $(distdir)/
|
|
|
|
for lang in $(LINGUAS_DIST); do \
|
|
|
|
cp $(srcdir)/$$lang.po $(distdir); \
|
|
|
|
cp $(srcdir)/$$lang.add $(distdir); \
|
|
|
|
$(MKDIR_P) $(distdir)/$$lang; \
|
|
|
|
cp -r $(srcdir)/$$lang $(distdir)/; \
|
|
|
|
done
|