[DRE-commits] r2156 - in packages/libpcap-ruby/trunk: . debian examples lib

lucas at alioth.debian.org lucas at alioth.debian.org
Sat Dec 8 12:02:33 UTC 2007


Author: lucas
Date: 2007-12-08 12:02:33 +0000 (Sat, 08 Dec 2007)
New Revision: 2156

Added:
   packages/libpcap-ruby/trunk/debian/
   packages/libpcap-ruby/trunk/debian/changelog
   packages/libpcap-ruby/trunk/debian/compat
   packages/libpcap-ruby/trunk/debian/control
   packages/libpcap-ruby/trunk/debian/copyright
   packages/libpcap-ruby/trunk/debian/rules
Modified:
   packages/libpcap-ruby/trunk/Pcap.c
   packages/libpcap-ruby/trunk/examples/httpdump.rb
   packages/libpcap-ruby/trunk/examples/tcpdump.rb
   packages/libpcap-ruby/trunk/examples/test.rb
   packages/libpcap-ruby/trunk/lib/pcaplet.rb
   packages/libpcap-ruby/trunk/ruby_pcap.h
Log:
[svn-inject] Applying Debian modifications to trunk

Modified: packages/libpcap-ruby/trunk/Pcap.c
===================================================================
--- packages/libpcap-ruby/trunk/Pcap.c	2007-12-08 12:02:26 UTC (rev 2155)
+++ packages/libpcap-ruby/trunk/Pcap.c	2007-12-08 12:02:33 UTC (rev 2156)
@@ -54,6 +54,29 @@
 }
 
 static VALUE
+pcap_s_findalldevs(self)
+    VALUE self;
+{
+    pcap_if_t *alldevsp;
+    VALUE return_ary;
+    char pcap_errbuf[PCAP_ERRBUF_SIZE];
+
+    return_ary = rb_ary_new();
+
+    pcap_findalldevs(&alldevsp, pcap_errbuf);
+
+    if (alldevsp == NULL) // List is empty, probably an error
+	    rb_raise(ePcapError, "%s", pcap_errbuf);
+    
+    for (; alldevsp->next != NULL; alldevsp = alldevsp->next)
+            rb_ary_push(return_ary, rb_str_new2(alldevsp->name));
+
+    pcap_freealldevs(alldevsp);
+    
+    return return_ary;
+}
+
+static VALUE
 pcap_s_lookupnet(self, dev)
     VALUE self;
     VALUE dev;
@@ -723,6 +746,7 @@
     /* define module Pcap */
     mPcap = rb_define_module("Pcap");
     rb_define_module_function(mPcap, "lookupdev", pcap_s_lookupdev, 0);
+    rb_define_module_function(mPcap, "findalldevs", pcap_s_findalldevs, 0);
     rb_define_module_function(mPcap, "lookupnet", pcap_s_lookupnet, 1);
     rb_global_variable(&rbpcap_convert);
     rb_define_singleton_method(mPcap, "convert?", pcap_s_convert, 0);
@@ -780,11 +804,7 @@
     /*rb_define_method(cFilter, "&", filter_and, 1);*/
 
     /* define class PcapStat */
-    cPcapStat = rb_funcall(rb_cStruct, rb_intern("new"), 4,
-			   Qnil,
-			   INT2NUM(rb_intern("recv")),
-			   INT2NUM(rb_intern("drop")),
-			   INT2NUM(rb_intern("ifdrop")));
+    cPcapStat = rb_struct_define(NULL, "recv", "drop", "ifdrop", NULL);
     rb_define_const(mPcap, "Stat", cPcapStat);
 
     /* define exception classes */


Property changes on: packages/libpcap-ruby/trunk/debian
___________________________________________________________________
Name: mergeWithUpstream
   + 1

Added: packages/libpcap-ruby/trunk/debian/changelog
===================================================================
--- packages/libpcap-ruby/trunk/debian/changelog	                        (rev 0)
+++ packages/libpcap-ruby/trunk/debian/changelog	2007-12-08 12:02:33 UTC (rev 2156)
@@ -0,0 +1,96 @@
+libpcap-ruby (0.6-6) unstable; urgency=low
+
+  * dropped ruby1.6 support. (Closes: #367916)
+  * debian/control: updated description. (Closes: #210090)
+    Thanks: Lucas Nussbaum.
+  * applied findalldevs-support-patch from Barry deFreese. (Closes: #360637)
+  * lib/pcaplet.rb: uses optparse instead of getopts. (Closes: #312214)
+
+ -- akira yamada <akira at debian.org>  Mon,  5 Jun 2006 10:46:06 +0900
+
+libpcap-ruby (0.6-5) unstable; urgency=low
+
+  * rebuild with ruby1.6 and ruby1.8, closes: #212265.
+  - renamed to libpcap-ruby1.6 from libpcap-ruby.  it conflicts/replaces with
+    libpcap-ruby.
+  - new-subpackage libpcap-ruby1.8.
+
+ -- akira yamada <akira at debian.org>  Sat,  4 Oct 2003 16:20:21 +0900
+
+libpcap-ruby (0.6-4) unstable; urgency=low
+
+  * rebuild with libpcap-dev_0.7.1-1, closes: #156210.
+
+ -- akira yamada <akira at debian.org>  Thu, 15 Aug 2002 10:36:59 +0900
+
+libpcap-ruby (0.6-3.1) unstable; urgency=low
+
+  * Non maintainer upload
+  * Rebuilt with new libpcap to remove dependency on libpcap0, which I
+    got removed from unstable by accident. Sorry about this...
+
+ -- Torsten Landschoff <torsten at debian.org>  Sat, 10 Aug 2002 11:37:13 +0200
+
+libpcap-ruby (0.6-3) unstable; urgency=low
+
+  * Rebuild with ruby_1.6.2-5.
+
+ -- akira yamada <akira at debian.org>  Thu, 25 Jan 2001 22:56:47 +0900
+
+libpcap-ruby (0.6-2) unstable; urgency=low
+
+  * Rebuild with ruby_1.6.0.
+  * Updated Standards-Version to 3.2.1.
+  * Added Build-Depends field into control file.
+
+ -- akira yamada <akira at debian.org>  Fri,  1 Sep 2000 17:58:46 +0900
+
+libpcap-ruby (0.6-1) unstable; urgency=low
+
+  * Upgraded to new upstream version.
+
+ -- akira yamada <akira at debian.org>  Sun, 20 Aug 2000 01:03:47 +0900
+
+libpcap-ruby (0.5-2) unstable; urgency=low
+
+  * Rebuild with ruby_1.4.4.
+
+ -- akira yamada <akira at debian.org>  Tue,  4 Apr 2000 21:02:01 +0900
+
+libpcap-ruby (0.5-1) unstable; urgency=low
+
+  * Upgraded to new upstream version.
+
+ -- akira yamada <akira at debian.org>  Wed, 22 Dec 1999 14:27:34 +0900
+
+libpcap-ruby (0.4-1) unstable; urgency=low
+
+  * Upgraded to new upstream version.
+  * FHS complience.
+
+ -- akira yamada <akira at debian.org>  Thu, 21 Oct 1999 23:38:38 +0900
+
+libpcap-ruby (0.3.1-1) unstable; urgency=low
+
+  * Upgraded to new upstream version.
+
+ -- akira yamada <akira at debian.org>  Fri, 27 Aug 1999 11:28:32 +0900
+
+ruby-pcap-module (0.1.1-2) unstable-jp; urgency=low
+
+  * Build with ruby1.2_1.2.2.
+
+ -- akira yamada <akira at linux.or.jp>  Mon,  1 Feb 1999 14:39:24 +0900
+
+ruby-pcap-module (0.1.1-1) unstable-jp; urgency=low
+
+  * Upgraded to new upstream version.
+  * Build with ruby_1.2.2.
+
+ -- akira yamada <akira at linux.or.jp>  Fri, 22 Jan 1999 17:47:56 +0900
+
+ruby-pcap-module (0.1-1) unstable-jp; urgency=low
+
+  * Initial Release.
+
+ -- akira yamada <akira at linux.or.jp>  Tue,  1 Dec 1998 23:22:12 +0900

Added: packages/libpcap-ruby/trunk/debian/compat
===================================================================
--- packages/libpcap-ruby/trunk/debian/compat	                        (rev 0)
+++ packages/libpcap-ruby/trunk/debian/compat	2007-12-08 12:02:33 UTC (rev 2156)
@@ -0,0 +1 @@
+4

Added: packages/libpcap-ruby/trunk/debian/control
===================================================================
--- packages/libpcap-ruby/trunk/debian/control	                        (rev 0)
+++ packages/libpcap-ruby/trunk/debian/control	2007-12-08 12:02:33 UTC (rev 2156)
@@ -0,0 +1,16 @@
+Source: libpcap-ruby
+Section: interpreters
+Priority: optional
+Maintainer: akira yamada <akira at debian.org>
+Build-Depends: debhelper (>> 4), libpcap-dev, ruby1.8, ruby1.8-dev
+Standards-Version: 3.6.2
+
+Package: libpcap-ruby1.8
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Ruby interface for the libpcap packet capture library
+ libpcap (Packet CAPture) provides a portable framework for low-level
+ network monitoring. This package provides bindings for the Ruby programming
+ language, version 1.8.
+ .
+ Homepage: http://www.goto.info.waseda.ac.jp/~fukusima/ruby/pcap-e.html

Added: packages/libpcap-ruby/trunk/debian/copyright
===================================================================
--- packages/libpcap-ruby/trunk/debian/copyright	                        (rev 0)
+++ packages/libpcap-ruby/trunk/debian/copyright	2007-12-08 12:02:33 UTC (rev 2156)
@@ -0,0 +1,27 @@
+This package was debianized by akira yamada akira at debian.org on
+Tue,  1 Dec 1998 23:22:12 +0900.
+
+It was downloaded from
+<URL:http://www.goto.info.waseda.ac.jp/~fukusima/ruby/pcap-e.html>
+
+Upstream Author: Masaki Fukushima <fukusima at goto.info.waseda.ac.jp>
+
+Copyright:
+
+   This package 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; version 2 dated June, 1991.
+
+   This package 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., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+

Added: packages/libpcap-ruby/trunk/debian/rules
===================================================================
--- packages/libpcap-ruby/trunk/debian/rules	                        (rev 0)
+++ packages/libpcap-ruby/trunk/debian/rules	2007-12-08 12:02:33 UTC (rev 2156)
@@ -0,0 +1,75 @@
+#!/usr/bin/make -f
+# -*- mode: makefile; -*-
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+#export DH_COMPAT=3
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+
+	-rm -rf build-tree-1.8
+	mkdir   build-tree-1.8
+
+	ruby1.8 -C build-tree-1.8 ../extconf.rb
+	$(MAKE) -C build-tree-1.8
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+
+	-rm -rf build-tree-1.8
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	$(MAKE) -C build-tree-1.8 sitelibdir=$(CURDIR)/debian/libpcap-ruby1.8$(shell ruby1.8 -rrbconfig -e 'print Config::CONFIG["rubylibdir"]') install
+
+	touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs -A README* doc doc-ja
+	dh_installexamples -A examples/*
+#	dh_install
+#	dh_installmenu
+#	dh_installdebconf	
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+#	dh_undocumented
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress -X.rb -X.pl -X.py -X.scm -X.awk -X.dat
+	dh_fixperms
+#	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install


Property changes on: packages/libpcap-ruby/trunk/debian/rules
___________________________________________________________________
Name: svn:executable
   + *

Modified: packages/libpcap-ruby/trunk/examples/httpdump.rb
===================================================================
--- packages/libpcap-ruby/trunk/examples/httpdump.rb	2007-12-08 12:02:26 UTC (rev 2155)
+++ packages/libpcap-ruby/trunk/examples/httpdump.rb	2007-12-08 12:02:33 UTC (rev 2156)
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/ruby
 require 'pcaplet'
 httpdump = Pcaplet.new('-s 1500')
 

Modified: packages/libpcap-ruby/trunk/examples/tcpdump.rb
===================================================================
--- packages/libpcap-ruby/trunk/examples/tcpdump.rb	2007-12-08 12:02:26 UTC (rev 2155)
+++ packages/libpcap-ruby/trunk/examples/tcpdump.rb	2007-12-08 12:02:33 UTC (rev 2156)
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/ruby
 require 'pcaplet'
 include Pcap
 

Modified: packages/libpcap-ruby/trunk/examples/test.rb
===================================================================
--- packages/libpcap-ruby/trunk/examples/test.rb	2007-12-08 12:02:26 UTC (rev 2155)
+++ packages/libpcap-ruby/trunk/examples/test.rb	2007-12-08 12:02:33 UTC (rev 2156)
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/ruby
 require 'pcap'
 
 dev = Pcap.lookupdev

Modified: packages/libpcap-ruby/trunk/lib/pcaplet.rb
===================================================================
--- packages/libpcap-ruby/trunk/lib/pcaplet.rb	2007-12-08 12:02:26 UTC (rev 2155)
+++ packages/libpcap-ruby/trunk/lib/pcaplet.rb	2007-12-08 12:02:33 UTC (rev 2156)
@@ -1,5 +1,5 @@
 require 'pcap'
-require 'getopts'
+require 'optparse'
 
 def pcaplet_usage()
   $stderr.print <<END
@@ -24,15 +24,25 @@
       if args
 	ARGV[0,0] = args.split(/\s+/)
       end
-      usage(1) unless getopts("dnv", "i:", "r:", "c:-1", "s:68")
-      $DEBUG   |= $OPT_d
-      $VERBOSE |= $OPT_v
+      @device = nil
+      @rfile = nil
+      @count = -1
+      @snaplen = 68
+      opts = OptionParser.new do |opts|
+        opts.on('-d') {$DEBUG = true}
+        opts.on('-v') {$VERBOSE = true}
+        opts.on('-n') {Pcap.convert = false}
+        opts.on('-i IFACE') {|s| @device = s}
+        opts.on('-r FILE') {|s| @rfile = s}
+        opts.on('-c COUNT', OptionParser::DecimalInteger) {|i| @count = i}
+        opts.on('-s LEN', OptionParser::DecimalInteger) {|i| @snaplen = i}
+      end
+      begin
+        opts.parse!
+      rescue
+        usage(1)
+      end
 
-      @device = $OPT_i
-      @rfile = $OPT_r
-      Pcap.convert = !$OPT_n
-      @count   = $OPT_c.to_i
-      @snaplen = $OPT_s.to_i
       @filter = ARGV.join(' ')
 
       # check option consistency

Modified: packages/libpcap-ruby/trunk/ruby_pcap.h
===================================================================
--- packages/libpcap-ruby/trunk/ruby_pcap.h	2007-12-08 12:02:26 UTC (rev 2155)
+++ packages/libpcap-ruby/trunk/ruby_pcap.h	2007-12-08 12:02:33 UTC (rev 2156)
@@ -29,11 +29,12 @@
 #include <netdb.h>
 
 #ifdef DEBUG
-# define DEBUG_PRINT(x) \
+# define DEBUG_PRINT(x) do {\
     ((RTEST(ruby_debug) && RTEST(ruby_verbose))?\
-    (fprintf(stderr, "%s\n", x),fflush(stderr)) : 0)
+    (fprintf(stderr, "%s\n", x),fflush(stderr)) : 0)\
+} while (0)
 #else
-# define DEBUG_PRINT(x) (0)
+# define DEBUG_PRINT(x) do {} while (0)
 #endif
 
 #define UINT32_2_NUM(i) rb_uint2inum(i)




More information about the Pkg-ruby-extras-commits mailing list