File avoid_old_Texinfo_4.13.patch of Package pspp

Texinfo 4.13 was causing problems (e.g. on openSUSE Leap 42) 
despite the implemented workarounds, so this commit removes the workaround 
in favor of just using the distributed pspp.xml if makeinfo is broken.

--- a/acinclude.m4
+++ b/acinclude.m4
@@ -281,6 +281,21 @@ EOF
        AC_SUBST([AM_MAKEINFOFLAGS])
    fi])
 
+dnl Texinfo 4.13 generates broken DocBook XML.  Probably other old
+dnl versions do too, but that's the one that causes problems.
+AC_DEFUN([PSPP_CHECK_MAKEINFO_DOCBOOK_XML],
+  [AC_REQUIRE([AM_INIT_AUTOMAKE])  # Defines MAKEINFO
+   AC_CACHE_CHECK(
+     [whether makeinfo generates broken DocBook XML],
+     [pspp_cv_broken_docbook_xml],
+     [AS_CASE(
+        [$(eval "$MAKEINFO --version | head -1")],
+        [*texinfo*4.13*], [pspp_cv_broken_docbook_xml=yes],
+        [*texinfo*], [pspp_cv_broken_docbook_xml=no],
+        [*], [pspp_cv_broken_docbook_xml=yes])])
+   AM_CONDITIONAL(
+     [BROKEN_DOCBOOK_XML], [test "$pspp_cv_broken_docbook_xml" = yes])])
+
 # The following comes from Open vSwitch:
 # ----------------------------------------------------------------------
 # Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.

--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,7 @@ AC_HEADER_TIOCGWINSZ
 PKG_PROG_PKG_CONFIG
 m4_pattern_forbid([PKG_CHECK_MODULES])
 PSPP_CHECK_CLICKSEQUENCE
+PSPP_CHECK_MAKEINFO_DOCBOOK_XML
 PSPP_CHECK_DOT
 
 PSPP_ENABLE_WERROR
@@ -81,12 +82,7 @@ if test "$with_cairo" != no; then
     [PSPP_REQUIRED_PREREQ([cairo 1.5 or later and pango 1.22 or later (or use --without-cairo)])])
 fi
 
-dnl Xmllint is used in the rules to build the documentation.  It is not actually necessary,
-dnl but is used for post-build consistency checks.  Thus, non-developers can live without it.
-dnl However for it to be useful, it needs to be a certain version and have certain features.
-dnl The macros below check that it the xmllint available is up to scratch.  If it isn't
-dnl then a dummy /bin/echo is subsituted instead.
-
+dnl One of the tests uses xmllint.
 AC_CACHE_CHECK([for an xmllint program which fits our needs],[ac_cv_path_XMLLINT],
 [AC_PATH_PROGS_FEATURE_CHECK([XMLLINT], [xmllint], 
   [[$ac_path_XMLLINT --version 2>&1 | $GREP XPath > /dev/null && 

--- a/doc/automake.mk
+++ b/doc/automake.mk
@@ -59,35 +59,14 @@
 	$(AM_V_GEN)echo "@set example-dir $(examplesdir)" > $@
 
 
-# The SED and AWK filters in this rule, are to work-around some nasty bugs in 
-# makeinfo version 4.13, which produces broken docbook xml.  These workarounds 
-# are rather horrible and must be removed asap.
 $(srcdir)/doc/pspp.xml: doc/pspp.texi $(doc_pspp_TEXINFOS) $(top_srcdir)/doc/help-pages-list
+if BROKEN_DOCBOOK_XML
+	touch $@
+else
 	@$(MKDIR_P)  doc
 	$(AM_V_GEN)$(MAKEINFO) $(AM_MAKEINFOFLAGS) --docbook -I $(top_srcdir) \
-		$(top_srcdir)/doc/pspp.texi -o - \
-		| $(SED) -e 's/Time-&-Date/Time-\&-Date/g' \
-		-e 's/“/\“/g' \
-		-e 's/”/\”/g' \
-		-e 's/‘/\‘/g' \
-		-e 's/’/\’/g' \
-		-e 's/—/\—/g' \
-		-e 's/–/\′/g' \
-                -e 's/é/\é/g' \
-		-e 's/©/\©/g' \
-		-e 's/−/\−/g' \
-		-e 's/…/\…/g' \
-		-e 's/•/\ߦ/g' \
-		-e 's/././g' \
-		-e 's%\(<figure [^>]*\)>%\1/>%g' \
-	 | $(AWK) '/<para>.*<table.*>.*<\/para>/{x=sub("</para>",""); print; s=1;next}/<\/table>/{print; if (s==1) print "</para>"; s=0; next}1' \
-	> $@,tmp
-	$(AM_V_at)$(XMLLINT) --output /dev/null $@,tmp
-	$(AM_V_at)cat $(top_srcdir)/doc/help-pages-list | while read node ; do \
-	 $(XMLLINT) --xpath "$$node" $@,tmp > /dev/null; \
-	 if test $$? -ne 0 ; then  echo "$$node does not appear in $@" ; exit 1; fi ; \
-	 done 
-	mv $@,tmp $@
+		$< -o $@
+endif
 
 docbookdir = $(docdir)
 dist_docbook_DATA = doc/pspp.xml
openSUSE Build Service is sponsored by