Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

removing defunct files

  • Loading branch information...
commit fff94f9533cf188ff71e7d1035431b11a7ae20a5 1 parent f5ed6a2
Lincoln Stein lstein authored
2  Build.PL
@@ -51,6 +51,8 @@ for my $arg (keys %{$build->private_props}) {
51 51 $build->config_data($arg=>$value);
52 52 }
53 53
  54 +$build->add_build_element('conf');
  55 +$build->add_build_element('htdocs');
54 56 $build->create_build_script;
55 57 exit 0;
56 58
17 MANIFEST
@@ -3,19 +3,11 @@ bin/sync-bioperl.sh
3 3 Build.PL
4 4 cgi-bin/gbrowse
5 5 cgi-bin/gbrowse_details
6   -cgi-bin/gbrowse_drag
7   -cgi-bin/gbrowse_gff_autocomplete
8 6 cgi-bin/gbrowse_img
9   -cgi-bin/gbrowse_karyotype
10   -cgi-bin/gbrowse_not
11   -cgi-bin/gbrowse_seqfeature_autocomplete
12   -cgi-bin/gbrowse_syn
13   -cgi-bin/gbrowset
14 7 cgi-bin/README
15 8 Changes
16 9 conf/enzymes.txt
17 10 conf/GBrowse.conf
18   -conf/Gbrowse_karyotype.conf
19 11 conf/languages/de.pm
20 12 conf/languages/en.pm
21 13 conf/languages/es.pm
@@ -87,7 +79,6 @@ conf/templates/default/set_track_options_controls.tt2
87 79 conf/templates/default/slider.tt2
88 80 conf/templates/default/sourcemenu.tt2
89 81 conf/templates/default/start_section.tt2
90   -conf/templates/default/trackstable.bak.tt2
91 82 conf/templates/default/trackstable.tt2
92 83 conf/templates/default/uploadedfiles.tt2
93 84 conf/templates/default/uploadtable.tt2
@@ -189,7 +180,6 @@ docs/tutorial/conf_files/volvox5.conf
189 180 docs/tutorial/conf_files/volvox_final.conf
190 181 docs/tutorial/conf_files/volvox_final_withPhylo.conf
191 182 docs/tutorial/conf_files/volvox_Phylo.conf
192   -docs/tutorial/data_files/directory.index
193 183 docs/tutorial/data_files/dog1_1700.wig
194 184 docs/tutorial/data_files/elegans.fa
195 185 docs/tutorial/data_files/elegans_acceptor.gff
@@ -236,7 +226,6 @@ docs/tutorial/data_files/volvox8.gff3
236 226 docs/tutorial/data_files/volvox9.gff
237 227 docs/tutorial/data_files/volvox9.gff3
238 228 docs/tutorial/data_files/volvox_all.fa
239   -docs/tutorial/data_files/volvox_all.fa.index
240 229 docs/tutorial/data_files/volvox_all.gff
241 230 docs/tutorial/data_files/volvox_all.gff3
242 231 docs/tutorial/data_files/volvox_geneproducts.gff3
@@ -254,7 +243,6 @@ docs/tutorial/dbgff/conf_files/volvox3.conf
254 243 docs/tutorial/dbgff/conf_files/volvox4.conf
255 244 docs/tutorial/dbgff/conf_files/volvox5.conf
256 245 docs/tutorial/dbgff/conf_files/volvox_final.conf
257   -docs/tutorial/dbgff/data_files/directory.index
258 246 docs/tutorial/dbgff/data_files/elegans.fa
259 247 docs/tutorial/dbgff/data_files/elegans_acceptor.gff
260 248 docs/tutorial/dbgff/data_files/elegans_core.gff
@@ -278,7 +266,6 @@ docs/tutorial/dbgff/data_files/volvox7.gff
278 266 docs/tutorial/dbgff/data_files/volvox8.gff
279 267 docs/tutorial/dbgff/data_files/volvox9.gff
280 268 docs/tutorial/dbgff/data_files/volvox_all.fa
281   -docs/tutorial/dbgff/data_files/volvox_all.fa.index
282 269 docs/tutorial/dbgff/data_files/volvox_all.gff
283 270 docs/tutorial/dbgff/data_files/volvox_trace.scf
284 271 docs/tutorial/dbgff/figures/adding_dna_to_alignments1.gif
@@ -437,7 +424,6 @@ htdocs/css/tracks.css
437 424 htdocs/databases/ideograms/human_cytobands.gff
438 425 htdocs/databases/ideograms/mouse_cytobands.gff
439 426 htdocs/databases/ideograms/rat_cytobands.gff
440   -htdocs/databases/volvox/directory.index
441 427 htdocs/databases/volvox/volvox.fa
442 428 htdocs/databases/volvox/volvox.gff
443 429 htdocs/databases/volvox2/volvox2.gff
@@ -445,7 +431,6 @@ htdocs/databases/volvox3/volvox3.gff
445 431 htdocs/databases/volvox4/volvox4.gff3
446 432 htdocs/databases/yeast_chr1+2/chr1.fa
447 433 htdocs/databases/yeast_chr1+2/chr2.fa
448   -htdocs/databases/yeast_chr1+2/directory.index
449 434 htdocs/databases/yeast_chr1+2/yeast_chr1+2.gff3
450 435 htdocs/databases/yeast_chr1/chromosome1.fa
451 436 htdocs/databases/yeast_chr1/chromosome1.gff
@@ -584,11 +569,9 @@ libalign/CAlign.xs
584 569 libalign/Changes
585 570 libalign/README
586 571 libalign/realign.h
587   -libalign/realign_test.pl
588 572 Makefile.PL
589 573 MANIFEST This list of files
590 574 META.yml
591   -pkg_config.in
592 575 README
593 576 README.fedora_and_selinux
594 577 README.GBrowse-2.00
3  MANIFEST.SKIP
@@ -36,3 +36,6 @@ libalign/.+\.c
36 36 History
37 37 prototype-.*\.pdf
38 38 lib/Bio/Graphics/Browser/CAlign
  39 +\.index
  40 +\.patch$
  41 +\.notes$
8 conf/GBrowse.conf
@@ -3,9 +3,9 @@
3 3 # as the various constants formerly scattered amongst scripts and libraries
4 4
5 5 [GENERAL]
6   -config_base = /etc/apache2/gbrowse.conf # overriden by environment $GBROWSE_CONF
7   -htdocs_base = /var/www # overriden by environment $GBROWSE_HTDOCS
8   -url_base = /gbrowse # overriden by environment $GBROWSE_ROOT
  6 +config_base = /etc/GBrowse2 # overriden by environment variable GBROWSE_CONF
  7 +htdocs_base = /var/www # overriden by environment variable GBROWSE_HTDOCS
  8 +url_base = /gbrowse # overriden by environment variable GBROWSE_ROOT
9 9
10 10 # These paths are relative to the url base
11 11 buttons = images/buttons
@@ -64,7 +64,7 @@ head =
64 64 header =
65 65
66 66 # At the footer
67   -footer = <hr /><pre>$Id: GBrowse.conf,v 1.24 2008-10-11 00:02:42 lstein Exp $</pre>
  67 +footer = <hr /><pre>$Id: GBrowse.conf,v 1.25 2008-10-17 17:11:30 lstein Exp $</pre>
68 68
69 69 # Various places where you can insert your own HTML -- see configuration docs
70 70 html1 =
54 conf/Gbrowse_karyotype.conf
... ... @@ -1,54 +0,0 @@
1   -# default configuration for gbrowse_karyotype
2   -
3   -[GENERAL]
4   -description = no source
5   -
6   -max segment = 1000000000000
7   -
8   -# Web site configuration info
9   -tmpimages = /gbrowse/tmp
10   -stylesheet = /gbrowse/gbrowse.css
11   -buttons = /gbrowse/images/buttons
12   -
13   -# how long to save cached images
14   -image cachetime = 2_592_000
15   -
16   -[karyotype]
17   -max_height = 500
18   -cwidth = 25
19   -cytoband_track = ideogram
20   -bands = chromosome_band cytoband centromere
21   -
22   -# Default glyph settings
23   -[TRACK DEFAULTS]
24   -glyph = triangle
25   -height = 8
26   -bgcolor = black
27   -fgcolor = black
28   -label density = 25
29   -bump density = 50
30   -description = 0
31   -label = 0
32   -orient = E
33   -point = 1
34   -
35   -[ideogram]
36   -glyph = ideogram
37   -fgcolor = black
38   -bgcolor = gneg:white gpos25:silver gpos50:gray gpos:gray gpos75:darkgray gpos100:black gvar:var stalk:#666666
39   -arcradius = 7
40   -height = 20
41   -bump = 0
42   -
43   -
44   -
45   -
46   -
47   -
48   -
49   -
50   -
51   -
52   -
53   -
54   -
263 install_util/GBrowseInstall.pm
@@ -8,29 +8,21 @@ use ExtUtils::MakeMaker 'prompt';
8 8 use Cwd;
9 9 use File::Path 'rmtree';
10 10 use File::Temp 'tempdir';
  11 +use File::Spec;
11 12 use IO::File;
12 13 use GuessDirectories;
13 14
14   -my %OK_PROPS = (apache => 'Apache root directory (\'\' for none)? ',
15   - conf => 'Apache config directory? ',
16   - htdocs => 'Apache documents directory? ',
17   - cgibin => 'Apache CGI scripts directory? ',
18   - portdemo => 'Internet port to run demo on (demo only)? ',
19   - apachemodules => 'Apache loadable module directory (demo only)? ');
20   -
21   -sub private_props {
22   - return \%OK_PROPS;
23   -}
24   -
25   -sub valid_property {
26   - my $self = shift;
27   - my $prop = shift;
28   - return $OK_PROPS{$prop} || $self->SUPER::valid_property($prop);
29   -}
  15 +my %OK_PROPS = (conf => 'Directory for GBrowse\'s config and support files?',
  16 + htdocs => 'Apache documents directory?',
  17 + cgibin => 'Apache CGI scripts directory?',
  18 + portdemo => 'Internet port to run demo web site on (for demo)?',
  19 + apachemodules => 'Apache loadable module directory (for demo)?');
30 20
31 21 sub ACTION_demo {
32 22 my $self = shift;
33   - my $cwd = cwd();
  23 + $self->depends_on('config');
  24 +
  25 + my $home = $self->base_dir();
34 26 my $dir = tempdir(
35 27 'GBrowse_demo_XXXX',
36 28 TMPDIR=>1,
@@ -44,78 +36,25 @@ sub ACTION_demo {
44 36 mkdir "$dir/conf";
45 37 mkdir "$dir/logs";
46 38 mkdir "$dir/locks";
47   - my $conf = IO::File->new("$dir/conf/httpd.conf",'>');
48   - $conf->print(<<END);
49   -ServerName "localhost"
50   -ServerRoot "$dir/conf"
51   -LockFile "$dir/locks/accept.lock"
52   -PidFile "$dir/logs/apache2.pid"
53   -ErrorLog "$dir/logs/error.log"
54   -LogFormat "%h %l %u %t \\"%r\\" %>s %b" common
55   -CustomLog "$dir/logs/access.log" common
56   -LogLevel warn
57 39
58   -Timeout 300
59   -KeepAlive On
60   -MaxKeepAliveRequests 100
61   -KeepAliveTimeout 15
62   -DefaultType text/plain
63   -HostnameLookups Off
64   -
65   -<IfModule so_module>
66   - LoadModule cgi_module $modules/mod_cgi.so
67   - LoadModule authz_host_module $modules/mod_authz_host.so
68   - LoadModule env_module $modules/mod_env.so
69   - LoadModule alias_module $modules/mod_alias.so
70   - LoadModule dir_module $modules/mod_dir.so
71   - LoadModule mime_module $modules/mod_mime.so
72   -</IfModule>
  40 + my $conf_data = $self->httpd_conf($dir,$port);
  41 + my $conf = IO::File->new("$dir/conf/httpd.conf",'>')
  42 + or die "$dir/conf/httpd.conf: $!";
  43 + $conf->print($conf_data);
  44 + $conf->close;
73 45
74   -TypesConfig "$dir/conf/mime.types"
  46 + $conf_data = $self->gbrowse_conf($port,$home);
  47 + $conf = IO::File->new("$dir/conf/apache_gbrowse.conf",'>')
  48 + or die "$dir/conf/apache_gbrowse.conf: $!";
  49 + $conf->print($conf_data);
  50 + $conf->close;
75 51
76   -Listen $port
77   -NameVirtualHost *:$port
78   -<VirtualHost *:$port>
79   - ServerAdmin webmaster\@localhost
80   -
81   - DocumentRoot $cwd/htdocs/
82   - <Directory />
83   - Options FollowSymLinks
84   - AllowOverride None
85   - </Directory>
86   - <Directory $cwd/htdocs/>
87   - Options Indexes FollowSymLinks MultiViews
88   - AllowOverride None
89   - Order allow,deny
90   - allow from all
91   - </Directory>
  52 + $conf_data = $self->mime_conf();
  53 + my $mime = IO::File->new("$dir/conf/mime.types",'>')
  54 + or die "$dir/conf/mime.types: $!";
  55 + $mime->print($conf_data);
  56 + $mime->close;
92 57
93   - ScriptAlias /cgi-bin/ $cwd/cgi-bin/
94   - <Directory "$cwd/cgi-bin/">
95   - SetEnv PERL5LIB $cwd/lib
96   - SetEnv GBROWSE_MASTER GBrowse.conf
97   - SetEnv GBROWSE_CONF $cwd/conf
98   - SetEnv GBROWSE_DOCS $cwd/htdocs
99   - SetEnv GBROWSE_ROOT /
100   - AllowOverride None
101   - Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
102   - Order allow,deny
103   - Allow from all
104   - </Directory>
105   -</VirtualHost>
106   -END
107   -;
108   - $conf->close;
109   - my $mime = IO::File->new("$dir/conf/mime.types",'>') or die $!;
110   - $mime->print(<<END);
111   -image/gif gif
112   -image/jpeg jpeg jpg jpe
113   -image/png png
114   -image/svg+xml svg svgz
115   -text/css css
116   -text/html html htm shtml
117   -END
118   -;
119 58 system "apache2 -k start -f $dir/conf/httpd.conf";
120 59 if (-e "$dir/logs/apache2.pid") {
121 60 print STDERR "Demo is now running on http://localhost:$port\n";
@@ -160,11 +99,19 @@ sub ACTION_build {
160 99 chmod 0777,'./htdocs/tmp';
161 100 }
162 101
  102 +sub ACTION_reconfig {
  103 + my $self = shift;
  104 + $self->config_done(0);
  105 + $self->depends_on('config');
  106 +}
  107 +
163 108 sub ACTION_config {
164 109 my $self = shift;
165 110 local $^W = 0;
166 111
167 112 $self->depends_on('build');
  113 + return if $self->config_done;
  114 +
168 115 print STDERR "\n**Beginning interactive configuration**\n";
169 116
170 117 my $props = $self->private_props;
@@ -172,20 +119,154 @@ sub ACTION_config {
172 119 $_=>$self->config_data($_)
173 120 } keys %$props;
174 121
175   - $opts{apache} = prompt($props->{apache},
176   - GuessDirectories->root);
177   -
178 122 for my $key (sort keys %opts) {
179   - next if $key eq 'apache';
180 123 # next if $self->config_data($key);
181 124 $opts{$key} = prompt($props->{$key},
182   - $opts{$key} ||
183   - GuessDirectories->$key($opts{apache}))
  125 + $opts{$key} ||
  126 + GuessDirectories->$key($opts{apache}));
  127 + if ($props->{$key} =~ /directory/i
  128 + && !-d $opts{$key}) {
  129 + redo unless Module::Build->y_n("The directory $opts{$key} does not exist. Use anyway?",'n');
  130 + }
184 131 }
185 132
186 133 for my $key (keys %opts) {
187 134 $self->config_data($key=>$opts{$key});
188 135 }
  136 +
  137 + $self->config_done(1);
  138 +}
  139 +
  140 +sub ACTION_make_apache_conf {
  141 + my $self = shift;
  142 + $self->depends_on('config');
  143 + my $data = $self->gbrowse_conf($self->config_data(''));
  144 +}
  145 +
  146 +sub process_conf_files {
  147 + my $self = shift;
  148 + my $f = IO::File->new('MANIFEST');
  149 + while (<$f>) {
  150 + next unless m!^conf/!;
  151 + chomp;
  152 + $self->copy_if_modified($_=>'blib/conf');
  153 + }
  154 +}
  155 +
  156 +sub process_htdocs_files {
  157 + my $self = shift;
  158 + my $f = IO::File->new('MANIFEST');
  159 + while (<$f>) {
  160 + next unless m!^htdocs/!;
  161 + chomp;
  162 + $self->copy_if_modified($_=>'blib/htdocs');
  163 + }
  164 +}
  165 +
  166 +sub private_props {
  167 + return \%OK_PROPS;
  168 +}
  169 +
  170 +sub valid_property {
  171 + my $self = shift;
  172 + my $prop = shift;
  173 + return $OK_PROPS{$prop} || $self->SUPER::valid_property($prop);
  174 +}
  175 +
  176 +sub httpd_conf {
  177 + my $self = shift;
  178 + my ($dir,$port) = @_;
  179 +
  180 + my $modules = $self->config_data('apachemodules')
  181 + || GuessDirectories->apachemodules;
  182 +
  183 + return <<END;
  184 +ServerName "localhost"
  185 +ServerRoot "$dir/conf"
  186 +LockFile "$dir/locks/accept.lock"
  187 +PidFile "$dir/logs/apache2.pid"
  188 +ErrorLog "$dir/logs/error.log"
  189 +LogFormat "%h %l %u %t \\"%r\\" %>s %b" common
  190 +CustomLog "$dir/logs/access.log" common
  191 +LogLevel warn
  192 +
  193 +Timeout 300
  194 +KeepAlive On
  195 +MaxKeepAliveRequests 100
  196 +KeepAliveTimeout 15
  197 +DefaultType text/plain
  198 +HostnameLookups Off
  199 +
  200 +<IfModule so_module>
  201 + LoadModule cgi_module $modules/mod_cgi.so
  202 + LoadModule authz_host_module $modules/mod_authz_host.so
  203 + LoadModule env_module $modules/mod_env.so
  204 + LoadModule alias_module $modules/mod_alias.so
  205 + LoadModule dir_module $modules/mod_dir.so
  206 + LoadModule mime_module $modules/mod_mime.so
  207 +</IfModule>
  208 +
  209 +TypesConfig "$dir/conf/mime.types"
  210 +
  211 +Listen $port
  212 +Include "$dir/conf/apache_gbrowse.conf"
  213 +END
  214 +}
  215 +
  216 +sub gbrowse_conf {
  217 + my $self = shift;
  218 + my ($port,$dir) = @_;
  219 +
  220 + return <<END;
  221 +NameVirtualHost *:$port
  222 +<VirtualHost *:$port>
  223 + ServerAdmin webmaster\@localhost
  224 +
  225 + DocumentRoot $dir/htdocs/
  226 + <Directory />
  227 + Options FollowSymLinks
  228 + AllowOverride None
  229 + </Directory>
  230 + <Directory $dir/htdocs/>
  231 + Options Indexes FollowSymLinks MultiViews
  232 + AllowOverride None
  233 + Order allow,deny
  234 + allow from all
  235 + </Directory>
  236 +
  237 + ScriptAlias /cgi-bin/ $dir/cgi-bin/
  238 + <Directory "$dir/cgi-bin/">
  239 + SetEnv PERL5LIB $dir/blib/lib:$dir/blib/arch:$dir/lib
  240 + SetEnv GBROWSE_MASTER GBrowse.conf
  241 + SetEnv GBROWSE_CONF $dir/conf
  242 + SetEnv GBROWSE_DOCS $dir/htdocs
  243 + SetEnv GBROWSE_ROOT /
  244 + AllowOverride None
  245 + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  246 + Order allow,deny
  247 + Allow from all
  248 + </Directory>
  249 +</VirtualHost>
  250 +END
  251 +}
  252 +
  253 +sub mime_conf {
  254 + my $self = shift;
  255 + return <<END;
  256 +image/gif gif
  257 +image/jpeg jpeg jpg jpe
  258 +image/png png
  259 +image/svg+xml svg svgz
  260 +text/css css
  261 +text/html html htm shtml
  262 +END
  263 +}
  264 +
  265 +sub config_done {
  266 + my $self = shift;
  267 + my $done = $self->config_data('config_done');
  268 + $self->config_data(config_done=>shift) if @_;
  269 + return $done;
189 270 }
190 271
191 272 1;
187 install_util/GuessDirectories.pm
... ... @@ -1,126 +1,89 @@
1 1 package GuessDirectories;
2 2
3 3 use IO::Socket::INET;
  4 +use File::Spec;
4 5
5 6 # this package never gets installed - it's just used by Makefile.PL
6 7 sub conf {
7 8 shift;
8   - my $root = shift;
9   - return "$root/conf" if -d "$root/conf";
10 9 if ($^O =~ /mswin/i) { # windows system
11   - for ('C:/Program Files/Apache Software Foundation/Apache2.3/conf',
12   - 'C:/Program Files/Apache Software Foundation/Apache2.2/conf',
13   - 'C:/Program Files/Apache Software Foundation/Apache2.1/conf',
14   - 'C:/Program Files/Apache Group/Apache2/conf',
15   - 'C:/Program Files/Apache Group/Apache/conf',
16   - 'C:/Apache/conf',
17   - 'C:/Apache2/conf') {
18   - return $_ if -d $_;
19   - }
  10 + return File::Spec->catfile('C:','Program Files','GBrowse2');
20 11 } else {
21   - for (
22   - '/usr/local/apache/conf', # standard apache install
23   - '/usr/local/apache2/conf', # standard apache2 install
24   - '/etc/httpd/conf', # RedHat linux
25   - '/etc/apache', # Slackware linux
26   - '/etc/apache2', # Ubuntu
27   - '/etc/httpd', # MacOSX
28   - '/etc/apache2', # Ubuntu/debian
29   - '/etc/apache-perl', # Ubuntu/debian
30   - ) {
31   - return $_ if -d $_;
32   - }
  12 + for (
  13 + '/etc',
  14 + '/usr/etc',
  15 + '/usr/local/etc',
  16 + ) {
  17 + return File::Spec->catfile($_,'GBrowse2') if -d $_;
  18 + }
33 19 }
34   - return '/usr/local/apache/conf'; # fallback
  20 + return File::Spec->catfile('/usr/local/etc','GBrowse2'); # fallback
35 21 }
36 22
37   -sub root {
  23 +
  24 +sub apache_root {
38 25 if ($^O =~ /mswin/i) { # windows system
39 26 for (
40   - 'C:/Program Files/Apache Software Foundation/Apache2.5',
41   - 'C:/Program Files/Apache Software Foundation/Apache2.4',
42   - 'C:/Program Files/Apache Software Foundation/Apache2.3',
43   - 'C:/Program Files/Apache Software Foundation/Apache2.2',
44   - 'C:/Program Files/Apache Software Foundation/Apache2.1',
45   - 'C:/Program Files/Apache Group/Apache2/conf',
46   - 'C:/Program Files/Apache Group/Apache/conf',
47   - 'C:/Apache/conf',
48   - 'C:/Apache2/conf') {
49   - return $_ if -d $_;
  27 + 'C:/Program Files/Apache Software Foundation/Apache2.5',
  28 + 'C:/Program Files/Apache Software Foundation/Apache2.4',
  29 + 'C:/Program Files/Apache Software Foundation/Apache2.3',
  30 + 'C:/Program Files/Apache Software Foundation/Apache2.2',
  31 + 'C:/Program Files/Apache Software Foundation/Apache2.1',
  32 + 'C:/Program Files/Apache Group/Apache2',
  33 + 'C:/Program Files/Apache Group/Apache',
  34 + 'C:/Apache/conf',
  35 + 'C:/Apache2/conf') {
  36 + return $_ if -d $_;
50 37 }
51 38 } else {
52   - for (
53   - '/usr/local/apache2', # standard apache2 install
54   - '/usr/local/apache', # standard apache install
55   - '/usr/apache2',
56   - '/usr/apache',
57   - ) {
58   - return $_ if -d $_;
59   - }
  39 + for (
  40 + '/usr/local/apache2', # standard apache2 install
  41 + '/usr/local/apache', # standard apache install
  42 + '/opt/apache2',
  43 + '/opt/apache',
  44 + ) {
  45 + return $_ if -d $_;
  46 + }
60 47 }
61 48 return;
62 49 }
63 50
64 51 sub htdocs {
65   - shift;
66   - my $root = shift;
67   - return "$root/htdocs" if -d "$root/htdocs";
68   - return "$root/html" if -d "$root/html";
69   - if ($^O =~ /mswin/i) { # windows system
70   - for ('C:/Program Files/Apache Software Foundation/Apache2.3/htdocs',
71   - 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs',
72   - 'C:/Program Files/Apache Software Foundation/Apache2.1/htdocs',
73   - 'C:/Program Files/Apache Group/Apache2/htdocs',
74   - 'C:/Program Files/Apache Group/Apache/htdocs',
75   - 'C:/Apache/htdocs',
76   - 'C:/Apache2/htdocs') {
77   - return $_ if -d $_;
  52 + my $self = shift;
  53 + my $root = $self->apache_root;
  54 + foreach ('htdocs','html') {
  55 + return File::Spec->catfile($root,$_)
  56 + if -e File::Spec->catfile($root,$_);
78 57 }
79   - } else {
80   - for ('/usr/local/apache/htdocs', # standard apache install
81   - '/usr/local/apache2/htdocs', # standard apache2 install
82   - '/var/www/html', # RedHat linux
83   - '/var/www/htdocs', # Slackware linux
84   - '/var/www', # Ubuntu/debian
85   - '/var/www', # Ubuntu
86   - '/Library/Webserver/Documents', # MacOSX
  58 +
  59 + for (
  60 + '/var/www/html', # RedHat linux
  61 + '/var/www/htdocs', # Slackware linux
  62 + '/var/www', # Ubuntu/debian
  63 + '/var/www', # Ubuntu
  64 + '/Library/Webserver/Documents', # MacOSX
87 65 ) {
88   - return $_ if -d $_;
  66 + return $_ if -d $_;
89 67 }
90   - }
91   - return '/usr/local/apache/htdocs'; # fallback
  68 + return '/usr/local/apache/htdocs'; # fallback
92 69 }
93 70
94 71 sub cgibin {
95   - shift;
96   - my $root = shift;
97   - return "$root/cgi-bin" if -d "$root/cgi-bin";
98   - return "$root/cgi-perl" if -d "$root/cgi-perl";
99   - return "$root/cgi" if -d "$root/cgi";
100   -
101   - if ($^O =~ /mswin/i) { # windows system
102   - for (
103   - 'C:/Program Files/Apache Software Foundation/Apache2.3/cgi-bin',
104   - 'C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin',
105   - 'C:/Program Files/Apache Software Foundation/Apache2.1/cgi-bin',
106   - 'C:/Program Files/Apache Group/Apache2/cgi-bin',
107   - 'C:/Program Files/Apache Group/Apache/cgi-bin',
108   - 'C:/Apache/cgi-bin',
109   - 'C:/Apache2/cgi-bin') {
110   - return $_ if -d $_;
  72 + my $self = shift;
  73 + my $root = $self->apache_root;
  74 + foreach ('cgi-bin','cgi-perl','cgi') {
  75 + return File::Spec->catfile($root,$_)
  76 + if -e File::Spec->catfile($root,$_);
111 77 }
112   - } else {
113   - for ('/usr/local/apache/cgi-bin', # standard apache install
114   - '/usr/local/apache2/cgi-bin', # standard apache2 install
115   - '/var/www/cgi-bin', # RedHat & Slackware linux
116   - '/usr/lib/cgi-bin', # Ubuntu/debian
117   - '/Library/Webserver/CGI-Executables', # MacOSX
118   - '/usr/lib/cgi-bin', # Ubuntu
  78 + for (
  79 + '/var/www/cgi-bin', # RedHat & Slackware linux
  80 + '/usr/lib/cgi-bin', # Ubuntu/debian
  81 + '/Library/Webserver/CGI-Executables', # MacOSX
  82 + '/usr/lib/cgi-bin', # Ubuntu
119 83 ) {
120   - return $_ if -d $_;
  84 + return $_ if -d $_;
121 85 }
122   - }
123   - return '/usr/local/apache/cgi-bin'; #fallback
  86 + return '/usr/local/apache/cgi-bin'; #fallback
124 87 }
125 88
126 89 # try a few ports until we find an open one
@@ -134,30 +97,24 @@ sub portdemo {
134 97 }
135 98
136 99 sub apachemodules {
137   - shift;
138   - my $root = shift;
139   - return "$root/libexec" if $root && -d "$root/libexec";
140   -
141   - if ($^O =~ /mswin/i) { # windows system
142   - for (
143   - 'C:/Program Files/Apache Software Foundation/Apache2.4/modules',
144   - 'C:/Program Files/Apache Software Foundation/Apache2.3/modules',
145   - 'C:/Program Files/Apache Software Foundation/Apache2.2/modules',
146   - 'C:/Program Files/Apache Software Foundation/Apache2.1/modules',
147   - 'C:/Program Files/Apache Group/Apache2/modules',
148   - 'C:/Program Files/Apache Group/Apache/modules') {
149   - return $_ if -d $_;
150   - }
151   - } else {
152   - for ('/usr/lib/apache/modules',
153   - '/usr/lib/apache2/modules',
154   - '/usr/local/apache/libexec',
155   - ) {
156   - return $_ if -d $_;
  100 + my $self = shift;
  101 + my $root = $self->apache_root;
  102 + foreach ('modules','libexec') {
  103 + return File::Spec->catfile($root,$_)
  104 + if -d File::Spec->catfile($root,$_);
157 105 }
158   - }
159   - return '/usr/local/apache/cgi-bin'; #fallback
160 106
  107 +
  108 + for my $first ('/usr/lib','/usr/share',
  109 + '/usr/local/lib','/usr/local/share') {
  110 + for my $second ('apache','apache2') {
  111 + for my $third ('modules','libexec') {
  112 + my $candidate = File::Spec->catfile($first,$second,$third);
  113 + return $candidate if -d $candidate;
  114 + }
  115 + }
  116 + }
  117 + return '/usr/lib/apache/modules'; #fallback
161 118 }
162 119
163 120 1;
5 pkg_config.in
... ... @@ -1,5 +0,0 @@
1   -[option dir]
2   -INSTALL_CONF = /etc/httpd/conf
3   -INSTALL_HTDOCS = /var/www/html
4   -INSTALL_CGIBIN = /var/www/cgi-bin
5   -

0 comments on commit fff94f9

Please sign in to comment.
Something went wrong with that request. Please try again.