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

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