Blame SOURCES/shadow-4.6-use-itstool.patch

4fb1b2
diff -up shadow-4.6/man/generate_translations.mak.use-itstool shadow-4.6/man/generate_translations.mak
4fb1b2
--- shadow-4.6/man/generate_translations.mak.use-itstool	2018-04-29 18:42:37.000000000 +0200
4fb1b2
+++ shadow-4.6/man/generate_translations.mak	2018-07-31 16:42:21.623990969 +0200
4fb1b2
@@ -5,8 +5,19 @@ config.xml: ../config.xml.in
4fb1b2
 	$(MAKE) -C .. config.xml
4fb1b2
 	cp ../config.xml $@
4fb1b2
 
4fb1b2
-%.xml: ../%.xml ../po/$(LANG).po
4fb1b2
-	xml2po --expand-all-entities -l $(LANG) -p ../po/$(LANG).po -o $@ ../$@
4fb1b2
+messages.mo: ../po/$(LANG).po
4fb1b2
+	msgfmt ../po/$(LANG).po -o messages.mo
4fb1b2
+
4fb1b2
+login.defs.d:
4fb1b2
+	ln -sf ../login.defs.d login.defs.d
4fb1b2
+
4fb1b2
+%.xml: ../%.xml messages.mo login.defs.d
4fb1b2
+	if grep -q SHADOW-CONFIG-HERE $< ; then \
4fb1b2
+	    sed -e 's/^/%config;/' $< > $@; \
4fb1b2
+	else \
4fb1b2
+	    sed -e 's/^\(/\1 [%config;]>/' $< > $@; \
4fb1b2
+	fi
4fb1b2
+	itstool -d -l $(LANG) -m messages.mo -o . $@
4fb1b2
 	sed -i 's:\(^<refentry .*\)>:\1 lang="$(LANG)">:' $@
4fb1b2
 
4fb1b2
 include ../generate_mans.mak
4fb1b2
@@ -16,4 +27,4 @@ $(man_MANS):
4fb1b2
 	@echo you need to run configure with --enable-man to generate man pages
4fb1b2
 endif
4fb1b2
 
4fb1b2
-CLEANFILES = .xml2po.mo $(EXTRA_DIST) $(addsuffix .xml,$(EXTRA_DIST)) config.xml
4fb1b2
+CLEANFILES = messages.mo login.defs.d $(EXTRA_DIST) $(addsuffix .xml,$(EXTRA_DIST)) config.xml