--- libgems-ruby-1.1.1.orig/debian/watch
+++ libgems-ruby-1.1.1/debian/watch
@@ -0,0 +1,6 @@
+# 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=3
+http://rubyforge.org/frs/?group_id=126	.*/rubygems-(.*).tgz	debian	uupdate	
--- libgems-ruby-1.1.1.orig/debian/libgems-ruby1.8.install
+++ libgems-ruby-1.1.1/debian/libgems-ruby1.8.install
@@ -0,0 +1,3 @@
+usr/bin/gem1.8
+usr/lib/ruby/1.8/
+var/lib/gems/1.8/
--- libgems-ruby-1.1.1.orig/debian/postinst
+++ libgems-ruby-1.1.1/debian/postinst
@@ -0,0 +1,17 @@
+#!/bin/sh -e
+# 
+
+case "$1" in
+  configure)
+        rm -f /var/lib/gems/1.8/source_cache
+        update-alternatives --quiet --install /usr/bin/gem gem \
+            /usr/bin/gem1.8 180 \
+	    --slave /usr/share/man/man1/gem.1.gz gem.1.gz \
+	    /usr/share/man/man1/gem1.8.1.gz \
+            --slave /etc/bash_completion.d/gem bash_completion_gem \
+            /etc/bash_completion.d/gem1.8
+       ;;
+  *)
+esac
+
+#DEBHELPER#
--- libgems-ruby-1.1.1.orig/debian/compat
+++ libgems-ruby-1.1.1/debian/compat
@@ -0,0 +1 @@
+4
--- libgems-ruby-1.1.1.orig/debian/control
+++ libgems-ruby-1.1.1/debian/control
@@ -0,0 +1,39 @@
+Source: libgems-ruby
+Section: interpreters
+Priority: optional
+Maintainer: Daigo Moriwaki <daigo@debian.org>
+Uploaders: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
+Build-Depends-Indep: dpatch (>= 2.0.10), debhelper (>= 4.0.0), ruby1.8, rdoc1.8, ruby-pkg-tools
+Standards-Version: 3.7.3
+Homepage: http://rubygems.org/
+
+Package: libgems-ruby1.8
+Architecture: all
+Depends: libruby1.8, rdoc1.8, libopenssl-ruby1.8
+Recommends: rubygems
+Description: libraries to use RubyGems, a package management framework
+ This is a way to package Ruby libraries/applications for distribution.
+ RubyGems provides the ability to manage concurrent versions of libraries and
+ dependencies between those libraries. Using RubyGems, you can:
+   * download and install Ruby libraries easily
+   * not worry about libraries A and B depending on different versions of
+     library C
+   * easily remove libraries you no longer use
+ .
+ This package contains RubyGems' libraries. The commands are included in
+ `rubygems' package.
+
+Package: rubygems
+Architecture: all
+Depends: ruby1.8, libgems-ruby1.8 (= ${source:Version}) 
+Suggests: ruby1.8-dev, build-essential
+Description: package management framework for Ruby libraries/applications
+ This is a way to package Ruby libraries/applications for distribution.
+ RubyGems provides the ability to manage concurrent versions of libraries and
+ dependencies between those libraries. Using RubyGems, you can:
+   * download and install Ruby libraries easily
+   * not worry about libraries A and B depending on different versions of
+     library C
+   * easily remove libraries you no longer use
+ .
+ This package contains RubyGems' commands like /usr/bin/gem.
--- libgems-ruby-1.1.1.orig/debian/rules
+++ libgems-ruby-1.1.1/debian/rules
@@ -0,0 +1,122 @@
+#!/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.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets  by Bill Allombert 2001
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+RAKE = /usr/bin/rake
+RUBY18 = /usr/bin/ruby1.8
+RUBY18LIBDIR = $(shell $(RUBY18) -rrbconfig -e "puts Config::CONFIG['rubylibdir']")
+
+config: config-stamp
+config-stamp:
+	dh_testdir
+
+	mkdir -p debian/tmp/var/lib/gems/1.8
+	touch config-stamp
+
+build: build-stamp
+build-stamp: patch config
+	dh_testdir
+
+	touch build-stamp
+ 
+clean:: clean1 unpatch
+clean1:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp config-stamp
+
+	# Add here commands to clean up after the build process.
+	dh_clean
+	rm -rf html
+
+	#rm -f pkgs/sources/sources-*.gem
+
+install:
+	$(RUBY18) setup.rb --no-rdoc --no-ri --prefix=debian/tmp
+	mkdir -p debian/tmp$(RUBY18LIBDIR)
+	find lib -name "*.rb" | xargs rdoc --fmt html --title RubyGems \
+	  --line-numbers --inline-source --main README -o html README TODO
+	mv debian/tmp/lib/* debian/tmp$(RUBY18LIBDIR)/
+	mv debian/tmp/bin debian/tmp/usr/
+	rm -f debian/tmp/usr/bin/update_rubygems*
+	
+	cp -r debian/etc debian/tmp/
+	
+	dh_testdir
+	dh_testroot
+	# dh_clean -k
+	dh_installdirs
+	
+	# DEBUG tree debian/tmp
+	dh_install --list-missing --sourcedir=debian/tmp
+	rm -rf debian/libgems-ruby1.8/usr/bin
+	#cp -ar docs debian/libgems-ruby1.8/usr/share/doc/libgems-ruby1.8/
+	#cp -ar test debian/libgems-ruby1.8/usr/share/doc/libgems-ruby1.8/
+
+# Build architecture-independent files here.
+binary-indep: build install
+	dh_testdir -i
+	dh_testroot -i
+	dh_installchangelogs ChangeLog
+	dh_installdocs -i
+	dh_installexamples -i
+#	dh_installmenu
+#	dh_installdebconf	
+#	dh_installlogrotate	
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+	dh_installman
+	dh_link -i
+	dh_strip -i
+	dh_compress -i 
+	dh_fixperms -i
+#	dh_perl
+#	dh_python
+#	dh_makeshlibs
+	dh_installdeb -i
+#	dh_shlibdeps
+	dh_gencontrol -i
+	dh_md5sums -i
+	dh_builddeb -i
+
+# Build architecture-dependent files here.
+binary-arch: build install 
+# We have nothing to do by default.
+
+# Build architecture independant packages using the common target.
+binary: binary-indep binary-arch
+	
+#binary: build install
+#	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-indep
+
+patch: patch-stamp
+patch-stamp:
+	dpatch apply-all
+	dpatch cat-all >patch-stamp
+	touch patch-stamp
+
+unpatch:
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
+
+
+.PHONY: build config patch unpatch clean clean1 binary-indep binary-arch binary install
+
--- libgems-ruby-1.1.1.orig/debian/gem1.8.1
+++ libgems-ruby-1.1.1/debian/gem1.8.1
@@ -0,0 +1,41 @@
+.TH GEM1.8 "1" "Dec 2007" "gem1.8 1.0.0" "User Commands"
+.SH NAME
+gem1.8 \- the front end to RubyGems
+.SH SYNOPSIS
+.IP
+gem1.8 command [arguments...] [options...]
+.IP
+gem1.8 \fB\-h\fR | \-\-help
+.IP
+gem1.8 \fB\-v\fR | \-\-version
+.fi
+.SH DESCRIPTION
+.B gem1.8
+is the front end to RubyGems, a sophisticated package manager for Ruby. This is a
+basic help message containing pointers to more information.
+.PP
+Further help:
+.TP
+gem1.8 help commands
+list all 'gem1.8' commands
+.TP
+gem1.8 help examples
+show some examples of usage
+.TP
+gem1.8 help <COMMAND>
+show help on COMMAND
+.IP
+(e.g. 'gem1.8 help install')
+.IP
+.PP
+Further information:
+.IP
+http://rubygems.org/
+.SH EXAMPLES
+.IP
+.nf
+gem1.8 install rake
+gem1.8 list \fB\-\-local\fR
+gem1.8 build package.gemspec
+gem1.8 help install
+.fi
--- libgems-ruby-1.1.1.orig/debian/prerm
+++ libgems-ruby-1.1.1/debian/prerm
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+
+case "$1" in
+    remove|deconfigure)
+        update-alternatives --quiet --remove gem /usr/bin/gem1.8
+        ;;
+    *)
+esac
+
+#DEBHELPER#
--- libgems-ruby-1.1.1.orig/debian/libgems-ruby1.8.dirs
+++ libgems-ruby-1.1.1/debian/libgems-ruby1.8.dirs
@@ -0,0 +1,2 @@
+usr/bin/
+var/lib/gems/1.8/
--- libgems-ruby-1.1.1.orig/debian/rubygems.manpages
+++ libgems-ruby-1.1.1/debian/rubygems.manpages
@@ -0,0 +1 @@
+debian/gem1.8.1
--- libgems-ruby-1.1.1.orig/debian/rubygems.install
+++ libgems-ruby-1.1.1/debian/rubygems.install
@@ -0,0 +1,2 @@
+usr/bin/gem1.8
+etc/bash_completion.d/gem1.8
--- libgems-ruby-1.1.1.orig/debian/copyright
+++ libgems-ruby-1.1.1/debian/copyright
@@ -0,0 +1,77 @@
+This package was debianized by Daigo Moriwaki <beatles@sgtpepper.net> on
+Sun, 21 Nov 2004 12:23:16 +0900.
+
+It was downloaded from http://rubyforge.org/projects/rubygems
+
+Upstream Authors: 
+
+Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others
+
+License: it can be found at http://rubyforge.org/projects/rubygems.
+
+Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.co.jp>.
+You can redistribute it and/or modify it under either the terms of the GPL
+(see COPYING.txt file), or the conditions below:
+
+  1. You may make and give away verbatim copies of the source form of the
+     software without restriction, provided that you duplicate all of the
+     original copyright notices and associated disclaimers.
+
+  2. You may modify your copy of the software in any way, provided that
+     you do at least ONE of the following:
+
+       a) place your modifications in the Public Domain or otherwise
+          make them Freely Available, such as by posting said
+	  modifications to Usenet or an equivalent medium, or by allowing
+	  the author to include your modifications in the software.
+
+       b) use the modified software only within your corporation or
+          organization.
+
+       c) rename any non-standard executables so the names do not conflict
+	  with standard executables, which must also be provided.
+
+       d) make other distribution arrangements with the author.
+
+  3. You may distribute the software in object code or executable
+     form, provided that you do at least ONE of the following:
+
+       a) distribute the executables and library files of the software,
+	  together with instructions (in the manual page or equivalent)
+	  on where to get the original distribution.
+
+       b) accompany the distribution with the machine-readable source of
+	  the software.
+
+       c) give non-standard executables non-standard names, with
+          instructions on where to get the original software distribution.
+
+       d) make other distribution arrangements with the author.
+
+  4. You may modify and include the part of the software into any other
+     software (possibly commercial).  But some files in the distribution
+     are not written by the author, so that they are not under this terms.
+
+     They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some
+     files under the ./missing directory.  See each file for the copying
+     condition.
+
+  5. The scripts and library files supplied as input to or produced as 
+     output from the software do not automatically fall under the
+     copyright of the software, but belong to whomever generated them, 
+     and may be sold commercially, and may be aggregated with this
+     software.
+
+  6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+     IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+     PURPOSE.
+
+-- 
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+
+debian/patches/22_add_bash_completion.dpatch
+Rubygems bash completion (c) Michael Schuerig, michael@schuerig.de, 2007-02-24
+Free for all uses.
--- libgems-ruby-1.1.1.orig/debian/rubygems.README.Debian
+++ libgems-ruby-1.1.1/debian/rubygems.README.Debian
@@ -0,0 +1,25 @@
+libgems-ruby for Debian
+-----------------------
+
+Some patches are applied to fit Debian FHS
+
+* Directory where gems are to be installed
+
+/var/lib/gems is used in Debian. However, you can override it by defining
+GEM_HOME environment variable. If you go with your GEM_HOME, some files should
+be manually installed.
+  $ cp -r /var/lib/gems/1.8/gems/sources-0.0.1 $GEM_HOME/gems/
+  $ cp    /var/lib/gems/1.8/specifications/sources-0.0.1.gemspec \
+          $GEM_HOME/specifications/
+Replace version numbers above with what you really have. 
+
+
+* Executables in gems
+
+Gems which Debian's RubyGems will install are stored at /var/lib/gems instead
+of /usr/lib/ruby/gems. Executables of the gems will be put at
+/var/lib/gems/1.8/bin (for Ruby 1.8). In order to use them you manually have to
+add the directory in your PATH environment variable or make symbolic links at
+/usr/bin.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Sat, 22 Apr 2006
--- libgems-ruby-1.1.1.orig/debian/postrm
+++ libgems-ruby-1.1.1/debian/postrm
@@ -0,0 +1,41 @@
+#! /bin/sh
+# postrm script for #PACKAGE#
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+        rm -rf /var/lib/gems/1.8
+        ;;
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+
+        ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
--- libgems-ruby-1.1.1.orig/debian/changelog
+++ libgems-ruby-1.1.1/debian/changelog
@@ -0,0 +1,234 @@
+libgems-ruby (1.1.1-1~bpo40+1) etch-backports; urgency=low
+
+  * Rebuild for etch.
+
+ -- Norbert Tretkowski <nobse@debian.org>  Thu, 29 May 2008 08:33:45 +0200
+
+libgems-ruby (1.1.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * No "instaling" (typo) found. Fixed by the upstream. (Closes: #443135)
+  * debian/patches/01_default_gem_path.dpatch: install executables to
+    /var/lib/gems/1.8/bin. (Closes: #458987, #480250)
+  * debian/control: 'rubygems' package now Suggests ruby1.8-dev and
+    build-essential since some gems may require native build. 
+    (Closes: #466189)
+  * gem now respects --http-proxy. Fixed by the upstream. (Closes: #414703)
+
+ -- Daigo Moriwaki <daigo@debian.org>  Sat, 10 May 2008 16:28:31 +0900
+
+libgems-ruby (1.0.1-4) unstable; urgency=low
+
+  * debian/etc/bash_completion.d/gem1.8: The completion did not work
+    because of a wrong function name. This issue has been fixed. 
+    Thanks to Victor Serbin.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Thu, 27 Dec 2007 23:46:36 +0900
+
+libgems-ruby (1.0.1-3) unstable; urgency=low
+
+  * BTS numbers to be closed were wrong at 1.0.0-1.
+    (Closes: #457065, #457180)
+
+ -- Daigo Moriwaki <daigo@debian.org>  Thu, 27 Dec 2007 23:31:56 +0900
+
+libgems-ruby (1.0.1-2) unstable; urgency=low
+
+  * debian/postrm: Only the /var/lib/gems/1.8 directory should be removed.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Thu, 27 Dec 2007 23:19:00 +0900
+
+libgems-ruby (1.0.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control: depends rdoc1.8 instead of rake. Explicitly use 
+    rdoc1.8 to generate documentations because rake depends on RubyGems.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Tue, 25 Dec 2007 21:04:14 +0900
+
+libgems-ruby (1.0.0-1) unstable; urgency=low
+
+  [ Daigo Moriwaki ]
+  * New upstream release (Closes: #45706, #45718, #443135).
+  * Removed patches since the upstream has resolved the issues
+    - debian/patches/03_config_file.dpatch
+    - debian/patches/04_gem_runner.dpatch
+    - debian/patches/06_dependency_list.dpatch
+    - debian/patches/07_security.dpatch
+    - debian/patches/10_datadir.dpatch
+  * Replaced patches with a new and upstream-friendly way.
+    Thanks to James Healy <jimmy at deefa dot com>.
+    - Removed debian/patches/01_rubygems.dpatch
+    - Removed debian/patches/02_post-install.dpatch
+    - Added debian/patches/01_default_gem_path.dpatch
+  * Removed patches for --build-root command option, which is no longer 
+    supported.
+    - 05_gem_commands.dpatch
+    - 09_installer.dpatch 
+  * debian/patches/08_tighter_search_regex.dpatch: Followed the upstream 
+    changes. Thanks to James Healy.
+  * Added debian/patches/03_disable_update_system.dpatch: 
+    Disabled gem update --system (Closes: #452547).
+    Thanks to James Healy. 
+  * debian/patches/21_avoid_ioseek.dpatch: Added a description.
+  * Added debian/etc/bash_completion.d/gem1.8 instead of patching
+    by debian/patches/22_add_bash_completion.dpatch 
+    - Improved a description. Thanks to James Healy.
+    - Followed new options. 
+      Thanks to Victor Serbin <chepel at hotmail dot com>.
+  * Removed man pages and corrected debian/rules since the commands 
+    are gone.
+    - debian/gem_mirror.1
+    - debian/gem_server.sgml
+    - debian/gemlock.1, 
+    - debian/gemri.1
+    - debian/gemwhich.sgml
+    - debian/index_gem_repository.1
+  * debian/libgems-ruby1.8.docs: Included 'html/' (instead of 'docs/') 
+    where documents are correctly generated. 'Releases' is no longer 
+    provided.
+  * Added debian/rubygems.manpages. Thanks to James Healy.
+  * debian/control:
+    - Added rake in Build-Depends-Indep to generate documentations.
+    - Removed unnecessary docbook-to-man from Build-Depends-Indep.
+    - Bumped Standards-Version to 3.7.3.
+  * Added debian/prerm and debian/postrm: /usr/bin/gem and gem1.8 are 
+    now managed by Debian alternatives system.
+
+  [ Arnaud Cornet ]
+  * Use new Homepage dpkg header.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Thu, 20 Dec 2007 20:03:53 +0900
+
+libgems-ruby (0.9.4-4) unstable; urgency=low
+
+  * debian/patches/22_add_bash_completion.dpatch: imported Ubuntu's work.
+    It enables bash completion for the gem command.
+    Thanks to Ubuntu MOTU Developers.
+  * move debian/README.Debian to debian/rubygems.README.Debian.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Sun, 05 Aug 2007 09:53:12 +0900
+
+libgems-ruby (0.9.4-3) unstable; urgency=low
+
+  * debian/control: Replace deprecated ${Source-Version} with
+    ${source:Version}. Thanks to Paul van Tilburg.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Wed, 01 Aug 2007 12:47:21 +0900
+
+libgems-ruby (0.9.4-2) unstable; urgency=low
+
+  * debian/control: The rubygems package depends on the libgems-ruby package
+    having a particuler version same as source's. (Closes: #434167)
+
+ -- Daigo Moriwaki <daigo@debian.org>  Wed, 01 Aug 2007 12:31:05 +0900
+
+libgems-ruby (0.9.4-1) unstable; urgency=low
+
+  * New upstream release. (Closes: #426190)
+  * Removed dummy entries in this changelog.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Sun, 27 May 2007 16:17:35 +0900
+
+libgems-ruby (0.9.3-1) unstable; urgency=low
+
+  * New upstream release. (Closes: #407576)
+  * Stopped using the "Uploaders rule".
+  * debian/control
+    - Bumped up Standards-Version to 3.7.2.
+    - The rubygems package now depends on ruby1.8 instead of ruby because
+      shebangs in scripts are /usr/bin/ruby1.8.
+    - Description 'Homepage:' should preceed 2 spaces. (Closes: #415221)
+  * The upstream's URL has been changed. (Closes: #413251)
+  * The shebang of /usr/bin/gem is now "#!/usr/bin/ruby1.8" instead of
+    "#!/usr/bin/env ruby". (Closes: #416775)
+  * CVE-2007-0469: RubyGems did not check installation paths for gems
+    before writing files. (Closes: #408299)
+
+ -- Daigo Moriwaki <daigo@debian.org>  Sun, 27 May 2007 11:03:02 +0900
+
+libgems-ruby (0.9.0-6) unstable; urgency=low
+
+  * Installing gems on s390 did not work because of an IO.seek trouble.
+    Add a patch (debian/patches/21_avoid_ioseek.dpatch) for a workaround.
+    (Closes: #406388)
+
+ -- Daigo Moriwaki <daigo@debian.org>  Mon, 15 Jan 2007 20:36:33 +0900
+
+libgems-ruby (0.9.0-5) unstable; urgency=medium
+
+  * Nothing is changed but uploading to the unstable distribtion. In order to
+    make it into Etch's freeze, the urgency is bumped up.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Fri, 13 Oct 2006 12:41:29 +0900
+
+libgems-ruby (0.9.0-4) experimental; urgency=low
+
+  * Fixed the watch-file again (typo in group_id). Thanks to Paul van Tilburg.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Wed, 13 Sep 2006 12:39:31 +0900
+
+libgems-ruby (0.9.0-3) experimental; urgency=low
+
+  * Fixed the watch-file. Thanks to Paul van Tilburg.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Mon, 11 Sep 2006 22:57:20 +0900
+
+libgems-ruby (0.9.0-2) experimental; urgency=low
+
+  * Apply a patch of Marcus Rueckert for the --build-root option of the gem
+    command where the files are to be installed.
+    http://rubyforge.org/pipermail/rubygems-developers/2006-June/002010.html
+
+ -- Daigo Moriwaki <daigo@debian.org>  Sat, 16 Jul 2006 15:57:00 +0900
+
+libgems-ruby (0.9.0-1) experimental; urgency=low
+
+  * New upstream release.
+  * debian/generate_yaml_index.sgml was removed because the upstream deleted
+    the command.
+  * Write man pages for gem, gemlock, gemri, index_gem_repository and
+    gem_mirror.
+  * Add a patch (debian/patches/10_datadir.dpatch) which removes the
+    unnecessary shebang.  
+
+ -- Daigo Moriwaki <daigo@debian.org>  Fri,  7 Jul 2006 15:25:30 +0900
+
+libgems-ruby (0.8.11-4) experimental; urgency=low
+
+  * Add ruby1.8-dev to the recommends as users may build gem native
+    extensions.  (Closes: #373843)
+  * Move Build-Depends-Indep to Build-Depends as per policy section 7.6.
+  * Put Standards-Version to the latest version, 3.7.2.
+  * Put the debhelper version that is depended on to 5.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Fri, 16 Jun 2006 23:35:03 +0900
+
+libgems-ruby (0.8.11-3) experimental; urgency=low
+
+  * This package is now managed under pkg-ruby-extras
+    https://alioth.debian.org/projects/pkg-ruby-extras/.
+  * Add debian/control.in, which generates debian/control.
+  * debian/patches/01_rubygems.dpatch: Fix a bug. GEM_HOME is now available to
+    specify where gems are to be installed.
+
+ -- Daigo Moriwaki <daigo@debian.org>  Wed, 26 Apr 2006 23:49:18 +0900
+
+libgems-ruby (0.8.11-2) experimental; urgency=low
+
+  * debian/patches/08_tighter_search_regex.dpatch: new. fix a bug where the
+    regular expression in the local gem searching code was not using the ^ and
+    $ anchors on the gem name given on the command line, resulting in failures
+    when another gem then the specified has a substring match.  (Blair Zajac
+    <blair@orcaware.com>)
+
+  * debian/patches/09_installer.dpatch: new. fix a issue where executables
+    of installed gems were not uninstalled.
+
+ -- Daigo Moriwaki <beatles@sgtpepper.net>  Thu,  3 Nov 2005 14:54:00 +0900
+
+libgems-ruby (0.8.11-1) experimental; urgency=low
+
+  * Initial Release [closes: #282429].
+
+ -- Daigo Moriwaki <beatles@sgtpepper.net>  Sat, 10 Sep 2005 23:48:29 +0900
--- libgems-ruby-1.1.1.orig/debian/libgems-ruby1.8.examples
+++ libgems-ruby-1.1.1/debian/libgems-ruby1.8.examples
@@ -0,0 +1 @@
+examples/*
--- libgems-ruby-1.1.1.orig/debian/libgems-ruby1.8.docs
+++ libgems-ruby-1.1.1/debian/libgems-ruby1.8.docs
@@ -0,0 +1,3 @@
+README
+test
+html
--- libgems-ruby-1.1.1.orig/debian/etc/bash_completion.d/gem1.8
+++ libgems-ruby-1.1.1/debian/etc/bash_completion.d/gem1.8
@@ -0,0 +1,297 @@
+# Michael Schuerig, michael@schuerig.de, 2007-02-24
+# [2007-12-21] Updated by Victor Serbin (chepel@hotmail.com) for gem1.8 v1.0
+# Free for all uses.
+
+have gem1.8 &&
+_gem18()
+{
+    local cur prev completions
+
+    COMPREPLY=()
+    cur=${COMP_WORDS[COMP_CWORD]}
+    prev=${COMP_WORDS[COMP_CWORD-1]}
+
+    COMMANDS='build cert check cleanup contents dependency\
+      environment fetch generate_index help install list\
+      lock mirror outdated pristine query rdoc search server\
+      sources specification uninstall unpack update which'
+
+    GEM_OPTIONS='\
+      -h --help\
+      -v --version'
+
+    COMMON_OPTIONS='\
+      -h --help\
+      -V --verbose --no-verbose\
+      -q --quiet\
+      --config-file\
+      --backtrace\
+      --debug'
+
+    CERT_OPTIONS='\
+      -a -add\
+      -l --list\
+      -r --remove\
+      -b --build\
+      -C --certificate\
+      -K --private-key\
+      -s --sign'
+
+    CHECK_OPTIONS='\
+      --verify\
+      -a --alien\
+      -t --test\
+      -v --version'
+
+    CLEANUP_OPTIONS='\
+      -d --dry-run'
+
+    CONTENTS_OPTIONS='\
+      -v --version\
+      -s --spec-dir\
+      -l --lib-only --no-lib-only'
+
+    DEPENDENCY_OPTIONS='\
+      -v --version\
+      --platform\
+      -R --reverse-dependencies --no-reverse-dependencies\
+      -p --pipe'
+
+    ENVIRONMENT_OPTIONS=''
+
+    FETCH_OPTIONS='\
+      -v --version\
+      --platform\
+      -B --bulk-threshold\
+      -p --http-proxy --no-http-proxy\
+      --source'
+
+    GENERATE_INDEX_OPTIONS='\
+      -d --directory'
+
+    HELP_OPTIONS=$COMMANDS
+
+    INSTALL_OPTIONS='\
+      --platform\
+      -v --version\
+      -i --install-dir\
+      -d --rdoc --no-rdoc\
+      --ri --no-ri\
+      -E --env-shebang\
+      -f --force --no-force\
+      -t --test --no-test\
+      -w --wrappers --no-wrappers\
+      -P --trust-policy\
+      --ignore-dependencies\
+      -y --include-dependencies\
+      --format-executable --no-format-executable\
+      -l --local\
+      -r --remote\
+      -b --both\
+      -B --bulk-threshold\
+      --source\
+      -p --http-proxy --no-http-proxy\
+      -u --update-sources --no-update-sources'
+
+    LIST_OPTIONS='\
+      -d --details --no-details\
+      --versions --no-versions\
+      -l --local\
+      -r --remote\
+      -b --both\
+      -B --bulk-threshold\
+      --source\
+      -p --http-proxy --no-http-proxy\
+      -u --update-sources --no-update-sources'
+
+    LOCK_OPTIONS='\
+      -s --strict --no-strict'
+
+    MIRROR_OPTIONS=''
+
+    OUTDATED_OPTIONS='\
+      --platform'
+
+    PRISTINE_OPTIONS='\
+      --all\
+      -v --version'
+
+    QUERY_OPTIONS='\
+      -n --name-matches\
+      -d --details --no-details\
+      --versions --no-versions\
+      -l --local\
+      -r --remote\
+      -b --both\
+      -B --bulk-threshold\
+      --source\
+      -p --http-proxy --no-http-proxy\
+      -u --update-sources --no-update-sources'
+
+    RDOC_OPTIONS='\
+      --all\
+      --rdoc --no-rdoc\
+      --ri --no-ri\
+      -v --version'
+
+    SEARCH_OPTIONS='\
+      -d --details --no-details\
+      --versions --no-versions\
+      -l --local\
+      -r --remote\
+      -b --both\
+      -B --bulk-threshold\
+      --source\
+      -p --http-proxy --no-http-proxy\
+      -u --update-sources --no-update-sources'
+
+    SERVER_OPTIONS='\
+      -p --port\
+      -d --dir\
+      --daemon --no-daemon'
+
+    SOURCES_OPTIONS='\
+      -a --add\
+      -l --list\
+      -r --remove\
+      -u --update\
+      -c --clear-all'
+
+    SPECIFICATION_OPTIONS='\
+      -v --version\
+      --platform\
+      --all\
+      -l --local\
+      -r --remote\
+      -b --both\
+      -B --bulk-threshold\
+      --source\
+      -p --http-proxy --no-http-proxy\
+      -u --update-sources --no-update-sources'
+
+    UNINSTALL_OPTIONS='\
+      -a --all --no-all\
+      -i --ignore-dependencies --no-ignore-dependencies\
+      -x --executables --no-executables\
+      -v --version\
+      --platform'
+
+    UNPACK_OPTIONS='\
+      --target\
+      -v --version'
+
+    UPDATE_OPTIONS='\
+      --system\
+      --platform\
+      -i --install-dir\
+      -d --rdoc --no-rdoc\
+      --ri --no-ri\
+      -E --env-shebang\
+      -f --force --no-force\
+      -t --test --no-test\
+      -w --wrappers --no-wrappers\
+      -P --trust-policy\
+      --ignore-dependencies\
+      -y --include-dependencies\
+      --format-executable --no-format-executable\
+      -l --local\
+      -r --remote\
+      -b --both\
+      -B --bulk-threshold\
+      --source\
+      -p --http-proxy --no-http-proxy\
+      -u --update-sources --no-update-sources'
+
+    WHICH_OPTIONS='\
+      -a --all --no-all\
+      -g --gems-first --no-gems-first'
+
+    case "${prev}" in
+      build)
+        completions="$COMMON_OPTIONS $BUILD_OPTIONS"
+        ;;
+      cert)
+        completions="$COMMON_OPTIONS $CERT_OPTIONS"
+        ;;
+      check)
+        completions="$COMMON_OPTIONS $CHECK_OPTIONS"
+        ;;
+      cleanup)
+        completions="$COMMON_OPTIONS $CLEANUP_OPTIONS"
+        ;;
+      contents)
+        completions="$COMMON_OPTIONS $CONTENTS_OPTIONS"
+        ;;
+      dependency)
+        completions="$COMMON_OPTIONS $DEPENDENCY_OPTIONS"
+        ;;
+      environment)
+        completions="$COMMON_OPTIONS $ENVIRONMENT_OPTIONS"
+        ;;
+      fetch)
+        completions="$COMMON_OPTIONS $FETCH_OPTIONS"
+        ;;
+      generate_index)
+        completions="$COMMON_OPTIONS $GENERATE_INDEX_OPTIONS"
+        ;;
+      help)
+        completions="$COMMON_OPTIONS $HELP_OPTIONS"
+        ;;
+      install)
+        completions="$COMMON_OPTIONS $INSTALL_OPTIONS"
+        ;;
+      list)
+        completions="$COMMON_OPTIONS $LIST_OPTIONS"
+        ;;
+      lock)
+        completions="$COMMON_OPTIONS $LOCK_OPTIONS"
+        ;;
+      mirror)
+        completions="$COMMON_OPTIONS $MIRROR_OPTIONS"
+        ;;
+      outdated)
+        completions="$COMMON_OPTIONS $OUTDATED_OPTIONS"
+        ;;
+      pristine)
+        completions="$COMMON_OPTIONS $PRISTINE_OPTIONS"
+        ;;
+      query)
+        completions="$COMMON_OPTIONS $QUERY_OPTIONS"
+        ;;
+      rdoc)
+        completions="$COMMON_OPTIONS $RDOC_OPTIONS"
+        ;;
+      search)
+        completions="$COMMON_OPTIONS $SEARCH_OPTIONS"
+        ;;
+      server)
+        completions="$COMMON_OPTIONS $SERVER_OPTIONS"
+        ;;
+      sources)
+        completions="$COMMON_OPTIONS $SOURCES_OPTIONS"
+        ;;
+      specification)
+        completions="$COMMON_OPTIONS $SPECIFICATION_OPTIONS"
+        ;;
+      uninstall)
+        completions="$COMMON_OPTIONS $UNINSTALL_OPTIONS"
+        ;;
+      unpack)
+        completions="$COMMON_OPTIONS $UNPACK_OPTIONS"
+        ;;
+      update)
+        completions="$COMMON_OPTIONS $UPDATE_OPTIONS"
+        ;;
+      which)
+        completions="$COMMON_OPTIONS $WHICH_OPTIONS"
+        ;;
+      *)
+        completions="$COMMANDS $GEM_OPTIONS"
+        ;;
+    esac
+
+    COMPREPLY=( $( compgen -W "$completions" -- $cur ))
+    return 0
+}
+
+[ -n "${have:-}" ] && complete -F _gem18 $filenames gem1.8
--- libgems-ruby-1.1.1.orig/debian/patches/03_disable_update_system.dpatch
+++ libgems-ruby-1.1.1/debian/patches/03_disable_update_system.dpatch
@@ -0,0 +1,25 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03_disable_update_system.dpatch by James Healy <jimmy@deefa.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Disable gem update --system functionality, as it can break things. Users should use apt instead
+
+@DPATCH@
+diff -urNad trunk~/lib/rubygems/commands/update_command.rb trunk/lib/rubygems/commands/update_command.rb
+--- trunk~/lib/rubygems/commands/update_command.rb	2008-04-08 06:32:28.000000000 +0900
++++ trunk/lib/rubygems/commands/update_command.rb	2008-05-10 15:38:29.000000000 +0900
+@@ -47,13 +47,7 @@
+ 
+   def execute
+     if options[:system] then
+-      say "Updating RubyGems"
+-
+-      unless options[:args].empty? then
+-        fail "No gem names are allowed with the --system option"
+-      end
+-
+-      options[:args] = ["rubygems-update"]
++      fail "gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get."
+     else
+       say "Updating installed gems"
+     end
--- libgems-ruby-1.1.1.orig/debian/patches/08_tighter_search_regex.dpatch
+++ libgems-ruby-1.1.1/debian/patches/08_tighter_search_regex.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 08_tighter_search_regex.dpatch by Daigo Moriwaki <daigo@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Included at 0.8.11-2
+
+@DPATCH@
+diff -urNad trunk~/lib/rubygems/source_index.rb trunk/lib/rubygems/source_index.rb
+--- trunk~/lib/rubygems/source_index.rb	2008-04-05 08:06:49.000000000 +0900
++++ trunk/lib/rubygems/source_index.rb	2008-05-10 15:40:39.000000000 +0900
+@@ -248,7 +248,7 @@
+                     end
+     else
+       version_requirement = platform_only || Gem::Requirement.default
+-      gem_pattern = /#{gem_pattern}/i
++      gem_pattern = /^#{gem_pattern}/i
+     end
+ 
+     unless Gem::Requirement === version_requirement then
--- libgems-ruby-1.1.1.orig/debian/patches/00list
+++ libgems-ruby-1.1.1/debian/patches/00list
@@ -0,0 +1,6 @@
+01_default_gem_path.dpatch
+03_disable_update_system.dpatch
+08_tighter_search_regex.dpatch
+21_avoid_ioseek.dpatch
+#05_gem_commands.dpatch
+#09_installer.dpatch 
--- libgems-ruby-1.1.1.orig/debian/patches/01_default_gem_path.dpatch
+++ libgems-ruby-1.1.1/debian/patches/01_default_gem_path.dpatch
@@ -0,0 +1,50 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_default_gem_path.dpatch by James Healy <jimmy@deefa.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Changes the default gem dir from inside the ruby lib to /var/lib/gems/{ruby version}
+
+@DPATCH@
+diff -urNad trunk~/lib/rubygems/defaults.rb trunk/lib/rubygems/defaults.rb
+--- trunk~/lib/rubygems/defaults.rb	2008-03-09 12:42:07.000000000 +0900
++++ trunk/lib/rubygems/defaults.rb	2008-05-10 16:07:33.000000000 +0900
+@@ -7,16 +7,14 @@
+ 
+   # Default home directory path to be used if an alternate value is not
+   # specified in the environment.
++  # 
++  # Debian patch: search order of this directory.
++  #   1. GEM_HOME enviroment variable
++  #      (Using this, Gems are to be installed in any path as you like)
++  #   2. /var/lib/gems/{ruby version} (This is the default path in Debian system)
++  #
+   def self.default_dir
+-    if defined? RUBY_FRAMEWORK_VERSION then
+-      File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
+-                ConfigMap[:ruby_version]
+-    elsif defined? RUBY_ENGINE then
+-      File.join ConfigMap[:libdir], RUBY_ENGINE, 'gems',
+-                ConfigMap[:ruby_version]
+-    else
+-      File.join ConfigMap[:libdir], 'ruby', 'gems', ConfigMap[:ruby_version]
+-    end
++    File.join('/', 'var', 'lib', 'gems', ConfigMap[:ruby_version])
+   end
+ 
+   # Default gem path.
+@@ -31,12 +29,10 @@
+   end
+ 
+   # The default directory for binaries
++  # Debian patch: 
++  #   /var/lib/gems/{ruby version}/bin is the default path in Debian system
+   def self.default_bindir
+-    if defined? RUBY_FRAMEWORK_VERSION then # mac framework support
+-      '/usr/bin'
+-    else # generic install
+-      ConfigMap[:bindir]
+-    end
++    File.join('/', 'var', 'lib', 'gems', ConfigMap[:ruby_version], 'bin')
+   end
+ 
+   # The default system-wide source info cache directory.
--- libgems-ruby-1.1.1.orig/debian/patches/09_installer.dpatch
+++ libgems-ruby-1.1.1/debian/patches/09_installer.dpatch
@@ -0,0 +1,60 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 09_installer.dpatch by Daigo Moriwaki <daigo@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad trunk~/lib/rubygems/installer.rb trunk/lib/rubygems/installer.rb
+--- trunk~/lib/rubygems/installer.rb	2007-05-11 04:01:45.000000000 +0900
++++ trunk/lib/rubygems/installer.rb	2007-05-27 08:51:33.000000000 +0900
+@@ -84,6 +84,14 @@
+         end
+       end
+ 
++      if @options[:build_root]
++        build_root = @options[:build_root]
++        FileUtils.mkdir_p build_root
++        raise Gem::FilePermissionError.new(build_root) unless File.writable?(build_root)
++        install_dir = build_root + install_dir
++        FileUtils.mkdir_p install_dir
++      end
++
+       raise Gem::FilePermissionError.new(Pathname.new(install_dir).expand_path) unless File.writable?(install_dir)
+ 
+       # Build spec dir.
+@@ -393,6 +401,7 @@
+     #
+     def initialize(gem, options)
+       @gem = gem
++      @options = options
+       @version = options[:version] || "> 0"
+       @force_executables = options[:executables]
+       @force_all = options[:all]
+@@ -447,8 +456,13 @@
+     def remove_executables(gemspec)
+       return if gemspec.nil?
+       if(gemspec.executables.size > 0)
+-        raise Gem::FilePermissionError.new(Gem.bindir) unless
+-          File.writable?(Gem.bindir)
++        bindir = Gem.bindir
++        if @options[:build_root]
++          install_dir = File.join(@options[:build_root], Gem.dir)
++          bindir = Gem.bindir(install_dir)
++        end
++        raise Gem::FilePermissionError.new(bindir) unless
++          File.writable?(bindir)
+         list = Gem.source_index.search(gemspec.name).delete_if { |spec|
+           spec.version == gemspec.version
+         }
+@@ -469,8 +483,8 @@
+         else
+           gemspec.executables.each do |exe_name|
+             say "Removing #{exe_name}"
+-            File.unlink File.join(Gem.bindir, exe_name) rescue nil
+-            File.unlink File.join(Gem.bindir, exe_name + ".cmd") rescue nil
++            File.unlink File.join(bindir, exe_name) rescue nil
++            File.unlink File.join(bindir, exe_name + ".cmd") rescue nil
+           end
+         end
+       end
--- libgems-ruby-1.1.1.orig/debian/patches/05_gem_commands.dpatch
+++ libgems-ruby-1.1.1/debian/patches/05_gem_commands.dpatch
@@ -0,0 +1,28 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_gem_commands.dpatch by  <daigo@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: New patch generated from libgems-ruby 0.8.10-1 diff.gz
+
+@DPATCH@
+
+--- libgems-ruby-0.9.0.orig/lib/rubygems/gem_commands.rb
++++ libgems-ruby-0.9.0/lib/rubygems/gem_commands.rb
+@@ -1,4 +1,3 @@
+-#!/usr/bin/env ruby
+ #--
+ # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
+ # All rights reserved.
+@@ -97,6 +96,12 @@
+         options[:install_dir] = File.expand_path(value)
+       end
+ 
++      add_option('-B', '--build-root DIR', 
++  'Temporary installation root. Useful for building packages.') do
++  |value, options|
++        options[:build_root] = File.expand_path(value)
++      end
++
+       add_option('-d', '--[no-]rdoc', 
+ 	'Generate RDoc documentation for the gem on install') do
+ 	|value, options|
--- libgems-ruby-1.1.1.orig/debian/patches/21_avoid_ioseek.dpatch
+++ libgems-ruby-1.1.1/debian/patches/21_avoid_ioseek.dpatch
@@ -0,0 +1,34 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 21_avoid_ioseek.dpatch by Daigo Moriwaki <daigo@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: A work around for Bug#406388.
+
+@DPATCH@
+diff -urNad trunk~/lib/rubygems/package/tar_reader.rb trunk/lib/rubygems/package/tar_reader.rb
+--- trunk~/lib/rubygems/package/tar_reader.rb	2008-02-29 17:55:01.000000000 +0900
++++ trunk/lib/rubygems/package/tar_reader.rb	2008-05-10 15:44:05.000000000 +0900
+@@ -47,10 +47,10 @@
+ 
+       skip = (512 - (size % 512)) % 512
+ 
+-      if @io.respond_to? :seek then
+-        # avoid reading...
+-        @io.seek(size - entry.bytes_read, IO::SEEK_CUR)
+-      else
++      #if @io.respond_to? :seek then
++      #  # avoid reading...
++      #  @io.seek(size - entry.bytes_read, IO::SEEK_CUR)
++      #else
+         pending = size - entry.bytes_read
+ 
+         while pending > 0 do
+@@ -58,7 +58,7 @@
+           raise UnexpectedEOF if @io.eof?
+           pending -= bread
+         end
+-      end
++      #end
+ 
+       @io.read skip # discard trailing zeros
+ 
