Created release tag for version 0.3.10 of prest.
[docutils.git] / swconfig.pm
blob3f644250620274a9f2ffaff771267703695f72cc
1 #### Here is the configuration information for the config.prl file.
3 # Copyright (C) 2002-2005 Freescale Semiconductor
4 # Distributed under terms of the GNU General Public License (GPL).
6 package swconfig;
8 # Describes the configuration variables that need to be queried.
9 @ENVS = ('installdir' =>
10 {default=>'/usr/local/bin',
11 desc=>'Location to install prest',
12 exec=>0,
14 'defaultcss' =>
15 {default=>'http://docutils.sourceforge.net/tools/stylesheets/default.css',
16 desc=>'URL for default cascading style sheet (recommended to serve local copy)',
18 'taint' =>
19 {default=>'No',
20 desc=>'Run perl tainted (not required for safe operation)',
21 checkfail=>\&yesno,
23 'chmod' =>
24 {default=>'/bin',
25 desc=>'Location of safe chmod',
26 exec=>1,
27 ,},
28 'cpio' =>
29 {default=>'/bin',
30 desc=>'Location of safe cpio',
31 exec=>1,
32 ,},
33 'dirname' =>
34 {default=>'/bin',
35 desc=>'Location of safe dirname',
36 exec=>1,
37 ,},
38 'egrep' =>
39 {default=>'/bin',
40 desc=>'Location of safe egrep',
41 exec=>1,
42 ,},
43 'find' =>
44 {default=>'/bin',
45 desc=>'Location of safe find',
46 exec=>1,
47 ,},
48 'mkdir' =>
49 {default=>'/bin',
50 desc=>'Location of safe mkdir',
51 exec=>1,
52 ,},
53 'perl' =>
54 {default=>'/bin',
55 desc=>'Location of safe perl',
56 exec=>1,
57 ,},
58 'rm' =>
59 {default=>'/bin',
60 desc=>'Location of safe rm',
61 exec=>1,
62 ,},
63 'tee' =>
64 {default=>'/bin',
65 desc=>'Location of safe tee',
66 exec=>1,
67 ,},
68 'which' =>
69 {default=>'/bin',
70 desc=>'Location of safe which',
71 exec=>1,
72 ,},
75 chomp ($MY_DIR = `pwd`);
76 $MY_GRESS = "$MY_DIR/helpers";
77 # Describes the files that need to be configured.
78 %FILE = ('Makefile'=>
79 { init=>sub {qq(INSTALL_DIR = $CFGS{installdir}\n)} },
80 'src/PrestConfig.pm'=>
81 { init=>sub { << "EOS" } },
82 package PrestConfig;
83 \$DEFAULTCSS = "$CFGS{defaultcss}";
84 \$SAFE_PERL = "$CFGS{perl}/perl";
85 EOS
86 'src/insertperl.pl'=>
87 { init=>sub { << "EOS"} },
88 \$SAFE_PERL = "$CFGS{perl}/perl";
89 \$PERL_FLAGS = "@{[$CFGS{taint} =~ /^y/i ? '-T' : '']}";
90 EOS
91 'helpers/src/gresslib/copyfiles/Makefile'=>
92 { init=>sub { "GRESS_DIR = $MY_GRESS\n" } },
93 'helpers/src/gresslib/copyfiles/Makefile.master'=>
94 { init=>sub { "GRESS_DIR = $MY_GRESS\n" } },
95 'helpers/src/gress/gen_gress.prl'=>
96 { init=>sub { << "EOS" } },
97 \#!$CFGS{perl}/perl
98 \$PATH_REQ = "${\compute_path()}";
99 EOS
101 'helpers/src/gress/diffre.prl'=>
102 { init=>sub {qq(\#!$CFGS{perl}/perl\n)} },
104 'helpers/src/gress/run_gress.prl'=>
105 { init=>sub { << "EOS" } },
106 \#!$CFGS{perl}/perl
107 \$TEE_PATH = "$CFGS{tee}";
109 'tests/prest/Makefile'=>
110 { init=>sub {qq(GRESS_DIR = $MY_GRESS\n)} },
111 'tests/Makefile'=>
112 { init=>sub {
113 join('', `cat helpers/src/gresslib/copyfiles/Makefile.master`)
114 } },
115 'doc/src/Makefile'=>
116 { init=>sub { << "EOS" } },
117 GRESS_DIR = $MY_GRESS
118 PERL = $CFGS{perl}/perl
122 # Describes the list of instructions.
123 @INSTRUCTIONS = ('make all',
124 'make testall',
125 'make doc',
126 'make install',
129 sub yesno {
130 return !($_[0] =~ s/^y.*/Yes/i || $_[0] =~ s/^n.*/No/i);
133 sub compute_path {
134 my $env;
135 my %path;
136 my %envs = @ENVS;
137 foreach $env (keys %envs) {
138 next unless $envs{$env}{exec};
139 $path{$CFGS{$env}} = 1;
141 return join(":",sort keys %path);
144 # If present, a WRAPUP subroutine gets called at the end.
145 #sub WRAPUP {
146 # print "Configuring from $CFGS{gress}/lib/copyfiles/Makefile.master into tests/Makefile\n";
147 # system ("cp -f $CFGS{gress}/lib/copyfiles/Makefile.master tests/Makefile");