--- rails-2.2.3.orig/rails
+++ rails-2.2.3/rails
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+# On no parameters, we display the manpage
+if [ "x$1" = "x" ]; then
+	exec man rails
+fi
+
+TEMP=`getopt -o dCFD:I: --long no-docs,copy,force-overwrite,database:,internal: -- "$@"`
+if [ $? != 0 ]; then 
+	echo "Terminating..." >&2
+	exit 1
+fi
+
+eval set -- "$TEMP"
+COPY="false"
+DOCUMENTATION="true"
+OVERWRITE_OPTION=""
+DATABASE="sqlite3"
+INTERNAL_OPTIONS=""
+
+while true; do
+    case "$1" in
+        -d|--no-docs)
+            DOCUMENTATION="false"
+            ;;
+        -C|--copy)
+            COPY="true"
+            ;;
+        -F|--force-overwrite)
+            OVERWRITE_OPTION="--force"
+            ;;
+        -D|--database)
+            case "$2" in
+                mysql|oracle|postgresql|sqlite3|frontbase|ibm_db)
+                   DATABASE=$2
+                   ;;
+                *)
+                   echo "Bad database name. Supported values are mysql, oracle, postgresql, sqlite3, frontbase and ibm_db"
+                   exit 1
+                   ;;
+            esac
+            shift
+            ;;
+        -I|--internal)
+            INTERNAL_OPTIONS="$2"
+            shift
+            ;;
+        --)
+            shift
+            break
+            ;;
+        *)
+            echo "Internal error"
+            exit 1
+            ;;
+	esac
+	shift
+done
+
+CWD="`pwd`"
+if [ "x$1" = "x" ]; then
+	exec man rails
+fi
+while [ "x$1" != "x" ]; do
+	if [ "${1:0:1}" = "/" ]; then
+		RAILS_PKG_DESTINATION="$1"
+	else
+		RAILS_PKG_DESTINATION="$CWD/$1"
+	fi
+	
+	# Install/upgrade core rails
+        /usr/bin/ruby /usr/share/rails/railties/bin/rails ${OVERWRITE_OPTION} "${RAILS_PKG_DESTINATION}" "${INTERNAL_OPTIONS}" -d $DATABASE
+        
+	# Create/update the vendor directory
+        if [ "x${COPY}" = "xtrue" ]; then
+            rm -rf "${RAILS_PKG_DESTINATION}"/vendor/*
+            cp -a /usr/share/rails/* "${RAILS_PKG_DESTINATION}/vendor/"
+
+            # We need a rails -> . link in the vendor directory - breaks eclipse
+            ln -s . "${RAILS_PKG_DESTINATION}/vendor/rails"
+        else
+            rm -rf ${RAILS_PKG_DESTINATION}/vendor/*
+            ln -s /usr/share/rails/* "${RAILS_PKG_DESTINATION}/vendor/"
+
+            # We need a rails -> . link in the vendor directory
+            ln -s /usr/share/rails "${RAILS_PKG_DESTINATION}/vendor/rails"
+        fi
+
+	## We need a rails -> . link in the vendor directory
+	# ln -s . "${RAILS_PKG_DESTINATION}/vendor/rails"
+
+	# link to docs, if needed
+        if [ "x${DOCUMENTATION}" = "xtrue" ]; then
+            rm -rf "${RAILS_PKG_DESTINATION}/doc/api"
+            if [ "x${COPY}" = "xtrue" ]; then
+                mkdir "${RAILS_PKG_DESTINATION}/doc/api"
+                cp -a /usr/share/doc/rails/html/* "${RAILS_PKG_DESTINATION}/doc/api/"
+            else
+                ln -s /usr/share/doc/rails/html "${RAILS_PKG_DESTINATION}/doc/api"
+            fi
+        fi
+        
+	shift
+done
+exit 0
--- rails-2.2.3.orig/fix-ruby-path
+++ rails-2.2.3/fix-ruby-path
@@ -0,0 +1,15 @@
+#!/usr/bin/ruby
+
+ARGV.each{ |file| 
+  next if !File::exists?( file )
+  f = File::open( file )
+  data = f.readlines
+  m = /#!.*ruby(.*)/.match( data[0])
+  next if !m or m[0][0..14] == '#!/usr/bin/ruby'
+  f.close
+  f.reopen( file, 'w' )
+  rargs = ''
+  rargs = m[1] if m and m[1]
+  f.write( "#!/usr/bin/ruby#{rargs}\n\n" )
+  f.write( data )
+}
--- rails-2.2.3.orig/rails-app-debianize
+++ rails-2.2.3/rails-app-debianize
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# Add links to Debian's rails libraries to a rails app
+
+if [ ! -e vendor ]; then
+  echo "Please change to the root directory of your rails application,"
+  echo "possibly create the vendor/ directory there and re-execute this"
+  echo "script"
+else
+  cd vendor
+  ln -s /usr/share/rails
+  for lib in `ls /usr/share/rails`; do
+    ln -s /usr/share/rails/$lib
+  done
+fi
--- rails-2.2.3.orig/activesupport/test/abstract_unit.rb
+++ rails-2.2.3/activesupport/test/abstract_unit.rb
@@ -23,7 +23,9 @@
 # Wrap tests that use Mocha and skip if unavailable.
 unless defined? uses_mocha
   def uses_mocha(test_name, &block)
-    uses_gem('mocha', test_name, '>= 0.5.5', &block)
+    # uses_gem('mocha', test_name, '>= 0.5.5', &block)
+    require 'mocha'
+    yield
   end
 end
 
--- rails-2.2.3.orig/activesupport/lib/active_support/vendor.rb
+++ rails-2.2.3/activesupport/lib/active_support/vendor.rb
@@ -1,16 +1,17 @@
 # Prefer gems to the bundled libs.
+begin
 require 'rubygems'
 
 begin
   gem 'builder', '~> 2.1.2'
 rescue Gem::LoadError
-  $:.unshift "#{File.dirname(__FILE__)}/vendor/builder-2.1.2"
+  require 'builder'
 end
 
 begin
   gem 'xml-simple', '~> 1.0.11'
 rescue Gem::LoadError
-  $:.unshift "#{File.dirname(__FILE__)}/vendor/xml-simple-1.0.11"
+  require 'xmlsimple'
 end
 
 begin
@@ -31,4 +32,16 @@
 # rescue Gem::LoadError
   $:.unshift "#{File.dirname(__FILE__)}/vendor/i18n-0.0.1"
   require 'i18n'
-# end
\ No newline at end of file
+# end
+
+
+rescue LoadError # No rubygems
+  # Use Debian packaged versions and rails supplied packages
+  # for stuff we do not have in Debian, yet
+  require 'builder'
+  require 'xmlsimple'
+  $:.unshift "#{File.dirname(__FILE__)}/vendor/memcache-client-1.5.0"
+  $:.unshift "#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.11"
+  $:.unshift "#{File.dirname(__FILE__)}/vendor/i18n-0.0.1"
+  require 'i18n'
+end
--- rails-2.2.3.orig/activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb
+++ rails-2.2.3/activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb
@@ -30,7 +30,7 @@
 require 'socket'
 require 'thread'
 require 'timeout'
-require 'rubygems'
+# require 'rubygems'
 
 class String
 
--- rails-2.2.3.orig/actionmailer/test/abstract_unit.rb
+++ rails-2.2.3/actionmailer/test/abstract_unit.rb
@@ -48,7 +48,8 @@
 # Wrap tests that use Mocha and skip if unavailable.
 unless defined? uses_mocha
   def uses_mocha(test_name, &block)
-    uses_gem('mocha', test_name, '>= 0.5.5', &block)
+    # uses_gem('mocha', test_name, '>= 0.5.5', &block)
+    require 'mocha'
   end
 end
 
--- rails-2.2.3.orig/debian/README.Debian
+++ rails-2.2.3/debian/README.Debian
@@ -0,0 +1,72 @@
+Rails On Debian
+----------------
+
+To get started with your own Rails application
+----------------------------------------------
+
+NOTE: DEST_DIR == destination directory (you choose!)
+
+
+1. Install rails into a working directry by running `rails DEST_DIR`.
+2. Run the WEBrick servlet from DEST_DIR: script/server (run with --help for
+   options)
+3. Go to http://localhost:3000/ and get "Congratulations, you've put Ruby on
+   Rails!"
+4. Follow the guidelines on the "Congratulations, you've put Ruby on Rails!"
+   screen
+
+Complete API reference is also available (if you deploy ruby with
+documentation) in DEST_DIR/doc/api/index.html and well as at
+ http://www.rubyonrails.com. 
+
+
+To run a non-packaged Rails application
+---------------------------------------
+
+Debian puts all Ruby and Rails libraries into Debian Packages. Theses get
+installed at FHS compliant locations.
+
+In the case of Rails libraries under:
+
+  /usr/share/rails/
+
+In the case of Ruby libraries under:
+
+  /usr/lib/ruby/1.8/
+  /usr/lib/ruby/1.9/
+
+Non-packaged Rails applications normaly use `gem` to dynamically load the
+classes and modules they need. However `gem` does not know about the
+libraries provided by Debian and thus starting the application will fail
+with a message like the following:
+
+  $ ./script/server
+  Missing the Rails 2.0.2 gem. Please `gem install -v=2.0.2 rails`, update
+  your RAILS_GEM_VERSION setting in config/environment.rb for the Rails
+  version you do have installed, or comment out RAILS_GEM_VERSION to use the
+  latest version installed.
+
+The solution that Debian uses when its `rails` tool wrapper is used to create
+a new rails application is to add references to Debian's packaged libraries
+to the created Rails application. Thus:
+
+  $ rails my_project
+
+will create this:
+
+  $ ls -l my_project/vendor
+  lrwxrwxrwx 1 joe joe 29 2008-09-16 20:50 actionmailer -> /usr/share/rails/actionmailer
+  lrwxrwxrwx 1 joe joe 27 2008-09-16 20:50 actionpack -> /usr/share/rails/actionpack
+  lrwxrwxrwx 1 joe joe 28 2008-09-16 20:50 active_ldap -> /usr/share/rails/active_ldap
+  lrwxrwxrwx 1 joe joe 28 2008-09-16 20:50 activemodel -> /usr/share/rails/activemodel
+  lrwxrwxrwx 1 joe joe 29 2008-09-16 20:50 activerecord -> /usr/share/rails/activerecord
+  lrwxrwxrwx 1 joe joe 31 2008-09-16 20:50 activeresource -> /usr/share/rails/activeresource
+  lrwxrwxrwx 1 joe joe 30 2008-09-16 20:50 activesupport -> /usr/share/rails/activesupport
+  lrwxrwxrwx 1 joe joe 16 2008-09-16 20:50 rails -> /usr/share/rails
+  lrwxrwxrwx 1 joe joe 25 2008-09-16 20:50 railties -> /usr/share/rails/railties
+
+You can use the command rails-app-debianize to create those links.
+
+
+ -- Adam Majer <adamm@zombino.com>, Fri,  7 Mar 2005
+ -- Tomas Pospisek <tpo_deb@sourcepole.ch>, Thu, 16 Sep 2008
--- rails-2.2.3.orig/debian/copyright
+++ rails-2.2.3/debian/copyright
@@ -0,0 +1,29 @@
+This package was debianized by Adam Majer <adamm@zombino.com> on
+Fri,  4 Feb 2005 21:20:52 -0600.
+
+It was downloaded from http://www.rubyonrails.com.
+
+Upstream Author: David Heinemeier Hansson <david@loudthinking.com>
+
+
+Copyright (c) 2004 David Heinemeier Hansson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
--- rails-2.2.3.orig/debian/lintian.overrides
+++ rails-2.2.3/debian/lintian.overrides
@@ -0,0 +1,52 @@
+rails: extra-license-file usr/share/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE
+rails: script-not-executable ./usr/share/rails/railties/test/webrick_dispatcher_test.rb
+rails: script-not-executable ./usr/share/rails/railties/dispatches/dispatch.fcgi
+rails: script-not-executable ./usr/share/rails/railties/dispatches/dispatch.rb
+rails: script-not-executable ./usr/share/rails/railties/bin/breakpointer
+rails: script-not-executable ./usr/share/rails/railties/bin/console
+rails: script-not-executable ./usr/share/rails/railties/bin/update
+rails: script-not-executable ./usr/share/rails/railties/bin/server
+rails: script-not-executable ./usr/share/rails/railties/bin/breakpointer_for_gem
+rails: script-not-executable ./usr/share/rails/railties/bin/destroy
+rails: script-not-executable ./usr/share/rails/railties/bin/generate
+rails: script-not-executable ./usr/share/rails/actionpack/lib/action_controller/session/drb_server.rb
+rails: script-not-executable ./usr/share/rails/actionpack/lib/action_view/vendor/builder/blankslate.rb
+rails: script-not-executable ./usr/share/rails/actionpack/lib/action_view/vendor/builder/xmlmarkup.rb
+rails: script-not-executable ./usr/share/rails/actionpack/lib/action_view/vendor/builder/xmlevents.rb
+rails: script-not-executable ./usr/share/rails/actionpack/lib/action_view/vendor/builder/xmlbase.rb
+rails: script-not-executable ./usr/share/rails/actionpack/lib/action_view/vendor/builder.rb
+rails: script-not-executable ./usr/share/rails/actionpack/examples/address_book_controller.cgi
+rails: script-not-executable ./usr/share/rails/actionpack/examples/blog_controller.cgi
+rails: script-not-executable ./usr/share/rails/actionpack/examples/debate_controller.cgi
+rails: script-not-executable ./usr/share/rails/actionpack/examples/address_book_controller.fcgi
+rails: script-not-executable ./usr/share/rails/actionpack/examples/address_book_controller.rbx
+rails: script-not-executable ./usr/share/rails/actionpack/examples/benchmark_with_ar.fcgi
+rails: script-not-executable ./usr/share/rails/actionwebservice/test/gencov
+rails: script-not-executable ./usr/share/rails/actionwebservice/test/run
+rails: script-not-executable ./usr/share/rails/activerecord/test/all.sh
+rails: script-not-executable ./usr/share/rails/activemodel/Rakefile
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/multibyte/generators/generate_tables.rb
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder.rb
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb
+rails: script-not-executable ./usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb
+rails: script-not-executable ./usr/share/rails/railties/bin/about
+rails: script-not-executable ./usr/share/rails/railties/bin/performance/benchmarker
+rails: script-not-executable ./usr/share/rails/railties/bin/performance/profiler
+rails: script-not-executable ./usr/share/rails/railties/bin/performance/request
+rails: script-not-executable ./usr/share/rails/railties/bin/plugin
+rails: script-not-executable ./usr/share/rails/railties/bin/process/inspector
+rails: script-not-executable ./usr/share/rails/railties/bin/process/reaper
+rails: script-not-executable ./usr/share/rails/railties/bin/process/spawner
+rails: script-not-executable ./usr/share/rails/railties/bin/runner
+rails: script-not-executable ./usr/share/rails/railties/dispatches/gateway.cgi
+rails: wrong-path-for-ruby ./usr/share/rails/railties/dispatches/gateway.cgi #!/usr/local/bin/ruby
+rails: script-not-executable ./usr/share/rails/railties/lib/commands/ncgi/listener
+rails: wrong-path-for-ruby ./usr/share/rails/railties/lib/commands/ncgi/listener #!/usr/local/bin/ruby
+rails: script-not-executable ./usr/share/rails/railties/lib/commands/ncgi/tracker
+rails: wrong-path-for-ruby ./usr/share/rails/railties/lib/commands/ncgi/tracker #!/usr/local/bin/ruby
+rails: script-not-executable ./usr/share/rails/railties/lib/commands/performance/request.rb
--- rails-2.2.3.orig/debian/rules
+++ rails-2.2.3/debian/rules
@@ -0,0 +1,89 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+configure:
+
+build: build-stamp
+
+build-stamp:
+	# Generate documentation
+	mkdir build
+	cd railties; RAILS_PKG_DESTINATION="`pwd`/../build" rake fresh_rails
+	cp -r railties/configs/databases build/config
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	dh_clean 
+	rm -rf build build-stamp
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	# Copy HTML documentation
+	cp -r build/doc/api debian/rails/usr/share/doc/rails/html
+
+	# Install railties
+	cp -r railties ac* debian/rails/usr/share/rails/
+	for i in `find debian/rails/usr/share/rails -type f`; do chown root:root $$i; chmod 0644 $$i; done
+	for i in `find debian/rails/usr/share/rails -type d`; do chown root:root $$i; done
+	for i in actionmailer activerecord actionpack railties activesupport activeresource; do \
+		ln -s ../../rails/$$i/CHANGELOG debian/rails/usr/share/doc/rails/changelog.$$i; \
+		ln -s ../../rails/$$i/README    debian/rails/usr/share/doc/rails/README.$$i; \
+		rm -f debian/rails/usr/share/rails/$$i/MIT-LICENSE; \
+	done
+	# rm -r debian/rails/usr/share/rails/actionmailer/lib/action_mailer/vendor/tmail*
+	ln -s ../../rails/activesupport/CHANGELOG debian/rails/usr/share/doc/rails/changelog.activesupport; \
+	install -o root -g root -m 0755 rails debian/rails/usr/bin
+	install -o root -g root -m 0755 rails-app-debianize debian/rails/usr/bin
+	install -o root -g root -m 0644 debian/lintian.overrides debian/rails/usr/share/lintian/overrides/rails
+	ln -s ../../rails/railties/configs debian/rails/usr/share/doc/rails/configs
+
+	# link to Debian's prototype.js instead of upstream's
+	rm debian/rails/usr/share/rails/railties/html/javascripts/prototype.js
+	ln -s /usr/share/javascript/prototype/prototype.js debian/rails/usr/share/rails/railties/html/javascripts/prototype.js
+
+	# Remove builder and xml-simple as we depend on Debian's packaged versions now
+	# instead of bundled stuff
+	rm -r debian/rails/usr/share/rails/activesupport/lib/active_support/vendor/xml-simple-1.0.11
+	rm -r debian/rails/usr/share/rails/activesupport/lib/active_support/vendor/builder-2.1.2
+
+	# remove some Git files from installation
+	find debian/rails/usr -type f -regex '.*\/\.gitignore$$' -delete
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb -- -Z bzip2
+
+# Build architecture-dependent files here.
+binary-arch: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- rails-2.2.3.orig/debian/changelog
+++ rails-2.2.3/debian/changelog
@@ -0,0 +1,500 @@
+rails (2.2.3-1~bpo50+1) lenny-backports; urgency=low
+
+  * Rebuild for lenny-backports.
+
+ -- Matt Taggart <taggart@debian.org>  Wed, 16 Sep 2009 04:13:00 +0000
+
+rails (2.2.3-1) unstable; urgency=high
+
+  * New upstream release (closes: #545063)
+    + Fixes XSS security hole [CVE-2009-3009]
+    + Fixes timing issue with cookie store [CVE-2009-3086]
+  * Remove dependency on ruby-dbi, as it is not required by any of the
+    sources.
+  * Correct dependency on fixed libxml-simple-ruby to 1.0.11-2 or later
+    (closes: #538982)
+  * debian/control
+    + Change section from web to ruby
+    + Updated to debhelper 7.0+
+    + Standards updated to 3.8.3 - no changes
+
+ -- Adam Majer <adamm@zombino.com>  Fri, 11 Sep 2009 13:53:42 -0500
+
+rails (2.2.2-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Build-depends on rubygems. (Closes: #522009)
+
+ -- Tiago Bortoletto Vaz <tiago@debian-ba.org>  Thu, 18 Jun 2009 11:41:19 -0300
+
+rails (2.2.2-1) unstable; urgency=low
+
+  * New upstream release (closes: #510580, 510580)
+     + fixes the problem with migration with symbolic field types 
+       (closes: #511860) 
+  * debian/control:
+     + Depend on Rake 0.8.3 or later
+     + Build-Depends-Indep on libmocha-ruby for unit tests
+     + Move most of the build dependencies to Build-Depends-Indep
+     + Remove the predepends as Lenny is released
+  * Load XMLSimple without specifying a path (closes: #514582)
+  * Add an explanation how to configure non-packaged rails adds to work
+    with Debian version of rails. Also include a tiny script to help in
+    this effort. Tomas Pospisek provided the patch. (closes: #499187)
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 03 Mar 2009 12:40:53 -0600
+
+rails (2.1.0-5) unstable; urgency=high
+
+  * Sanitize the URLs passed to redirect_to to prevent a potential
+    response splitting attack. Patch from upstream.
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 19 Oct 2008 12:17:55 -0500
+
+rails (2.1.0-4) unstable; urgency=low
+
+  * Added a fix for binary data corruption with PostgreSQL backend. This
+    occurred whenever the binary data included ASCII value of \ followed
+    by three numbers.
+  * The fix in ActiveRecord to address SQL injection in :limit and :offset
+    was not complete. MySQL backend was still affected as it redefined the
+    problematic functions. Pulled in upstream patch. CVE-2008-4094
+    (closes: #500791)
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 23 Sep 2008 11:33:58 -0500
+
+rails (2.1.0-3) unstable; urgency=high
+
+  * Security fix pulled from upstream for a REXML expansion
+    DoS. (CVE-2008-3790)
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 09 Sep 2008 00:00:34 -0500
+
+rails (2.1.0-2) unstable; urgency=low
+
+  * Remove dependency on rubygems for the build process. (closes:
+    #490419)
+  * Use also use Debian supplied gems 'builder' and 'xml-simple'
+    instead of using the upstream's supplied version, which is
+    redundant.
+  * Remove extraneous depends on rubygems. It is already depended on
+    through libruby1.8-extras (closes: #491125)
+
+ -- Adam Majer <adamm@zombino.com>  Mon, 21 Jul 2008 12:14:08 -0500
+
+rails (2.1.0-1) unstable; urgency=low
+
+  * New upstream release
+    + No longer breaks with ruby 1.8.7 (closes: #484351)
+  * Use libjs-prototype prototype library instead of upstream 
+    bundled (closes: #475288)
+  * Added Vcs-* and Homepage data to debian/control
+  * doc-base section changed to 'Programming'
+
+ -- Adam Majer <adamm@zombino.com>  Fri, 04 Jul 2008 18:00:20 -0500
+
+rails (2.0.2-2) unstable; urgency=low
+
+  * Added upstream patch from ticket #11127 to support the newer
+    ruby-pg. (closes: #476449)
+  * Added dependency on rubygems (closes: #468206)
+  * Sqlite3 is now the default DB used, if another is not specified when
+    the project is initially created. (closes: #468803)
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 22 Apr 2008 13:21:16 -0500
+
+rails (2.0.2-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix FTBFS by replacing File.cp with a simple "cp" call. Patch by Michael
+    Schulte, thanks. (Closes: #464285)
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Sun, 09 Mar 2008 13:44:25 +0100
+
+rails (2.0.2-1) unstable; urgency=low
+
+  * New upstream release
+    + SQLite3 is now the default database, instead of MySQL
+    + [config/environments/production.rb] production mode will now
+    longer cache templates meaning they will load A LOT faster but for
+    any changes to appear, one will have to reload the entire
+    application.
+
+ -- Adam Majer <adamm@zombino.com>  Sat, 22 Dec 2007 22:22:59 -0600
+
+rails (2.0.1-2) unstable; urgency=low
+
+  * Added Pre-Depends on dpkg (>= 1.10.24) as a workaround to Debian
+    install scripts do not seem to be updated since beginning
+    of century. Can't upload bzip2 deb compressed deb without adding
+    this superfluous depend.
+  * Move libmocha-ruby1.8 from Depends to Recommends as it is only
+    needed for unit testing.
+  * Give in and depend on libruby1.8-extras. We need this to satisfy
+    dependencies on OpenSSL and the ever so popular rubygems, though
+    rails will continue to work if rubygems 'gem' fails.
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 18 Dec 2007 00:33:47 -0600
+
+rails (2.0.1-1) unstable; urgency=low
+
+  * New upstream release (closes: #454909)
+     + ActionWebservice is no more - rolled into ActionResource
+     + SOAP support removed
+  * Use bzip2 to compress the deb, instead of the default (gzip)
+  * Update Standards version to 3.7.3 - no changes needed
+  * Added a lot more exceptions to lintian checks - rails does not
+    need all script executable.
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 11 Dec 2007 18:48:45 -0600
+
+rails (1.2.6-1) unstable; urgency=high
+
+  * New upstream release
+    + Fixes a previous session-fixation attack vector that was not
+    completely fixed (see 1.2.5-1 changelog) [CVE-2007-6077] (closes:
+    #452748)
+  * Use bash systax in bash script instead of ruby syntax. Fixes the
+    -I/--internal parameter so one can pass switches directly to the
+    upstream rails ruby script (closes: #381295, #390886)
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 27 Nov 2007 22:22:34 -0600
+
+rails (1.2.5-1) unstable; urgency=low
+
+  * This is a new upstream release that addresses problems not
+    corrected in 1.2.4 or regressions.
+    + to_json XSS [CVE-2007-3227] is really closed now
+    + Potential Information Disclosure or DoS with Hash#from_xml
+      [CVE-2007-5379]
+    + Session Fixation attacks. [CVE-2007-5380] URL based sessions are
+    now disabled by default. Session ids are  only accepted from
+    cookies by default now.
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 14 Oct 2007 21:12:34 -0500
+
+rails (1.2.4-1) unstable; urgency=low
+
+  * New upstream release. Fixes at least 2 XSS bugs.
+    + Secure #sanitize, #strip_tags, and #strip_links helpers against
+    xss attacks. Upstream changeset 7589
+    + to_json did not escape values which allows for XSS. Applied
+    upstream changesets 6893, 6894. This bug as also been assigned
+    designation CVE-2007-3227 (closes: #429177)
+  * Add dependency on Sqlite3 as ActiveRecord supports this DB as
+    well
+  * Add dependency on libmocha which is needed by some unit tests
+
+ -- Adam Majer <adamm@zombino.com>  Mon, 08 Oct 2007 11:27:25 -0500
+
+rails (1.2.3-2) unstable; urgency=low
+
+  * Add mojo for doc-base document registration thanks to the patch by
+    Remi Vanicat. (closes: 386689)
+  * Upload to Sid now that Etch is out
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 06 May 2007 17:31:29 -0500
+
+rails (1.2.3-1) experimental; urgency=low
+
+  * New upstream release
+
+ -- Adam Majer <adamm@zombino.com>  Mon, 19 Mar 2007 13:36:52 -0500
+
+rails (1.2.2-2) experimental; urgency=low
+
+  * We cannot remove the link vendor/rails, but we can point it so it
+    is not recursive. Recursive links seem to break eclipse and lack
+    of vendor/rails breaks rails. 
+    The link target will create a non-recursive link, but a rails
+    deployment that copies the rails directories will still contain
+    recursive symlink. The problem is really in Eclipse though. It
+    should handle recursive symlinks.
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 20 Feb 2007 13:22:24 -0600
+
+rails (1.2.2-1) experimental; urgency=low
+
+  * New upstream release (closes: #408688)
+  * Remove link that crashes eclipse (closes: #405344)
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 20 Feb 2007 12:08:03 -0600
+
+rails (1.1.6-3) unstable; urgency=low
+
+  * Remove the 12_options patch which actually breaks select. 
+    (closes: #406658)
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 14 Jan 2007 12:41:58 -0600
+
+rails (1.1.6-2) unstable; urgency=low
+
+  * [12_options] Fixes inconsistent behavior of select helper
+    functions.
+  * Added libfcgi-ruby1.8 to Suggests
+  * Conflict with libdevel-logger-ruby1.8 until after Etch is released
+    (closes: #405555)
+
+ -- Adam Majer <adamm@zombino.com>  Thu, 11 Jan 2007 00:01:34 -0600
+
+rails (1.1.6-1) unstable; urgency=emergency
+
+  * New upstream 'security hole fix' release
+    + This one fixes the fix in 1.1.5 as that one was still
+    vulnerable. (closes: #382255)
+
+ -- Adam Majer <adamm@zombino.com>  Thu, 10 Aug 2006 13:43:01 -0500
+
+rails (1.1.5-1) unstable; urgency=emergency
+
+  * New upstream release
+     + Fixes a remote security hole [Bugtraq 19454]
+
+ -- Adam Majer <adamm@zombino.com>  Thu, 10 Aug 2006 10:50:13 -0500
+
+rails (1.1.4-2) unstable; urgency=low
+
+  * Change default listening socket to 127.0.0.1 from 0.0.0.0
+
+ -- Adam Majer <adamm@zombino.com>  Thu, 27 Jul 2006 21:56:53 -0500
+
+rails (1.1.4-1) unstable; urgency=low
+
+  * New upstream release
+  * Moved build-depends-indep to build-depends to prevent build
+    failures.
+
+ -- Adam Majer <adamm@zombino.com>  Mon, 10 Jul 2006 14:06:08 -0500
+
+rails (1.1.2-1) unstable; urgency=low
+
+  * New upstream release
+  * Added support to specify database name (using -D) and to specify
+    options that will be passed to rails script directly (-I). Added
+    these to manpage as well. (closes: #361990)
+  * Depend and build-depend on rake >7.0 (closes: #362890)
+  * Updated standards to version 3.7.2. No changes.
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 14 May 2006 01:08:49 -0500
+
+rails (1.1.0release-1) unstable; urgency=low
+
+  * New upstream release
+  * Added a link to railties/config directory as an example of
+    configuration files
+
+ -- Adam Majer <adamm@zombino.com>  Tue,  4 Apr 2006 14:05:04 -0500
+
+rails (1.1.0rc1-2) unstable; urgency=low
+
+  * Fixed a problem that prevents rails from creating new projects
+    thanks to Nobuhiro IMAI (closes: #359227)
+
+ -- Adam Majer <adamm@zombino.com>  Mon, 27 Mar 2006 11:13:21 -0600
+
+rails (1.1.0rc1-1) unstable; urgency=low
+
+  * New upstream version.
+    + Fixes FTBFS with new rdoc (closes: #357011)
+  * Changed vendor/rails link to be relative, not absolute when first
+    created.
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 26 Mar 2006 00:23:24 -0600
+
+rails (1.0.0-2) unstable; urgency=low
+
+  * Applied a patch to correctly set rdoc options. (closes: #357001)
+
+ -- Adam Majer <adamm@zombino.com>  Sat, 25 Mar 2006 21:02:26 -0600
+
+rails (1.0.0-1) unstable; urgency=low
+
+  * New upstream release
+     + Now handles multiple databases (closes: #341496)
+  * Modified Suggests: to include mod_fcgid (closes: #339953)
+
+ -- Adam Majer <adamm@zombino.com>  Thu, 15 Dec 2005 12:40:38 -0600
+
+rails (0.14.3-1) unstable; urgency=low
+
+  * New upstream release
+  * Modified Suggests: to include mod-ruby for Apache2 users. (closes:
+    #331233)
+  * Build-Depend on rake > 0.6.0 (closes: #333700)
+  * /usr/bin/rails now creates a rails->. symlink in vendor directory. This is
+    needed to sidestep the gems requirements
+
+ -- Adam Majer <adamm@zombino.com>  Thu, 13 Oct 2005 18:38:16 -0500
+
+rails (0.13.1-2) unstable; urgency=low
+
+  * Fixed logger problems such that it works with both 1.8.2 and 1.8.3
+    (closes: #330400). Upstream changes are:
+       + Fixed clean logger to work with Ruby 1.8.3 Logger class (#2245)
+       + Clean logger is compatible with both 1.8.2 and 1.8.3 Logger. (#2263)
+       [Michael Schuerig <michael@schuerig.de>]
+
+ -- Adam Majer <adamm@zombino.com>  Thu, 29 Sep 2005 16:24:22 -0500
+
+rails (0.13.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Adam Majer <adamm@zombino.com>  Mon, 11 Jul 2005 10:22:39 -0500
+
+rails (0.13.0-1) unstable; urgency=low
+
+  * New upstream release
+    + Fixes problem with action web service (closes: #317044)
+  * Remove an unnecessary depend on libtest-unit-ruby (closes: #315254)
+  * Updated standards to 3.6.2
+
+ -- Adam Majer <adamm@zombino.com>  Wed,  6 Jul 2005 18:59:12 -0500
+
+rails (0.12.1-2) unstable; urgency=low
+
+  * Enabled patch supporting PostgreSQL schemas
+  * Added routing patch (upstream patch 1375). This patch changes routing such
+    that the longest possible path is matched against the controller, not the
+    first possible path.
+
+ -- Adam Majer <adamm@zombino.com>  Mon, 30 May 2005 11:47:51 -0500
+
+rails (0.12.1-1) unstable; urgency=low
+
+  * New upstream release. Packaged SVN changeset 1234 as rails 0.12.1 due to
+    lack of upstream tag (closes: #306389)
+  * Added some upstream patches
+     + Fixed acts_as_list where deleting an item that was removed from the
+       list would ruin the positioning of other list items #1197 [Jamis Buck]
+     + This patch adds new options `encoding' and `min_messages' to
+       database.yml for PostgreSQL
+     + Patch removing extraneous comma in count() (#1156)
+
+ -- Adam Majer <adamm@zombino.com>  Wed, 27 Apr 2005 20:55:32 -0500
+
+rails (0.12.0-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 19 Apr 2005 14:17:17 -0500
+
+rails (0.11.1-3) unstable; urgency=low
+
+  * Turned off ActiveRecord::Base.@@colorize_logging. Colorized logs are
+    difficult to view on any other than background than black and difficult to
+    parse.
+
+ -- Adam Majer <adamm@zombino.com>  Mon, 18 Apr 2005 17:01:18 -0500
+
+rails (0.11.1-2) unstable; urgency=low
+
+  * Fixed the Inflector patch
+
+ -- Adam Majer <adamm@zombino.com>  Wed, 30 Mar 2005 17:29:29 -0600
+
+rails (0.11.1-1) unstable; urgency=low
+
+  * New upstream release
+  * Added some patches (submitted upstream to #950, #962) that should add
+    support for PostgreSQL schemas to Fixtures as well as to enable static
+    mapping between table names and classes using set_table_name (only set in
+    Inflector if the name is not the one guessed).
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 27 Mar 2005 14:56:35 -0600
+
+rails (0.11.0-2) unstable; urgency=low
+
+  * Fix broken config/environment.rb to use "old" vendor directories.
+
+ -- Adam Majer <adamm@zombino.com>  Fri, 25 Mar 2005 01:28:05 -0600
+
+rails (0.11.0-1) unstable; urgency=low
+
+  * New upstream release
+     - Ajax, Pagination, Non-vhost, Incoming mail support
+  * Included tmail in the vendor distribution. Rails extended tmail with some
+    new code and Debian's distribution of tmail is not sufficient.
+
+ -- Adam Majer <adamm@zombino.com>  Wed, 23 Mar 2005 13:29:19 -0600
+
+rails (0.10.1-7) unstable; urgency=low
+
+  * Hmmmm. Fixed the missing Depends problem.. (closes: #300637)
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 20 Mar 2005 16:27:56 -0600
+
+rails (0.10.1-6) unstable; urgency=low
+
+  * Simplify depends. libruby >= 1.8.2-3 reduces the number of packages in the
+    archive. Thank you ruby mainteiners!
+
+ -- Adam Majer <adamm@zombino.com>  Tue, 15 Mar 2005 15:53:07 -0600
+
+rails (0.10.1-5) unstable; urgency=low
+
+  * Added rdoc to build depends thanks to Roland Stigge (closes: #299381)
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 13 Mar 2005 16:31:29 -0600
+
+rails (0.10.1-4) unstable; urgency=low
+
+  * Added libredcloth-ruby1.8 to Depends. Now if someone would package
+    bluecloth as well (hint, hint!)
+
+ -- Adam Majer <adamm@zombino.com>  Sat, 12 Mar 2005 00:52:26 -0600
+
+rails (0.10.1-3) unstable; urgency=low
+
+  * Rewrote /usr/bin/rails to accomodate updates
+     + /vendor and upstream documentation are now symlinks by default. -l
+     command line option was removed. This allows for automated updates to
+     latest rails.
+     + Added -C command line option one wants a copy of /vendor or rails
+     documentation instead of symlinks
+     + Added -F commend line option to force overwrite of user files during an
+     update
+  * Rails documentation is now pregenerated and located in
+    /usr/share/doc/rails/html.
+  * Added rake as a build dependecy
+
+ -- Adam Majer <adamm@zombino.com>  Fri, 11 Mar 2005 21:41:02 -0600
+
+rails (0.10.1-2) unstable; urgency=low
+
+  * Updated dependencies. All dependencies now checked. Some non-critical
+    ones like memcache are missing in Debian, but rails should be unaffected.
+
+ -- Adam Majer <adamm@zombino.com>  Mon,  7 Mar 2005 15:39:23 -0600
+
+rails (0.10.1-1) unstable; urgency=low
+
+  * New upstream release
+  * Fix more missing dependencies
+  * Removed bash>3 dependency in /usr/bin/rails script (closes: #298180)
+  * Added a watch file to monitor later upstream version. Not good for updates
+    though since upstream doesn't seem to have a true source tar.gz file.
+    Source distribution only available from tagged svn.
+  * Set default socket for MySQL to /var/run/mysqld/mysqld.sock thanks for a
+    patch from Alberto Brealey-Guzman (closes: #298258)
+
+ -- Adam Majer <adamm@zombino.com>  Sat,  7 Mar 2005 13:51:15 -0600
+
+rails (0.10.0-1) unstable; urgency=low
+
+  * New upstream release
+     + Adds web service support (actionwebservice)
+     + Adds URI routing to end the Apache mod_rewrite hell
+     + Added Oracle support. Rails now supports PostgreSQL, MySQL, SQLite,
+     MSSQL and Oracle database backends.
+     + and many bug fixes
+  * Fixed depend
+
+ -- Adam Majer <adamm@zombino.com>  Sun, 27 Feb 2005 20:52:29 -0600
+
+rails (0.9.5-1) unstable; urgency=low
+
+  * Initial Release (closes: #293055)
+
+ -- Adam Majer <adamm@zombino.com>  Fri,  4 Feb 2005 21:20:52 -0600
+
--- rails-2.2.3.orig/debian/watch
+++ rails-2.2.3/debian/watch
@@ -0,0 +1,8 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# Site		Directory		Pattern			Version	Script
+version=2
+http://rubyforge.org/frs/?group_id=307	.*/rails-(.*).tgz	debian
+
+##http://rubyforge.org/frs/?group_id=307	/frs/download.php/[^/]*/rails-([0-9\.]*)\.tgz	debian
--- rails-2.2.3.orig/debian/control
+++ rails-2.2.3/debian/control
@@ -0,0 +1,30 @@
+Source: rails
+Section: ruby
+Priority: optional
+Maintainer: Adam Majer <adamm@zombino.com>
+Build-Depends: debhelper (>= 7)
+Build-Depends-Indep: rake (>>0.8.3), rdoc (>>1.8.2), liberb-ruby,
+ libxml-simple-ruby (>=1.0.11-2), libbuilder-ruby (>>2.1.2), libmocha-ruby(>>0.6),
+ rubygems
+Standards-Version: 3.8.3
+Vcs-Browser: http://git.debian.org/?p=collab-maint/rails.git;a=summary
+Vcs-Git: git://git.debian.org/git/collab-maint/rails.git
+Homepage: http://rubyonrails.com
+
+Package: rails
+Architecture: all
+Depends: ${misc:Depends}, ruby, ruby1.8 (>=1.8.2-3), rake (>>0.8.3), rdoc (>>1.8.2), 
+ libsqlite3-ruby | libpgsql-ruby | libmysql-ruby, 
+ libredcloth-ruby | libredcloth-ruby1.8, liberb-ruby, libruby1.8-extras, libjs-prototype, 
+ libxml-simple-ruby (>=1.0.11-2), libbuilder-ruby (>>2.1.2)
+Recommends: irb, libmocha-ruby
+Conflicts: libdevel-logger-ruby1.8
+Suggests: libapache2-mod-ruby | libapache2-mod-fcgid, libfcgi-ruby | libfcgi-ruby1.8
+Description: MVC ruby based framework geared for web application development
+ Rails is a full-stack, open-source web framework in Ruby for writing
+ real-world applications.
+ .
+ Being a full-stack framework means that all layers are built to work
+ seamlessly together. That way you don't repeat yourself and you can
+ use a single language from top to bottom. Everything from templates to
+ control flow to business logic is written in Ruby.
--- rails-2.2.3.orig/debian/rails.doc-base
+++ rails-2.2.3/debian/rails.doc-base
@@ -0,0 +1,10 @@
+Document: rails
+Title: Ruby on Rails Refrence Manual
+Author: 
+Abstract: Reference Manual of Ruby On Rails, an MVC ruby based 
+ framework geared for web application development.
+Section: Programming
+
+Format: HTML
+Index: /usr/share/doc/rails/html/index.html
+Files: /usr/share/doc/rails/html/*.html
--- rails-2.2.3.orig/debian/rails.1
+++ rails-2.2.3/debian/rails.1
@@ -0,0 +1,51 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH RAILS 1 "February  12, 2005"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+rails \- Ruby on Rails deployment script
+.SH SYNOPSIS
+.B rails
+.RI [ options ] " destination(s)"  ...
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+.SH OPTIONS
+.TP
+.B \-d, \-\-no\-docs
+Deploys rails without any documentation.
+.TP
+.B \-C, \-\-copy
+Deploys rails by copying instead of linking vendor libraries.
+.TP
+.B \-F, \-\-force\-overwrite
+Overwrites all previously deployed files, if any.
+.TP
+.B \-D, \-\-database
+Specify the database to be used. Supported values are mysql, oracle, postgresql, sqlite3, 
+frontbase and ibm_db
+.TP
+.B \-I, \-\-internal
+Options to be passed to the upstream rails script.
+.SH SEE ALSO
+Full documentation of rails are available after Ruby On Rails is
+deployed. For getting started instructions, see /usr/share/doc/rails/README.Debian
+
+.SH AUTHOR
+The upstream author of Ruby On Rails is David Heinemeier Hansson
+<david@loudthinking.com>. This manual page was written by Adam Majer <adamm@zombino.com>,
+for the Debian project (but may be used by others).
--- rails-2.2.3.orig/debian/compat
+++ rails-2.2.3/debian/compat
@@ -0,0 +1 @@
+7
--- rails-2.2.3.orig/debian/dirs
+++ rails-2.2.3/debian/dirs
@@ -0,0 +1,4 @@
+usr/bin
+usr/share/rails
+usr/share/doc/rails
+usr/share/lintian/overrides
--- rails-2.2.3.orig/debian/rails.manpages
+++ rails-2.2.3/debian/rails.manpages
@@ -0,0 +1 @@
+debian/rails.1
\ No newline at end of file
--- rails-2.2.3.orig/activeresource/test/abstract_unit.rb
+++ rails-2.2.3/activeresource/test/abstract_unit.rb
@@ -21,6 +21,8 @@
 # Wrap tests that use Mocha and skip if unavailable.
 unless defined? uses_mocha
   def uses_mocha(test_name, &block)
-    uses_gem('mocha', test_name, '>= 0.5.5', &block)
+    # uses_gem('mocha', test_name, '>= 0.5.5', &block)
+    require 'mocha'
+    yield
   end
 end
--- rails-2.2.3.orig/railties/Rakefile
+++ rails-2.2.3/railties/Rakefile
@@ -1,7 +1,7 @@
 require 'rake'
 require 'rake/testtask'
 require 'rake/rdoctask'
-require 'rake/gempackagetask'
+# require 'rake/gempackagetask'
 require 'rake/contrib/rubyforgepublisher'
 
 require 'date'
@@ -155,7 +155,7 @@
 desc "Link in all the Rails packages to vendor"
 task :link_vendor_libraries do
   mkdir File.join(PKG_DESTINATION, 'vendor', 'rails')
-  VENDOR_LIBS.each { |dir| ln_s File.join('..', '..', '..', dir), File.join(PKG_DESTINATION, 'vendor', 'rails', dir) }
+  VENDOR_LIBS.each { |dir| ln_s "/usr/share/rails/#{dir}", File.join(PKG_DESTINATION, 'vendor', 'rails', dir) }
 end
 
 
@@ -329,7 +329,7 @@
 end
 
 # Generate GEM ----------------------------------------------------------------------------
-
+=begin
 task :copy_gem_environment do
   cp "environments/environment.rb", "#{PKG_DESTINATION}/config/environment.rb"
   chmod 0755, dest_file
@@ -409,3 +409,5 @@
   rubyforge.login
   rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
 end
+
+=end
--- rails-2.2.3.orig/railties/test/abstract_unit.rb
+++ rails-2.2.3/railties/test/abstract_unit.rb
@@ -9,8 +9,6 @@
 
 # Wrap tests that use Mocha and skip if unavailable.
 def uses_mocha(test_name)
-  require 'rubygems'
-  gem 'mocha', '>= 0.5.5'
   require 'mocha'
   yield
 rescue LoadError
--- rails-2.2.3.orig/railties/lib/commands/servers/webrick.rb
+++ rails-2.2.3/railties/lib/commands/servers/webrick.rb
@@ -4,7 +4,7 @@
 
 OPTIONS = {
   :port         => 3000,
-  :ip           => "0.0.0.0",
+  :ip           => "127.0.0.1",
   :environment  => (ENV['RAILS_ENV'] || "development").dup,
   :server_root  => File.expand_path(RAILS_ROOT + "/public/"),
   :server_type  => WEBrick::SimpleServer,
@@ -25,7 +25,7 @@
           "Default: 3000") { |v| OPTIONS[:port] = v }
   opts.on("-b", "--binding=ip", String,
           "Binds Rails to the specified ip.",
-          "Default: 0.0.0.0") { |v| OPTIONS[:ip] = v }
+          "Default: 127.0.0.1") { |v| OPTIONS[:ip] = v }
   opts.on("-e", "--environment=name", String,
           "Specifies the environment to run this server under (test/development/production).",
           "Default: development") { |v| OPTIONS[:environment] = v }
--- rails-2.2.3.orig/activemodel/test/test_helper.rb
+++ rails-2.2.3/activemodel/test/test_helper.rb
@@ -19,7 +19,9 @@
 # Wrap tests that use Mocha and skip if unavailable.
 unless defined? uses_mocha
   def uses_mocha(test_name, &block)
-    uses_gem('mocha', test_name, '>= 0.5.5', &block)
+    # uses_gem('mocha', test_name, '>= 0.5.5', &block)
+    require 'mocha'
+    yield
   end
 end
 
--- rails-2.2.3.orig/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ rails-2.2.3/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -469,7 +469,7 @@
         unescape_col = []
         for j in 0...res.nfields do
           # unescape string passed BYTEA field (OID == 17)
-          unescape_col << ( res.ftype(j)==17 )
+          unescape_col << ( res.fformat(j)==0 and res.ftype(j)==17 )
         end
 
         ary = []
