iproute2/iproute2-pdflatex.diff
Jan Engelhardt 5eac15cc6a Accepting request 129322 from home:WernerFink:branches:security:netfilter
- Make it build with modern pdflatex and TeXLive 2012 ... for this
  also sgmltools has to know about correct babel style usage

OBS-URL: https://build.opensuse.org/request/show/129322
OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iproute2?expand=0&rev=52
2012-07-30 14:54:56 +00:00

48 lines
1.2 KiB
Diff

--- doc/Makefile
+++ doc/Makefile 2012-07-30 14:32:31.934018848 +0000
@@ -6,7 +6,7 @@ PSFILES=ip-cref.ps ip-tunnels.ps api-ip6
LATEX=latex
DVIPS=dvips
-SGML2DVI=sgml2latex --output=dvi
+SGML2DVI=sgml2latex
SGML2HTML=sgml2html -s 0
LPR=lpr -Zsduplex
SHELL=bash
@@ -32,7 +32,7 @@ print: $(PSFILES)
$(LPR) $(PSFILES)
%.dvi: %.sgml
- $(SGML2DVI) $<
+ $(SGML2DVI) --output=dvi $<
%.dvi: %.tex
@set -e; pass=2; echo "Running LaTeX $<"; \
@@ -44,10 +44,22 @@ print: $(PSFILES)
echo "Re-running LaTeX $<, $${pass}d pass"; pass=$$[$$pass + 1]; \
done
-#%.pdf: %.tex
-# pdflatex $<
-%.pdf: %.ps
- ps2pdf $<
+%.tex: %.sgml
+ $(SGML2DVI) --output=tex $<
+
+%.pdf: %.tex
+ @set -e; pass=2; echo "Running pdfLaTeX $<"; \
+ TEXINPUTS="/usr/lib/sgml-tools:$$(kpsewhich '-var-value=TEXINPUTS')"; \
+ while [ `TEXINPUTS="$$TEXINPUTS" pdflatex $< </dev/null 2>&1 | \
+ grep -c '^\(LaTeX Warning: Label(s) may\|No file \|! Emergency stop\)'` -ge 1 ]; do \
+ if [ $$pass -gt 3 ]; then \
+ echo "Seems, something is wrong. Try by hands." ; exit 1 ; \
+ fi; \
+ echo "Re-running LaTeX $<, $${pass}d pass"; pass=$$[$$pass + 1]; \
+ done
+
+#%.pdf: %.ps
+# ps2pdf $<
%.ps: %.dvi
$(DVIPS) $< -o $@