From 38c3cfbf27bf62e63e955cbab80783ea11b40b06 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 21 Jan 2014 17:36:46 +0100 Subject: Bug 961398: Let rst2pdf build the PDF documentation if pdflatex is not available r=gerv a=glob --- docs/makedocs.pl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'docs/makedocs.pl') diff --git a/docs/makedocs.pl b/docs/makedocs.pl index e46f7e7da..2fc6721eb 100755 --- a/docs/makedocs.pl +++ b/docs/makedocs.pl @@ -50,6 +50,9 @@ use Bugzilla::Install::Requirements qw(REQUIRED_MODULES OPTIONAL_MODULES); use Bugzilla::Constants qw(DB_MODULE BUGZILLA_VERSION); +use File::Path qw(rmtree); +use File::Which qw(which); + ############################################################################### # Generate minimum version list ############################################################################### @@ -174,5 +177,17 @@ foreach my $lang (@langs) { MakeDocs('HTML', 'make html'); MakeDocs('TXT', 'make text'); - MakeDocs('PDF', 'make latexpdf') if grep { $_ eq '--with-pdf' } @ARGV; + + if (grep { $_ eq '--with-pdf' } @ARGV) { + if (which('pdflatex')) { + MakeDocs('PDF', 'make latexpdf'); + } + elsif (which('rst2pdf')) { + rmtree('pdf', 0, 1); + MakeDocs('PDF', 'make pdf'); + } + else { + say 'pdflatex or rst2pdf not found. Skipping PDF file creation'; + } + } } -- cgit v1.2.3-24-g4f1b