~ubuntu-branches/ubuntu/hardy/bugzilla/hardy-security

« back to all changes in this revision

Viewing changes to docs/makedocs.pl

  • Committer: Bazaar Package Importer
  • Author(s): Rémi Perrot
  • Date: 2004-04-02 01:13:32 UTC
  • Revision ID: james.westby@ubuntu.com-20040402011332-hxrg0n2szimd7d25
Tags: upstream-2.16.5
Import upstream version 2.16.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
# -*- Mode: perl; indent-tabs-mode: nil -*-
 
3
#
 
4
# The contents of this file are subject to the Mozilla Public
 
5
# License Version 1.1 (the "License"); you may not use this file
 
6
# except in compliance with the License. You may obtain a copy of
 
7
# the License at http://www.mozilla.org/MPL/
 
8
#
 
9
# Software distributed under the License is distributed on an "AS
 
10
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
11
# implied. See the License for the specific language governing
 
12
# rights and limitations under the License.
 
13
#
 
14
# The Original Code is the Bugzilla Bug Tracking System.
 
15
#
 
16
# The Initial Developer of the Original Code is Netscape Communications
 
17
# Corporation. Portions created by Netscape are
 
18
# Copyright (C) 1998 Netscape Communications Corporation. All
 
19
# Rights Reserved.
 
20
#
 
21
# Contributor(s): Matthew Tuck <matty@chariot.net.au>
 
22
#                 Jacob Steenhagen <jake@bugzilla.org>
 
23
 
 
24
# This script compiles all the documentation.
 
25
 
 
26
use diagnostics;
 
27
use strict;
 
28
 
 
29
use File::Basename;
 
30
 
 
31
###############################################################################
 
32
# Environment Variable Checking
 
33
###############################################################################
 
34
 
 
35
my ($JADE_PUB, $LDP_HOME);
 
36
 
 
37
if (defined $ENV{JADE_PUB} && $ENV{JADE_PUB} ne '') {
 
38
    $JADE_PUB = $ENV{JADE_PUB};
 
39
}
 
40
else {
 
41
    die "You need to set the JADE_PUB environment variable first.";
 
42
}
 
43
 
 
44
if (defined $ENV{LDP_HOME} && $ENV{LDP_HOME} ne '') {
 
45
    $LDP_HOME = $ENV{LDP_HOME};
 
46
}
 
47
else {
 
48
    die "You need to set the LDP_HOME environment variable first.";
 
49
}
 
50
 
 
51
###############################################################################
 
52
# Subs
 
53
###############################################################################
 
54
 
 
55
sub MakeDocs($$) {
 
56
 
 
57
    my ($name, $cmdline) = @_;
 
58
 
 
59
    print "Creating $name documentation ...\n" if defined $name;
 
60
    print "$cmdline\n\n";
 
61
    system $cmdline;
 
62
    print "\n";
 
63
 
 
64
}
 
65
 
 
66
###############################################################################
 
67
# Make the docs ...
 
68
###############################################################################
 
69
 
 
70
chdir dirname($0);
 
71
chdir 'html';
 
72
 
 
73
MakeDocs('separate HTML', "jade -t sgml -i html -d $LDP_HOME/ldp.dsl\#html " .
 
74
         "$JADE_PUB/xml.dcl ../xml/Bugzilla-Guide.xml");
 
75
MakeDocs('big HTML', "jade -V nochunks -t sgml -i html -d " .
 
76
         "$LDP_HOME/ldp.dsl\#html $JADE_PUB/xml.dcl " .
 
77
         "../xml/Bugzilla-Guide.xml > Bugzilla-Guide.html");
 
78
MakeDocs('big text', "lynx -dump -justify=off -nolist Bugzilla-Guide.html " .
 
79
         "> ../txt/Bugzilla-Guide.txt");
 
80
 
 
81
if (! grep("--with-pdf", @ARGV)) {
 
82
    exit;
 
83
}
 
84
 
 
85
MakeDocs('PDF', "jade -t tex -d $LDP_HOME/ldp.dsl\#print $JADE_PUB/xml.dcl " .
 
86
         '../xml/Bugzilla-Guide.xml');
 
87
chdir '../pdf';
 
88
MakeDocs(undef, 'mv ../xml/Bugzilla-Guide.tex .');
 
89
MakeDocs(undef, 'jadetex Bugzilla-Guide.tex');
 
90
MakeDocs(undef, 'jadetex Bugzilla-Guide.tex');
 
91
MakeDocs(undef, 'jadetex Bugzilla-Guide.tex');
 
92
MakeDocs(undef, 'dvips -o Bugzilla-Guide.ps Bugzilla-Guide.dvi');
 
93
MakeDocs(undef, 'ps2pdf Bugzilla-Guide.ps Bugzilla-Guide.pdf');
 
94
MakeDocs(undef, 'rm Bugzilla-Guide.tex Bugzilla-Guide.log Bugzilla-Guide.dvi ' .
 
95
                'Bugzilla-Guide.aux Bugzilla-Guide.ps');
 
96