Permalink
Browse files

Build PDFs, at Robert Wotzlaw's suggestion and using parts of his cha…

…nges.
  • Loading branch information...
1 parent e892bd9 commit 4804098586f8b1e2980ef0385aef69c7f0b77b9d @SamB committed Apr 3, 2012
View
@@ -5,6 +5,7 @@ I_GCJ = gcj
I_GO = gccgo
I = $(I_GCC) $(I_FORTRAN) $(I_ADA) gnat_ugn $(I_GCJ) $(I_GO)
INFODOCS = $(I:%=%-$(VER).info) gccinstall-$(VER).info
+PDFDOCS = $(I:%=%.pdf) gccinstall.pdf
HTMLDOCS = $(I:%=%.html)
GCJ_M1 = gcj gij jcf-dump jv-convert grmic gcj-dbtool gc-analyse
@@ -18,39 +19,43 @@ FULLVER = $(GCC_VERSION)
GCCVERS = gcc/doc/gcc-vers.texi
-TARGETS = $(INFODOCS) $(HTMLDOCS) $(MANS)
+TARGETS = $(INFODOCS) $(HTMLDOCS) $(MANS) $(PDFDOCS)
GENFILES_GNAT = xgnatugn* gcc/doc/gnat_ugn.texi gcc/doc/projects.texi
GENFILES = $(TARGETS) $(PODS) $(GCCVERS) $(GENFILES_GNAT)
-MKINFO_DEFINES := -D "fncpp cpp-$(VER)" \
- -D "fncppint cppinternals-$(VER)" \
- -D "fngcc gcc-$(VER)" \
- -D "fngxx g++-$(VER)" \
- -D "fngccint gccint-$(VER)" \
- -D "fngccinstall gccinstall-$(VER)" \
- -D "fngcj gcj-$(VER)" \
- -D "fngfortran gfortran-$(VER)" \
- -D "fntreelang treelang-$(VER)" \
- -D "BUGURL http://bugs.debian.org/"
+MKINFO_DEFINES := -D"fncpp cpp-$(VER)" \
+ -D"fncppint cppinternals-$(VER)" \
+ -D"fngcc gcc-$(VER)" \
+ -D"fngxx g++-$(VER)" \
+ -D"fngccint gccint-$(VER)" \
+ -D"fngccinstall gccinstall-$(VER)" \
+ -D"fngcj gcj-$(VER)" \
+ -D"fngfortran gfortran-$(VER)" \
+ -D"fntreelang treelang-$(VER)" \
+ -D"BUGURL http://bugs.debian.org/"
MKINFO_FLAGS := --no-split -Igcc/doc -Igcc/doc/include
MKINFO = makeinfo $(MKINFO_DEFINES) $(MKINFO_FLAGS)
-MKHTML_DEFINES := -D "fncpp cpp" \
- -D "fncppint cppinternals" \
- -D "fngcc gcc" \
- -D "fngxx g++" \
- -D "fngccint gccint" \
- -D "fngccinstall gccinstall" \
- -D "fngcj gcj" \
- -D "fngfortran gfortran" \
- -D "fntreelang treelang" \
- -D "BUGURL http://bugs.debian.org/"
+MKHTML_DEFINES := -D"fncpp cpp" \
+ -D"fncppint cppinternals" \
+ -D"fngcc gcc" \
+ -D"fngxx g++" \
+ -D"fngccint gccint" \
+ -D"fngccinstall gccinstall" \
+ -D"fngcj gcj" \
+ -D"fngfortran gfortran" \
+ -D"fntreelang treelang" \
+ -D"BUGURL http://bugs.debian.org/"
MKHTML_FLAGS := --no-split -Igcc/doc -Igcc/doc/include
MKHTML = makeinfo $(MKHTML_DEFINES) $(MKHTML_FLAGS) --html
TEXI2POD_DEFINES := -Dfngccint=gccint-$(VER) -DBUGURL=http://bugs.debian.org/
TEXI2POD = perl ../../contrib/texi2pod.pl $(TEXI2POD_DEFINES)
+TEXI2PDF_DEFINES := $(MKHTML_DEFINES:-D%=--command="@set "%)
+TEXI2PDF_FLAGS = --batch -t '@errorcontextlines 16' --build-dir=build -I debian -I gcc/doc -I gcc/doc/include
+TEXI2PDF = texi2pdf $(TEXI2PDF_DEFINES) $(TEXI2PDF_FLAGS)
+
all : $(TARGETS)
@@ -65,27 +70,46 @@ $(I_GCC:%=%-$(VER).info) : %-$(VER).info : gcc/doc/%.texi $(GCCVERS)
$(I_GCC:%=%.html) : %.html : gcc/doc/%.texi $(GCCVERS)
$(MKHTML) -o $@ $<
+$(I_GCC:%=%.pdf) : %.pdf : gcc/doc/%.texi $(GCCVERS)
+ $(TEXI2PDF) -o $@ $<
+
+
gccinstall-$(VER).info : gcc/doc/install.texi $(GCCVERS)
$(MKINFO) -o $@ $<
+gccinstall.pdf : gcc/doc/install.texi $(GCCVERS)
+ $(TEXI2PDF) -o $@ $<
+
+
$(I_FORTRAN:%=%-$(VER).info) : %-$(VER).info : gcc/fortran/%.texi $(GCCVERS)
$(MKINFO) -o $@ $<
$(I_FORTRAN:%=%.html) : %.html : gcc/fortran/%.texi $(GCCVERS)
$(MKHTML) -o $@ $<
+$(I_FORTRAN:%=%.pdf) : %.pdf : gcc/fortran/%.texi $(GCCVERS)
+ $(TEXI2PDF) -o $@ $<
+
+
$(I_GCJ:%=%-$(VER).info) : %-$(VER).info : gcc/java/%.texi $(GCCVERS)
$(MKINFO) -o $@ $<
$(I_GCJ:%=%.html) : %.html : gcc/java/%.texi $(GCCVERS)
$(MKHTML) -o $@ $<
+$(I_GCJ:%=%.pdf) : %.pdf : gcc/java/%.texi $(GCCVERS)
+ $(TEXI2PDF) -o $@ $<
+
+
$(I_GO:%=%-$(VER).info) : %-$(VER).info : gcc/go/%.texi $(GCCVERS)
$(MKINFO) -o $@ $<
$(I_GO:%=%.html) : %.html : gcc/go/%.texi $(GCCVERS)
$(MKHTML) -o $@ $<
+$(I_GO:%=%.pdf) : %.pdf : gcc/go/%.texi $(GCCVERS)
+ $(TEXI2PDF) -o $@ $<
+
#
# ADA/GNAT documentation
@@ -106,12 +130,19 @@ gnat_ugn-$(VER).info : gcc/doc/gnat_ugn.texi $(GCCVERS)
gnat_ugn.html : gcc/doc/gnat_ugn.texi $(GCCVERS)
$(MKHTML) -o $@ $<
+gnat_ugn.pdf : gcc/doc/gnat_ugn.texi $(GCCVERS)
+ $(TEXI2PDF) -o $@ $<
+
+
$(I_ADA:%=%-$(VER).info) : %-$(VER).info : gcc/ada/%.texi $(GCCVERS)
$(MKINFO) -o $@ $<
$(I_ADA:%=%.html) : %.html : gcc/ada/%.texi $(GCCVERS)
$(MKHTML) -o $@ $<
+$(I_ADA:%=%.pdf) : %.pdf : gcc/ada/%.texi $(GCCVERS)
+ $(TEXI2PDF) -o $@ $<
+
#
# Manpages
@@ -145,4 +176,4 @@ $(GCCVERS) :
echo @set srcdir `pwd`/gcc ) > $@
clean:
- rm -f $(GENFILES)
+ rm -f $(GENFILES) -r build
View
@@ -1,3 +1,20 @@
+gcc-4.6-doc (4.6.3-1~naesten8) unstable; urgency=low
+
+ * Build PDFs, at Robert Wotzlaw's suggestion and using parts of his changes.
+ (Perhaps "inspired by" might be more accurate.)
+ + Instead of hard-coding the filenames into the xrefs, which would
+ (a) require rewriting rename-info-files.patch from the gcc-X.Y package and
+ (b) preclude using different filenames for different output formats,
+ we "simply" add support for @value in xref filenames to texinfo.tex.
+ Thanks to tex.stackexchange.com for the TeX hints and to Karl Berry for
+ accepting my patch.
+ + Add the PDFs to our .docs and .doc-base* files, so they get installed and
+ registered as alternate forms of the relevant documents.
+ + Instruct dh_compress not to compress them, because that often leads
+ to trouble with browsers and/or web servers.
+
+ -- Samuel Bronson <naesten@gmail.com> Tue, 03 Apr 2012 13:31:21 -0400
+
gcc-4.6-doc (4.6.3-1~naesten7) unstable; urgency=low
* Fix the links between HTML manuals.
View
@@ -3,7 +3,12 @@ Section: non-free/doc
Priority: optional
Maintainer: Samuel Bronson <naesten@gmail.com>
Build-Depends: debhelper (>= 7.0.50~)
-Build-Depends-Indep: texinfo, perl, gnat-4.6 | gnat
+Build-Depends-Indep:
+ texinfo,
+ gnat-4.6 | gnat,
+ texlive-base,
+ texlive-latex-base,
+ texlive-generic-recommended
Standards-Version: 3.9.3
Homepage: http://gcc.gnu.org/
Vcs-Browser: https://github.com/SamB/debian-gcc-doc
@@ -11,6 +11,11 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/cpp.html
Files: /usr/share/doc/gcc-@BV@-doc/cpp.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/cpp.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/cpp.pdf
+
Format: info
Index: /usr/share/info/cpp-@BV@.info.gz
Files: /usr/share/info/cpp-@BV@*
+
@@ -12,6 +12,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/cppinternals.html
Files: /usr/share/doc/gcc-@BV@-doc/cppinternals.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/cppinternals.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/cppinternals.pdf
+
Format: info
Index: /usr/share/info/cppinternals-@BV@.info.gz
Files: /usr/share/info/cppinternals-@BV@*
View
@@ -1,2 +1,4 @@
cpp.html
+cpp.pdf
cppinternals.html
+cppinternals.pdf
@@ -9,6 +9,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/gcc.html
Files: /usr/share/doc/gcc-@BV@-doc/gcc.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/gcc.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/gcc.pdf
+
Format: info
Index: /usr/share/info/gcc-@BV@.info.gz
Files: /usr/share/info/gcc-@BV@*
@@ -12,6 +12,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/gccint.html
Files: /usr/share/doc/gcc-@BV@-doc/gccint.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/gccint.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/gccint.pdf
+
Format: info
Index: /usr/share/info/gccint-@BV@.info.gz
Files: /usr/share/info/gccint-@BV@*
View
@@ -1,2 +1,4 @@
gcc.html
+gcc.pdf
gccint.html
+gccint.pdf
@@ -8,6 +8,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/gccgo.html
Files: /usr/share/doc/gcc-@BV@-doc/gccgo.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/gccgo.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/gccgo.pdf
+
Format: info
Index: /usr/share/info/gccgo-@BV@.info.gz
Files: /usr/share/info/gccgo-@BV@*
View
@@ -1 +1,2 @@
gccgo.html
+gccgo.pdf
@@ -10,6 +10,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/gcj.html
Files: /usr/share/doc/gcc-@BV@-doc/gcj.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/gcj.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/gcj.pdf
+
Format: info
Index: /usr/share/info/gcj-@BV@.info.gz
Files: /usr/share/info/gcj-@BV@*
View
@@ -1 +1,2 @@
gcj.html
+gcj.pdf
@@ -9,6 +9,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/gfortran.html
Files: /usr/share/doc/gcc-@BV@-doc/gfortran.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/gfortran.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/gfortran.pdf
+
Format: info
Index: /usr/share/info/gfortran-@BV@.info.gz
Files: /usr/share/info/gfortran-@BV@*
@@ -1 +1,2 @@
gfortran.html
+gfortran.pdf
@@ -11,6 +11,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/gnat_rm.html
Files: /usr/share/doc/gcc-@BV@-doc/gnat_rm.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/gnat_rm.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/gnat_rm.pdf
+
Format: info
Index: /usr/share/info/gnat_rm-@BV@.info.gz
Files: /usr/share/info/gnat_rm-@BV@.info.gz
@@ -10,6 +10,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/gnat-style.html
Files: /usr/share/doc/gcc-@BV@-doc/gnat-style.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/gnat-style.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/gnat-style.pdf
+
Format: info
Index: /usr/share/info/gnat-style-@BV@.info.gz
Files: /usr/share/info/gnat-style-@BV@.info.gz
@@ -11,6 +11,10 @@ Format: html
Index: /usr/share/doc/gcc-@BV@-doc/gnat_ugn.html
Files: /usr/share/doc/gcc-@BV@-doc/gnat_ugn.html
+Format: pdf
+Index: /usr/share/doc/gcc-@BV@-doc/gnat_ugn.pdf
+Files: /usr/share/doc/gcc-@BV@-doc/gnat_ugn.pdf
+
Format: info
Index: /usr/share/info/gnat_ugn-@BV@.info.gz
Files: /usr/share/info/gnat_ugn-@BV@.info.gz
View
@@ -1,3 +1,6 @@
gnat_rm.html
+gnat_rm.pdf
gnat-style.html
+gnat-style.pdf
gnat_ugn.html
+gnat_ugn.pdf
View
@@ -64,6 +64,12 @@ override_dh_installdocs:
dh_installdocs -pgcc-doc-base
dh_installdocs --remaining-packages --link-doc=gcc-$(BASE_VERSION)-doc
+# Gzipped PDFs often get mis-handled by browsers and/or servers.
+# (Thankfully, policy only requires *plain text* documentation to be
+# compressed.)
+override_dh_compress:
+ dh_compress -X.pdf
+
# XXX: Policy says this rule should download the latest, but there
# doesn't seem to be a good way to know what version uscan downloaded,
# so we don't do that yet.
Oops, something went wrong.

0 comments on commit 4804098

Please sign in to comment.