diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 837ed89..c47b57d 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -654,39 +654,35 @@ sub _bz_locations { # # On mod_cgi this will be a relative path. On mod_perl it will be an # absolute path. - my $libpath = dirname(dirname($INC{'Bugzilla/Constants.pm'})); - # We have to detaint $libpath, but we can't use Bugzilla::Util here. - $libpath =~ /(.*)/; - $libpath = $1; + my $basepath = '/usr/share/bugzilla'; my ($localconfig, $datadir); if ($project && $project =~ /^(\w+)$/) { $project = $1; - $localconfig = "localconfig.$project"; - $datadir = "data/$project"; + $localconfig = "/etc/bugzilla/localconfig.$project"; + $datadir = "/var/lib/bugzilla/$project"; } else { $project = undef; - $localconfig = "localconfig"; - $datadir = "data"; + $localconfig = "/etc/bugzilla/localconfig"; + $datadir = "/var/lib/bugzilla"; } - $datadir = "$libpath/$datadir"; # We have to return absolute paths for mod_perl. # That means that if you modify these paths, they must be absolute paths. return { - 'libpath' => $libpath, - 'ext_libpath' => "$libpath/lib", + 'libpath' => "$basepath/lib", + 'ext_libpath' => "", # If you put the libraries in a different location than the CGIs, # make sure this still points to the CGIs. - 'cgi_path' => $libpath, - 'templatedir' => "$libpath/template", + 'cgi_path' => "$basepath/www", + 'templatedir' => "$basepath/template", 'template_cache' => "$datadir/template", 'project' => $project, - 'localconfig' => "$libpath/$localconfig", - 'datadir' => $datadir, + 'localconfig' => "$localconfig", + 'datadir' => "$datadir", 'attachdir' => "$datadir/attachments", - 'skinsdir' => "$libpath/skins", - 'graphsdir' => "$libpath/graphs", + 'skinsdir' => "$basepath/www/skins", + 'graphsdir' => "$datadir/graphs", # $webdotdir must be in the web server's tree somewhere. Even if you use a # local dot, we output images to there. Also, if $webdotdir is # not relative to the bugzilla root directory, you'll need to @@ -694,7 +690,7 @@ sub _bz_locations { # location. # The script should really generate these graphs directly... 'webdotdir' => "$datadir/webdot", - 'extensionsdir' => "$libpath/extensions", + 'extensionsdir' => "$basepath/extensions", 'assetsdir' => "$datadir/assets", }; } diff --git a/checksetup.pl b/checksetup.pl index cf124b8..b55bfaa 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -17,8 +17,7 @@ use strict; use warnings; use File::Basename; -BEGIN { chdir dirname($0); } -use lib qw(. lib); +use lib '/usr/share/bugzilla/lib'; use Getopt::Long qw(:config bundling); use Pod::Usage;