debian/0000755000000000000000000000000011772645001007171 5ustar debian/control0000644000000000000000000000337711772645001010606 0ustar Source: ruby-rubytorrent Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Arnaud Cornet , Cédric Boutillier DM-Upload-Allowed: yes Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.0~) Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/pkg-ruby-extras/ruby-rubytorrent.git Vcs-Browser: http://git.debian.org/?p=pkg-ruby-extras/ruby-rubytorrent.git;a=summary Homepage: http://rubytorrent.rubyforge.org XS-Ruby-Versions: all Package: ruby-rubytorrent Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter Replaces: libtorrent-ruby (<< 0.3-3~), libtorrent-ruby1.8 (<< 0.3-3~) Breaks: libtorrent-ruby (<< 0.3-3~), libtorrent-ruby1.8 (<< 0.3-3~) Provides: libtorrent-ruby, libtorrent-ruby1.8 Description: BitTorrent library in Ruby BitTorrent is a peer-to-peer file sharing protocol used for distributing large amounts of data over the Internet. . RubyTorrent is a pure-Ruby BitTorrent peer library and toolset. You can use it to download or serve files over BitTorrent from any Ruby program. Package: libtorrent-ruby Section: oldlibs Priority: extra Architecture: all Depends: ${misc:Depends}, ruby-rubytorrent Description: Transitional package for ruby-rubytorrent This is a transitional package to ease upgrades to the ruby-rubytorrent package. It can safely be removed. Package: libtorrent-ruby1.8 Section: oldlibs Priority: extra Architecture: all Depends: ${misc:Depends}, ruby-rubytorrent Description: Transitional package for ruby-rubytorrent This is a transitional package to ease upgrades to the ruby-rubytorrent package. It can safely be removed. debian/changelog0000644000000000000000000000272611772645001011052 0ustar ruby-rubytorrent (0.3-4) unstable; urgency=low * Bump build dependency on gem2deb to >= 0.3.0~ * Update version in Breaks/Replace to match latest version using the old Ruby policy -- Cédric Boutillier Tue, 26 Jun 2012 23:39:06 +0200 ruby-rubytorrent (0.3-3) unstable; urgency=low * Transition to the new Ruby policy + renaming source and binary packages + using gem2deb packaging tool * Add myself to Uploaders * Bump Standard-Versions to 3.9.3 (no changes needed) * debian/patches: + convert_break_into_return_outside_a_loop.patch: a break outside a loop is considered a syntax error with Ruby1.9 + fix_fetching_ascii_codes_from_chars.patch: access characters of a string and their ASCII code in a way working with Ruby1.8 and Ruby1.9 + remove_rubygems_from_examples.patch: remove requirement on rubygems in rtpeer-ncurses.rb * Convert debian/copyright to DEP-5 copyright-format/1.0 * Override lintian warning about duplicate descriptions for transition packages -- Cédric Boutillier Wed, 23 May 2012 18:54:57 +0200 libtorrent-ruby (0.3-2) unstable; urgency=low * Fix architecture. * Do not use the uploaders rule anymore. -- Arnaud Cornet Sun, 15 Apr 2007 11:24:25 +0200 libtorrent-ruby (0.3-1) unstable; urgency=low * Initial release. -- Arnaud Cornet Sat, 04 Nov 2006 17:53:07 +0100 debian/source/0000755000000000000000000000000011757473765010514 5ustar debian/source/format0000644000000000000000000000001411756703061011702 0ustar 3.0 (quilt) debian/source/lintian-overrides0000644000000000000000000000025711757473765014101 0ustar ruby-rubytorrent source: duplicate-short-description libtorrent-ruby libtorrent-ruby1.8 ruby-rubytorrent source: duplicate-long-description libtorrent-ruby libtorrent-ruby1.8 debian/ruby-rubytorrent.docs0000644000000000000000000000001511757473765013440 0ustar doc/* README debian/watch0000644000000000000000000000015311756703061010224 0ustar version=3 http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/rubytorrent .*/rubytorrent-(.*).tar.gz debian/copyright0000644000000000000000000000326511757473765011155 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: rubytorrent Source: http://rubytorrent.rubyforge.org Files: * Copyright: 2003-2005 William Morgan License: GPL-2 Files: doc/api.txt Copyright: 2005 William Morgan License: GFDL-NIV-1.2 Files: debian/* Copyright: 2006 Arnaud Cornet 2012 Cédric Boutillier License: GPL-2 License: GFDL-NIV-1.2 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2; with no Invariant Sections, no Front-Cover Texts, and no Back-Covers. . On Debian systems, the full text of the GNU Free Docomentation License version 1.2 can be found in the file `/usr/share/common-licenses/GFDL-1.2'. License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/rules0000755000000000000000000000070111756703061010252 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby debian/ruby-rubytorrent.examples0000644000000000000000000000011411757473765014326 0ustar dump-metainfo.rb dump-peers.rb make-metainfo.rb rtpeer-ncurses.rb rtpeer.rb debian/compat0000644000000000000000000000000211756703061010372 0ustar 7 debian/patches/0000755000000000000000000000000011757473765010643 5ustar debian/patches/convert_break_into_return_outside_a_loop.patch0000644000000000000000000000140211757473765022222 0ustar Description: Convert break statement out of a loop into a return Otherwise, this leads to an SyntaxError (Invalid break) with ruby1.9.1 Author: Cédric Boutillier Forwarded: http://rubyforge.org/pipermail/rubytorrent-devel/2012-May/000051.html Origin: vendor Last-Update: 2011-05-23 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/lib/rubytorrent/controller.rb +++ b/lib/rubytorrent/controller.rb @@ -582,7 +582,7 @@ calc_optunchokes ## this is needed. sigh. - break unless @running + return unless @running ## send keepalives @peers_m.synchronize { @peers.each { |p| p.send_keepalive if p.running? && p.last_send_time && ((Time.now - p.last_send_time) > KEEPALIVE_INTERVAL) } } debian/patches/series0000644000000000000000000000017511757473765012063 0ustar convert_break_into_return_outside_a_loop.patch fix_fetching_ascii_codes_from_chars.patch remove_rubygems_from_examples.patch debian/patches/remove_rubygems_from_examples.patch0000644000000000000000000000112411757473765020015 0ustar Description: Remove rubygems stuff from examples Author: Cédric Boutillier Origin: vendor Forwarded: not-needed Last-Update: 2012-05-23 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/rtpeer-ncurses.rb +++ b/rtpeer-ncurses.rb @@ -11,11 +11,10 @@ ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License (in the file COPYING) for more details. -require "rubygems" require "rubytorrent" require "ncurses" require "optparse" def die(x); $stderr << "#{x}\n" && exit(-1); end dlratelim = nil debian/patches/fix_fetching_ascii_codes_from_chars.patch0000644000000000000000000000612011757473765021050 0ustar Description: Extract ASCII code of characters in way understandable for Ruby1.9 Using chr and ord method to pass from integers to the corresponding characters and vice versa Author: Cédric Boutillier Forwarded: http://rubyforge.org/pipermail/rubytorrent-devel/2012-May/000051.html Origin: vendor Last-Update: 2012-05-23 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/lib/rubytorrent/tracker.rb +++ b/lib/rubytorrent/tracker.rb @@ -90,8 +90,8 @@ x.map { |e| TrackerResponsePeer.new e }.extend(ArrayUniq2).uniq2 when String x.unpack("a6" * (x.length / 6)).map do |y| - TrackerResponsePeer.new({"ip" => (0..3).map { |i| y[i] }.join('.'), - "port" => (y[4] << 8) + y[5] }) + TrackerResponsePeer.new({"ip" => (0..3).map { |i| y[i].ord }.join('.'), + "port" => (y[4].ord << 8) + y[5].ord }) end.extend(ArrayUniq2).uniq2 else raise "don't know how to make peers array from #{x.class}" --- a/lib/rubytorrent/server.rb +++ b/lib/rubytorrent/server.rb @@ -133,7 +133,7 @@ len = sock.recv(1)[0] # rt_debug "length #{len.inspect}" - raise ProtocolError, "invalid handshake length byte #{len.inspect}" unless len == 19 + raise ProtocolError, "invalid handshake length byte #{len.inspect}" unless (not len.nil? and len.ord == 19) name = sock.recv(19) # rt_debug "name #{name.inspect}" --- a/lib/rubytorrent/message.rb +++ b/lib/rubytorrent/message.rb @@ -17,7 +17,7 @@ class String def from_fbbe # four-byte big-endian integer raise "fbbe must be four-byte string (got #{self.inspect})" unless length == 4 - (self[0] << 24) + (self[1] << 16) + (self[2] << 8) + self[3] + (self[0].ord << 24) + (self[1].ord << 16) + (self[2].ord << 8) + self[3].ord end end @@ -25,11 +25,16 @@ def to_fbbe # four-byte big-endian integer raise "fbbe must be < 2^32" unless self <= 2**32 raise "fbbe must be >= 0" unless self >= 0 - s = " " - s[0] = (self >> 24) % 256 - s[1] = (self >> 16) % 256 - s[2] = (self >> 8) % 256 - s[3] = (self ) % 256 +# s = " " +# s[0] = (self >> 24) % 256 +# s[1] = (self >> 16) % 256 +# s[2] = (self >> 8) % 256 +# s[3] = (self ) % 256 + s = "" + s << (self >> 24) % 256 + s << (self >> 16) % 256 + s << (self >> 8) % 256 + s << (self ) % 256 s end end --- a/lib/rubytorrent/peer.rb +++ b/lib/rubytorrent/peer.rb @@ -26,7 +26,7 @@ ret += "\0" bit = 7 end - ret[ret.length - 1] |= (1 << bit) if b + ret[-1] = (ret[-1].ord || (1 << bit)).chr if b bit -= 1 end ret @@ -367,7 +367,7 @@ # rt_debug "* hey, a keepalive!" end - id = recv_bytes(1)[0] + id = recv_bytes(1)[0].ord if Message::WIRE_IDS[id] == :piece # add a block len -= 9 --- a/rtpeer-ncurses.rb +++ b/rtpeer-ncurses.rb @@ -237,7 +237,7 @@ def handle_any_input(display) case(Ncurses.getch()) - when ?q, ?Q + when "q".ord, "Q".ord Ncurses.curs_set(1) Ncurses.endwin() exit