From 6f32288f7b7c8fbd0278ca4f23021f6c5cb89083 Mon Sep 17 00:00:00 2001 From: rafan Date: Sun, 24 Jun 2007 15:14:54 +0000 Subject: - Add missing patch for MULTIPLE_INSTANCES PR: ports/112287 Submitted by: Sergey Prikhodko Approved by: Vivek Khera (maintainer) --- www/rt36/Makefile | 3 ++ www/rt36/files/multiple-bin-webmux_pl_in | 15 ++++++ www/rt36/files/multiple-lib-RT_pm_in | 63 +++++++++++++++++++++++ www/rt36/files/multiple-sbin-rt-setup-database_in | 21 ++++++++ 4 files changed, 102 insertions(+) create mode 100644 www/rt36/files/multiple-bin-webmux_pl_in create mode 100644 www/rt36/files/multiple-lib-RT_pm_in create mode 100644 www/rt36/files/multiple-sbin-rt-setup-database_in (limited to 'www/rt36') diff --git a/www/rt36/Makefile b/www/rt36/Makefile index d53266368b51..ed9c7aa999c2 100644 --- a/www/rt36/Makefile +++ b/www/rt36/Makefile @@ -108,6 +108,9 @@ BUILD_DEPENDS+= ${LOCALBASE}/libexec/apache/libperl.so:${PORTSDIR}/www/mod_perl ${SITE_PERL}/${PERL_ARCH}/Apache/Request.pm:${PORTSDIR}/www/p5-libapreq .endif .endif +.if defined(MULTIPLE_INSTANCES) +EXTRA_PATCHES+= ${FILESDIR}/multiple* +.endif DB_TYPE?= mysql diff --git a/www/rt36/files/multiple-bin-webmux_pl_in b/www/rt36/files/multiple-bin-webmux_pl_in new file mode 100644 index 000000000000..0797718ee9a5 --- /dev/null +++ b/www/rt36/files/multiple-bin-webmux_pl_in @@ -0,0 +1,15 @@ +--- bin/webmux.pl.in.orig Tue Sep 26 18:06:31 2006 ++++ bin/webmux.pl.in Mon Apr 30 23:04:45 2007 +@@ -63,6 +63,12 @@ + } + + use lib ( "@LOCAL_LIB_PATH@", "@RT_LIB_PATH@" ); ++if ($ENV{RT_INSTANCE_PATH}) { ++ lib->import("$ENV{RT_INSTANCE_PATH}/local/lib"); ++} ++if ($ENV{RT_VENDOR_PATH}) { ++ lib->import($ENV{RT_VENDOR_PATH}); ++} + use RT; + + package RT::Mason; diff --git a/www/rt36/files/multiple-lib-RT_pm_in b/www/rt36/files/multiple-lib-RT_pm_in new file mode 100644 index 000000000000..0cbeb31f238c --- /dev/null +++ b/www/rt36/files/multiple-lib-RT_pm_in @@ -0,0 +1,63 @@ +--- lib/RT.pm.in.orig Mon Nov 6 21:09:32 2006 ++++ lib/RT.pm.in Mon Apr 30 23:04:45 2007 +@@ -98,6 +98,60 @@ + # via the web interface) + $MasonSessionDir = '@MASON_SESSION_PATH@'; + ++=item import ++ ++Allow override of various internal paths. ++ ++ RT->import ( ++ RT_INSTANCE_PATH => '/usr/local/rt/stuff', ++ SITE_CONFIG_FILE => '/etc/stuff.pm', ++ ... ++ ); ++ ++If RT_INSTANCE_PATH is set in the arguments (or in %ENV) ++then it replaces the old value of $BasePath in the following ++variables: ++ $SITE_CONFIG_FILE ++ $LocalPath ++ $LocalEtcPath ++ $LocalLexiconPath ++ $MasonLocalComponentRoot ++ $MasonDataDir ++ $MasonSessionDir ++ ++Beyond that, those individual values can be set explicitly ++by arguments. ++ ++=cut ++ ++sub import { ++no strict 'refs'; ++ shift; ++ my %args = @_; ++ return unless ( scalar (keys %args) || $ENV{RT_INSTANCE_PATH} ); ++ ++ my @variables = qw ( ++ SITE_CONFIG_FILE ++ LocalPath ++ LocalEtcPath ++ LocalLexiconPath ++ MasonLocalComponentRoot ++ MasonDataDir ++ MasonSessionDir ++ ); ++ ++ my $RT_INSTANCE_PATH = $args{RT_INSTANCE_PATH} || $ENV{RT_INSTANCE_PATH}; ++ if ($RT_INSTANCE_PATH) { ++ foreach my $vref (@variables) { ++ $$vref =~ s/^\Q$BasePath\E/$RT_INSTANCE_PATH/; ++ } ++ } ++ foreach my $vref (@variables) { ++ $$vref = $args{$vref} if defined ( $args{$vref} ); ++ } ++ ++use strict 'refs'; ++} + + + =head1 NAME diff --git a/www/rt36/files/multiple-sbin-rt-setup-database_in b/www/rt36/files/multiple-sbin-rt-setup-database_in new file mode 100644 index 000000000000..a4c38d484d2a --- /dev/null +++ b/www/rt36/files/multiple-sbin-rt-setup-database_in @@ -0,0 +1,21 @@ +--- sbin/rt-setup-database.in.orig Fri Dec 1 20:59:26 2006 ++++ sbin/rt-setup-database.in Mon Apr 30 23:04:45 2007 +@@ -51,11 +51,17 @@ + + use lib "@LOCAL_LIB_PATH@"; + use lib "@RT_LIB_PATH@"; ++## RT_INSTANCE_PATH can be passed in environment. ++## Can change where RT_SiteConfig is read from. ++my $RT_INSTANCE_PATH; ++BEGIN { ++ $RT_INSTANCE_PATH = $ENV{RT_INSTANCE_PATH}; ++} + + #This drags in RT's config.pm + # We do it in a begin block because RT::Handle needs to know the type to do its + # inheritance +-use RT; ++use RT (RT_INSTANCE_PATH => $RT_INSTANCE_PATH); + use Carp; + use RT::User; + use RT::CurrentUser; -- cgit