Description: Require the correct major version of RT
  to provide more helpful errors when the wrong version of RT is in @LIB
  (for example in a mod_perl context)
Author: Dominic Hargreaves <dom@earth.li>
Origin: https://github.com/bestpractical/rt/commit/24424172b1e276d291297abf8343eddd18480266
Bug: http://issues.bestpractical.com/Ticket/Display.html?id=15375
Bug: http://issues.bestpractical.com/Ticket/Display.html?id=16344
Bug-Debian: http://bugs.debian.org/518692

diff --git a/sbin/rt-server.in b/sbin/rt-server.in
index 45c3770..7a2b7ad 100755
--- a/sbin/rt-server.in
+++ b/sbin/rt-server.in
@@ -90,6 +90,8 @@ if (grep { m/help/ } @ARGV) {
 }
 
 require RT;
+die "Wrong version of RT $RT::Version found; need @RT_VERSION_MAJOR@.@RT_VERSION_MINOR@.*"
+    unless $RT::VERSION =~ /^@RT_VERSION_MAJOR@\.@RT_VERSION_MINOR@\./;
 RT->LoadConfig();
 RT->InitLogging();
 require Module::Refresh if RT->Config->Get('DevelMode');
