[Pkg-bugzilla-commits] r109 - in trunk/bugzilla-2.18/debian: . examples patches
Alexis Sukrieh
sukria-guest@costa.debian.org
Fri, 17 Jun 2005 15:14:45 +0000
Author: sukria-guest
Date: 2005-06-17 15:14:45 +0000 (Fri, 17 Jun 2005)
New Revision: 109
Modified:
trunk/bugzilla-2.18/debian/README.Debian
trunk/bugzilla-2.18/debian/bugzilla.postinst
trunk/bugzilla-2.18/debian/examples/vh-basic.conf
trunk/bugzilla-2.18/debian/patches/07_virtualhosting.dpatch
trunk/bugzilla-2.18/debian/rules
Log:
release 2.18-7
Modified: trunk/bugzilla-2.18/debian/README.Debian
===================================================================
--- trunk/bugzilla-2.18/debian/README.Debian 2005-06-12 13:49:44 UTC (rev 108)
+++ trunk/bugzilla-2.18/debian/README.Debian 2005-06-17 15:14:45 UTC (rev 109)
@@ -47,8 +47,9 @@
Then, you have to prepare a configuration directory for your virtual
host. The simpliest way is to copy the one the package created:
- `/etc/bugzilla'. Name this new configuration directory like that:
- `/etc/bugzilla-host' where `host' is the name of your virtual host.
+ `/etc/bugzilla'.
+ Name this new configuration directory like that:
+ `/etc/bugzilla/sites/host' where `host' is the name of your virtual host.
You have now to add a virtual host section in your Apache configuraiton file.
This can be achieved in different ways, depending on the kind of VirtualHost
@@ -66,7 +67,7 @@
As you can see in those examples, two environment variables are provided for
fitting your needs:
- X_BUGZILLA_SITE which is the name of the virtual host, it is used to find
- wich configuration directory to use: `/etc/bugzilla-X_BUGZILLA_SITE'.
+ wich configuration directory to use: `/etc/bugzilla/sites/X_BUGZILLA_SITE'.
- X_BUGZILLA_WEBPATH wich is the prefix to prepend to every static files in
the templates.
@@ -76,11 +77,8 @@
If you want to have specific templates for a given virtual host, that's also
possible, just copy `/usr/share/bugzilla/template' to
`/usr/share/bugzilla/template-X_BUGZILLA_SITE' and apply your changes there.
- Take care to make this directory readable by www-data.
-
- Also, take care to keep sane permissions to your /etc/bugzilla-* directories (should
- be readable by www-data).
-
+ Take care to preserve permissions when you copy the files.
+
At this time, you can set a different database for each virtual host,
customize templates for another or even share the same database... Everything
is possible with few effort.
Modified: trunk/bugzilla-2.18/debian/bugzilla.postinst
===================================================================
--- trunk/bugzilla-2.18/debian/bugzilla.postinst 2005-06-12 13:49:44 UTC (rev 108)
+++ trunk/bugzilla-2.18/debian/bugzilla.postinst 2005-06-17 15:14:45 UTC (rev 109)
@@ -110,6 +110,7 @@
chown -R www-data:www-data $datadir
chmod -R g+rw $datadir
chmod -R u+rw $datadir
+ chown www-data:www-data /etc/bugzilla/sites
# Let's close cleanly debconf
db_stop
Modified: trunk/bugzilla-2.18/debian/examples/vh-basic.conf
===================================================================
--- trunk/bugzilla-2.18/debian/examples/vh-basic.conf 2005-06-12 13:49:44 UTC (rev 108)
+++ trunk/bugzilla-2.18/debian/examples/vh-basic.conf 2005-06-17 15:14:45 UTC (rev 109)
@@ -2,5 +2,9 @@
ServerAdmin bugzilla@domain.com
ServerName bugzilla.domain.com
+ DocumentRoot /usr/share/bugzilla/web
+
SetEnv X_BUGZILLA_SITE "basic"
+ SetEnv X_BUGZILLA_WEBPATH "/"
+
</VirtualHost>
Modified: trunk/bugzilla-2.18/debian/patches/07_virtualhosting.dpatch
===================================================================
--- trunk/bugzilla-2.18/debian/patches/07_virtualhosting.dpatch 2005-06-12 13:49:44 UTC (rev 108)
+++ trunk/bugzilla-2.18/debian/patches/07_virtualhosting.dpatch 2005-06-17 15:14:45 UTC (rev 109)
@@ -5,10 +5,10 @@
## DP: support for multi-site installs (/etc/bugzilla-$X_BUGZILLA_SITE, web/data-$X_BUGZILLA_SITE)
@DPATCH@
-diff -urNad bugzilla-2.18/Bugzilla/Config.pm /tmp/dpep.EHVXdo/bugzilla-2.18/Bugzilla/Config.pm
---- bugzilla-2.18/Bugzilla/Config.pm 2005-06-12 14:57:02.000000000 +0200
-+++ /tmp/dpep.EHVXdo/bugzilla-2.18/Bugzilla/Config.pm 2005-06-12 14:57:53.000000000 +0200
-@@ -51,12 +51,27 @@
+diff -urNad bugzilla-2.18/Bugzilla/Config.pm /tmp/dpep.H7oWhK/bugzilla-2.18/Bugzilla/Config.pm
+--- bugzilla-2.18/Bugzilla/Config.pm 2005-06-17 16:30:40.000000000 +0200
++++ /tmp/dpep.H7oWhK/bugzilla-2.18/Bugzilla/Config.pm 2005-06-17 16:34:05.000000000 +0200
+@@ -51,12 +51,34 @@
# graphs (since the path will be wrong in the HTML). This will be fixed at
# some point.
@@ -19,28 +19,34 @@
+ $xsite = "$ENV{X_BUGZILLA_SITE}";
+ # untaint (make sure it has no '/' and is overall something sane)
+ if ($xsite =~ m/^(\w[\w\-.]*)$/) {
-+ $xsite ="-$1";
++ $xsite ="$1";
+ } else {
+ die "invalid X_BUGZILLA_SITE: $xsite";
+ }
+}
+
-+
-+
our $libpath = '/usr/share/bugzilla';
--our $localconfig = "/etc/bugzilla/localconfig";
+ our $localconfig = "/etc/bugzilla/localconfig";
-our $datadir = "/var/lib/bugzilla";
-our $templatedir = "$libpath/template";
-+our $localconfig = "/etc/bugzilla${xsite}/localconfig";
-+our $datadir = "/var/lib/bugzilla/data${xsite}";
-+our $templatedir = (-d "$libpath/template${xsite}") ? "$libpath/template${xsite}" : "$libpath/template";
- our $webdotdir = "$datadir/webdot";
--our $params_file = "/etc/bugzilla/params";
-+our $params_file = "/etc/bugzilla${xsite}/params";
+-our $webdotdir = "$datadir/webdot";
+ our $params_file = "/etc/bugzilla/params";
++our $datadir = "/var/lib/bugzilla/data";
++
++# If we have a $xsite, let's manage the conf paths correctly
++if ($xsite) {
++ $localconfig = "/etc/bugzilla/sites/${xsite}/localconfig";
++ $params_file = "/etc/bugzilla/sites/${xsite}/params";
++ $datadir = "/var/lib/bugzilla/data-${xsite}";
++}
++
++
++our $templatedir = (-d "$libpath/template-${xsite}") ? "$libpath/template-${xsite}" : "$libpath/template";
++our $webdotdir = "$datadir/webdot";
# Module stuff
@Bugzilla::Config::EXPORT = qw(Param);
-@@ -85,7 +100,13 @@
+@@ -85,7 +107,13 @@
use vars qw(@param_list);
# This is for Debian compat, in order to be able to use [% webpath %] in templates.
@@ -55,7 +61,7 @@
# Data::Dumper is required as needed, below. The problem is that then when
# the code locally sets $Data::Dumper::Foo, this triggers 'used only once'
-@@ -104,6 +125,9 @@
+@@ -104,6 +132,9 @@
# XXX - mod_perl - need to register Apache init handler for params
sub _load_datafiles {
# read in localconfig variables
Modified: trunk/bugzilla-2.18/debian/rules
===================================================================
--- trunk/bugzilla-2.18/debian/rules 2005-06-12 13:49:44 UTC (rev 108)
+++ trunk/bugzilla-2.18/debian/rules 2005-06-17 15:14:45 UTC (rev 109)
@@ -60,6 +60,8 @@
# Installing exemples
install -d -m 0755 -o root -g root $(CURDIR)/debian/bugzilla/usr/share/doc/bugzilla/examples
install -m 0644 -o root -g root debian/examples/*.conf $(CURDIR)/debian/bugzilla/usr/share/doc/bugzilla/examples
+ # preparing the vhost conf dir
+ install -d -m 0755 -o root -g root $(CURDIR)/debian/bugzilla/etc/bugzilla/sites
# remove all the CVS entries in the build dir
find ./debian -name CVS -type d -exec rm -rf {} \;