--- libtermios-ruby-0.9.5.orig/debian/changelog
+++ libtermios-ruby-0.9.5/debian/changelog
@@ -0,0 +1,87 @@
+libtermios-ruby (0.9.5-4) unstable; urgency=low
+
+  * Added rb_io_t+ruby1.8.7.patch to build with ruby 1.8.7. Thanks to Akira
+    Yamada for the patch. Closes: #484186.
+  * Now uses quilt to manage patches.
+  * Added build-dependencies on quilt and patchutils.
+  * Updated copyright notice. 
+
+ -- Lucas Nussbaum <lucas@lucas-nussbaum.net>  Tue, 03 Jun 2008 11:06:57 +0200
+
+libtermios-ruby (0.9.5-3) unstable; urgency=low
+
+  * libtermios-ruby1.8: removed Depends on ruby, added $(shlibs:Depends}.
+
+ -- Lucas Nussbaum <lucas@lucas-nussbaum.net>  Thu, 17 Jan 2008 23:06:33 +0100
+
+libtermios-ruby (0.9.5-2) unstable; urgency=low
+
+  * Added Vcs-Svn and Vcs-Browser.
+  * Added Homepage field.
+  * fixed Vcs-*: point to dir containing debian/, not dir containing
+    trunk/
+  * Updated to policy 3.7.3. No changes needed.
+
+ -- Lucas Nussbaum <lucas@lucas-nussbaum.net>  Mon, 24 Dec 2007 20:04:01 +0100
+
+libtermios-ruby (0.9.5-1) unstable; urgency=low
+
+  * New upstream release (Closes: #426861).
+
+ -- Lucas Nussbaum <lucas@lucas-nussbaum.net>  Fri, 01 Jun 2007 13:32:26 +0200
+
+libtermios-ruby (0.9.4-8) unstable; urgency=low
+
+  * Stopped using the "Uploaders rule".
+
+ -- Lucas Nussbaum <lucas@lucas-nussbaum.net>  Sun, 15 Apr 2007 10:02:06 +0200
+
+libtermios-ruby (0.9.4-7) unstable; urgency=low
+
+  * New maintainer, package now maintained by the Debian/Ruby Extras team.
+    (Closes: #391425)
+  * CDBSified.
+  * Added debian/watch.
+
+ -- Lucas Nussbaum <lucas@lucas-nussbaum.net>  Mon, 23 Oct 2006 15:18:48 +0200
+
+libtermios-ruby (0.9.4-6) unstable; urgency=low
+
+  * QA upload.
+  * Set maintainer to QA Group; Orphaned: #391425
+  * Conforms with latest Standards Version 3.7.2
+
+ -- Michael Ablassmeier <abi@debian.org>  Thu, 19 Oct 2006 10:03:02 +0200
+
+libtermios-ruby (0.9.4-5) unstable; urgency=low
+
+  * Changed maintainer's address.
+
+ -- David Moreno Garza <damog@debian.org>  Sat, 27 Aug 2005 18:16:02 -0500
+
+libtermios-ruby (0.9.4-4) unstable; urgency=low
+
+  * Corrected debian/rules for correctly building indep and arch
+    packages (Closes: #288490).
+
+ -- David Moreno Garza <damog@damog.net>  Sun,  9 Jan 2005 22:36:48 -0600
+
+libtermios-ruby (0.9.4-3) unstable; urgency=low
+
+  * Fixed build target on debian/rules (Closes: #284363).
+
+ -- David Moreno Garza <damog@damog.net>  Mon,  3 Jan 2005 03:22:05 -0600
+
+libtermios-ruby (0.9.4-2) unstable; urgency=low
+
+  * Fixed wrong dependency on libtermios-ruby binary package (Closes: #278114).
+
+ -- David Moreno Garza <damog@damog.net>  Sun, 24 Oct 2004 21:43:30 -0500
+
+libtermios-ruby (0.9.4-1) unstable; urgency=low
+
+  * Initial Release (Closes: #264281).
+  * NMU by Paul van Tilburg <paulvt@debian.org>
+
+ -- David Moreno Garza <damog@damog.net>  Sun,  8 Aug 2004 23:18:44 -0500
+
--- libtermios-ruby-0.9.5.orig/debian/control
+++ libtermios-ruby-0.9.5/debian/control
@@ -0,0 +1,30 @@
+Source: libtermios-ruby
+Section: devel
+Priority: optional
+Maintainer: Lucas Nussbaum <lucas@lucas-nussbaum.net>
+Uploaders: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>, Paul van Tilburg <paulvt@debian.org>
+Build-Depends: debhelper (>>5), cdbs, ruby1.8-dev, ruby1.8, rdoc, graphviz, ruby-pkg-tools, quilt, patchutils
+Standards-Version: 3.7.3
+Homepage: http://arika.org/ruby/termios
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-ruby-extras/packages/libtermios-ruby/trunk/
+Vcs-Svn: svn://svn.debian.org/pkg-ruby-extras/packages/libtermios-ruby/trunk/
+
+Package: libtermios-ruby
+Architecture: all
+Depends: libtermios-ruby1.8
+Description: termios simple wrapper for ruby
+ Ruby-termios enables you to use termios interface.
+ .
+ Termios module are simple wrapper for termios.  It can be included
+ into IO-family classes and can extend IO-family objects.  In addition,
+ the methods can use as module function.
+
+Package: libtermios-ruby1.8
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: termios simple wrapper for ruby 1.8
+ Ruby-termios enables you to use termios interface.
+ .
+ Termios module are simple wrapper for termios.  It can be included
+ into IO-family classes and can extend IO-family objects.  In addition,
+ the methods can use as module function.
--- libtermios-ruby-0.9.5.orig/debian/libtermios-ruby1.8.examples
+++ libtermios-ruby-0.9.5/debian/libtermios-ruby1.8.examples
@@ -0,0 +1 @@
+examples/*
--- libtermios-ruby-0.9.5.orig/debian/compat
+++ libtermios-ruby-0.9.5/debian/compat
@@ -0,0 +1 @@
+5
--- libtermios-ruby-0.9.5.orig/debian/rules
+++ libtermios-ruby-0.9.5/debian/rules
@@ -0,0 +1,7 @@
+#!/usr/bin/make -f
+#
+# CDBS file to build the Ruby package.
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/ruby-pkg-tools/1/class/ruby-extconf-rb.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
--- libtermios-ruby-0.9.5.orig/debian/copyright
+++ libtermios-ruby-0.9.5/debian/copyright
@@ -0,0 +1,68 @@
+This package was debianized by David Moreno Garza <damog@damog.net> on
+Sun,  8 Aug 2004 23:18:44 -0500.
+
+It was downloaded from http://arika.org/ruby/termios.en
+
+Upstream Author: Akira Yamada <akira@ruby-lang.org>
+
+Copyright:
+
+ Ruby-termios for Ruby is copyrighted free software by akira yamada
+ <akira@arika.org>.  You can redistribute it and/or modify it under
+ either the terms of the GPL, 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], fnmatch.[ch],
+     glob.c, 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 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+     PURPOSE.
+ 
+ On Debian systems, the complete text of the GNU General Public
+ License can be found in /usr/share/common-licenses/GPL file.
--- libtermios-ruby-0.9.5.orig/debian/watch
+++ libtermios-ruby-0.9.5/debian/watch
@@ -0,0 +1,3 @@
+version=3
+
+http://arika.org/ruby/termios.en .*ruby-termios-(.*)\.tar\.gz
--- libtermios-ruby-0.9.5.orig/debian/patches/series
+++ libtermios-ruby-0.9.5/debian/patches/series
@@ -0,0 +1 @@
+rb_io_t+ruby1.8.7.patch
--- libtermios-ruby-0.9.5.orig/debian/patches/rb_io_t+ruby1.8.7.patch
+++ libtermios-ruby-0.9.5/debian/patches/rb_io_t+ruby1.8.7.patch
@@ -0,0 +1,54 @@
+only in patch2:
+unchanged:
+--- libtermios-ruby-0.9.5.orig/termios.c
++++ libtermios-ruby-0.9.5/termios.c
+@@ -12,14 +12,14 @@
+ #include <unistd.h>
+ #include <string.h>
+ 
+-#ifdef HAVE_TYPE_RB_IO_T
++#if defined(HAVE_TYPE_RB_IO_T) && !defined(HAVE_MACRO_OPENFILE)
+ typedef rb_io_t OpenFile;
+ #endif
+ 
+-#if defined(HAVE_TYPE_RB_IO_T) ||  defined(HAVE_ST_FD)
+-# define FILENO(fptr) (fptr->fd)
++#if defined(HAVE_ST_FD)
++#define FILENO(fptr) (fptr->fd)
+ #else
+-# define FILENO(fptr) fileno(fptr->f)
++#define FILENO(fptr) fileno(fptr->f)
+ #endif
+ 
+ #define validate_ulong(v) ULONG2NUM(NUM2ULONG(v))
+@@ -229,7 +229,7 @@
+     Check_Type(io,  T_FILE);
+     Check_Type(opt, T_FIXNUM);
+     if (CLASS_OF(param) != cTermios) {
+-	char *type = rb_class2name(CLASS_OF(param));
++	const char *type = rb_class2name(CLASS_OF(param));
+ 	rb_raise(rb_eTypeError, 
+ 		 "wrong argument type %s (expected Termios::Termios)", 
+ 		 type);
+only in patch2:
+unchanged:
+--- libtermios-ruby-0.9.5.orig/extconf.rb
++++ libtermios-ruby-0.9.5/extconf.rb
+@@ -3,8 +3,15 @@
+ if have_header('termios.h') &&
+     have_header('unistd.h')
+ 
+-  unless RUBY_VERSION < '1.7' || have_type("rb_io_t", ["ruby.h", "rubyio.h"])
+-    have_struct_member("OpenFile", "fd", ["ruby.h", "rubyio.h"])
++  if RUBY_VERSION >= '1.7'
++    if have_type("rb_io_t", ["ruby.h", "rubyio.h"])
++      have_struct_member("rb_io_t", "fd", ["ruby.h", "rubyio.h"])
++    else
++      have_struct_member("OpenFile", "fd", ["ruby.h", "rubyio.h"])
++    end
++    if have_macro("OpenFile", ["ruby.h", "rubyio.h"])
++      $defs.push("-DHAVE_MACRO_OPENFILE")
++    end
+   end
+ 
+   create_makefile('termios')
