build-sys: Have errors for missing po4a

Most of the time, po4a is not required and the translated man
pages are not translated, but sometimes (such as make dist) you
always want them available.

make -C po-man man.stamp, or its dependents, previous would give
some obscure error; either about running a flag or missing file,
it now explicitly talks about the issue:

make[4]: Entering directory '/home/csmall/Projects/procps/procps/po-man'
make  \
  top_distdir="../procps-ng-4.0.4.195-e684a-dirty" distdir="../procps-ng-4.0.4.195-e684a-dirty/po-man" \
  dist-hook
make[5]: Entering directory '/home/csmall/Projects/procps/procps/po-man'
error: You need to install the po4a package.
make[5]: Leaving directory '/home/csmall/Projects/procps/procps/po-man'
make[5]: *** [Makefile:535: check-po4a] Error 1

Signed-off-by: Craig Small <csmall@dropbear.xyz>
This commit is contained in:
Craig Small 2024-09-17 19:04:03 +10:00
parent e684abcd77
commit ed9958f918

View File

@ -39,7 +39,7 @@ all-local-no:
all-local-yes: man.stamp
# FIXME: Use a stamp file until po4a supports them internally.
man.stamp:
man.stamp: check-po4a
$(PO4A_V) $(PO4A) $(PO4A_OPTS) $(srcdir)/po4a.cfg
$(AM_V_at) touch $@
@ -50,16 +50,21 @@ clean-local-yes:
rm -rf $(LINGUAS_DIST)
$(AM_V_at) rm -f man.stamp
.PHONY: update-po
.PHONY: update-po check-po4a
procps-man.pot: $(src_MANS)
# parafiles = $(patsubst %,-m%,$(subst :, ,$(src_MANS)))
# parafiles = $(src_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 :, ,$(src_MANS))) -p $@
update-po:
update-po: check-po4a
$(PO4A_V) $(PO4A) $(PO4A_OPTS) --force $(srcdir)/po4a.cfg
check-po4a:
@if test -z '$(PO4A)'; then \
echo "error: You need to install the po4a package."; \
exit 1; \
fi
install-data-local:
for lang in $(LINGUAS) ; do \