diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:50:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:50:00 +0000 |
commit | 333f7ecfa3e040191c66b2b92f6c117ca2cbac1d (patch) | |
tree | 178a8f140927896970f47930dae9213161268f10 /man/generate_translations.mak | |
parent | Initial commit. (diff) | |
download | shadow-333f7ecfa3e040191c66b2b92f6c117ca2cbac1d.tar.xz shadow-333f7ecfa3e040191c66b2b92f6c117ca2cbac1d.zip |
Adding upstream version 1:4.8.1.upstream/1%4.8.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | man/generate_translations.mak | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/man/generate_translations.mak b/man/generate_translations.mak new file mode 100644 index 0000000..eb9ac41 --- /dev/null +++ b/man/generate_translations.mak @@ -0,0 +1,30 @@ +LANG=$(notdir $(CURDIR)) + +if ENABLE_REGENERATE_MAN +config.xml: ../config.xml.in + $(MAKE) -C .. config.xml + cp ../config.xml $@ + +messages.mo: ../po/$(LANG).po + msgfmt ../po/$(LANG).po -o messages.mo + +login.defs.d: + ln -sf ../login.defs.d login.defs.d + +%.xml: ../%.xml messages.mo login.defs.d + if grep -q SHADOW-CONFIG-HERE $< ; then \ + sed -e 's/^<!-- SHADOW-CONFIG-HERE -->/<!ENTITY % config SYSTEM "config.xml">%config;/' $< > $@; \ + else \ + sed -e 's/^\(<!DOCTYPE .*docbookx.dtd"\)>/\1 [<!ENTITY % config SYSTEM "config.xml">%config;]>/' $< > $@; \ + fi + itstool -d -l $(LANG) -m messages.mo -o . $@ + sed -i 's:\(^<refentry .*\)>:\1 lang="$(LANG)">:' $@ + +include ../generate_mans.mak + +else +$(man_MANS): + @echo you need to run configure with --enable-man to generate man pages +endif + +CLEANFILES = messages.mo login.defs.d $(EXTRA_DIST) $(addsuffix .xml,$(EXTRA_DIST)) config.xml |