pcaprub 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -1,23 +1,53 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
+ require 'rake/clean'
4
+
5
+ desc "Build the extension:"
6
+ task :compile => %W[ext/pcaprub/Makefile ext/pcaprub/pcaprub.c]
7
+
8
+
9
+ file "ext/pcaprub/Makefile" => ["ext/pcaprub/extconf.rb"] do
10
+ Dir.chdir("ext/pcaprub") do
11
+ ruby "extconf.rb"
12
+ sh "make"
13
+ end
14
+ cp "ext/pcaprub/pcaprub.so", "lib"
15
+ end
16
+
17
+ CLEAN.include 'ext/**/Makefile'
18
+ CLEAN.include 'ext/**/*.o'
19
+ CLEAN.include 'ext/**/*.so'
20
+ CLEAN.include 'lib/**/*.so'
3
21
 
4
22
  begin
5
23
  require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
24
+ jeweler_tasks = Jeweler::Tasks.new do |gem|
7
25
  gem.name = "pcaprub"
8
26
  gem.summary = "libpcap bindings for ruby"
9
27
  gem.description = "libpcap bindings for ruby"
10
28
  gem.email = "shadowbq@gmail.com"
11
29
  gem.homepage = "http://github.com/shadowbq/pcaprub"
12
30
  gem.authors = ["shadowbq"]
13
- gem.extensions = ["lib/extconf.rb"]
14
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
31
+ gem.extensions = FileList['ext/**/extconf.rb']
32
+ gem.rubyforge_project = 'pcaprub'
33
+ gem.files.include('lib/pcaprub.*') # add native stuff
15
34
  end
35
+
36
+ $gemspec = jeweler_tasks.gemspec
37
+ $gemspec.version = jeweler_tasks.jeweler.version
38
+
16
39
  Jeweler::GemcutterTasks.new
17
40
  rescue LoadError
18
41
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
19
42
  end
20
43
 
44
+ require 'rake/gempackagetask'
45
+ Rake::GemPackageTask.new($gemspec) do |package|
46
+ package.need_zip = false
47
+ package.need_tar = false
48
+ end
49
+
50
+
21
51
  require 'rake/testtask'
22
52
  Rake::TestTask.new(:test) do |test|
23
53
  test.libs << 'lib' << 'test'
@@ -40,7 +70,7 @@ end
40
70
 
41
71
  task :test => :check_dependencies
42
72
 
43
- task :default => :test
73
+ task :default => %w[clean compile test]
44
74
 
45
75
  require 'rake/rdoctask'
46
76
  Rake::RDocTask.new do |rdoc|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.6.2
@@ -0,0 +1,7 @@
1
+ require 'mkmf'
2
+
3
+ extension_name = 'pcaprub'
4
+ have_library("pcap", "pcap_open_live")
5
+ dir_config(extension_name)
6
+ #$CPPFLAGS += " -DRUBY_19" if RUBY_VERSION =~ /1.9/
7
+ create_makefile(extension_name)
@@ -0,0 +1,24 @@
1
+ have_library: checking for pcap_open_live() in -lpcap... -------------------- yes
2
+
3
+ "cc -o conftest -I. -I/usr/local/lib/ruby/1.8/i386-freebsd7 -I. -O2 -fno-strict-aliasing -pipe -fPIC conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -lruby18-static -lpcap -lcrypt -lm -rpath=/usr/lib:/usr/local/lib -pthread -lc"
4
+ conftest.c: In function 't':
5
+ conftest.c:3: error: 'pcap_open_live' undeclared (first use in this function)
6
+ conftest.c:3: error: (Each undeclared identifier is reported only once
7
+ conftest.c:3: error: for each function it appears in.)
8
+ checked program was:
9
+ /* begin */
10
+ 1: /*top*/
11
+ 2: int main() { return 0; }
12
+ 3: int t() { void ((*volatile p)()); p = (void ((*)()))pcap_open_live; return 0; }
13
+ /* end */
14
+
15
+ "cc -o conftest -I. -I/usr/local/lib/ruby/1.8/i386-freebsd7 -I. -O2 -fno-strict-aliasing -pipe -fPIC conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -lruby18-static -lpcap -lcrypt -lm -rpath=/usr/lib:/usr/local/lib -pthread -lc"
16
+ checked program was:
17
+ /* begin */
18
+ 1: /*top*/
19
+ 2: int main() { return 0; }
20
+ 3: int t() { pcap_open_live(); return 0; }
21
+ /* end */
22
+
23
+ --------------------
24
+
File without changes
@@ -1,5 +1 @@
1
- require File.dirname(__FILE__) + "/extconf.rb"
2
-
3
- module Pcaprub
4
- VERSION="0.6.1"
5
- end
1
+ require File.expand_path(File.dirname(__FILE__)) + "/pcaprub.so"
@@ -5,14 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pcaprub}
8
- s.version = "0.6.1"
8
+ s.version = "0.6.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["shadowbq"]
12
- s.date = %q{2010-02-04}
12
+ s.date = %q{2010-02-06}
13
13
  s.description = %q{libpcap bindings for ruby}
14
14
  s.email = %q{shadowbq@gmail.com}
15
- s.extensions = ["lib/extconf.rb"]
15
+ s.extensions = ["ext/pcaprub/extconf.rb"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE",
18
18
  "README.rdoc"
@@ -25,8 +25,9 @@ Gem::Specification.new do |s|
25
25
  "README.rdoc",
26
26
  "Rakefile",
27
27
  "VERSION",
28
- "lib/extconf.rb",
29
- "lib/pcaprub.c",
28
+ "ext/pcaprub/extconf.rb",
29
+ "ext/pcaprub/mkmf.log",
30
+ "ext/pcaprub/pcaprub.c",
30
31
  "lib/pcaprub.rb",
31
32
  "mkmf.log",
32
33
  "pcaprub.gemspec",
@@ -36,6 +37,7 @@ Gem::Specification.new do |s|
36
37
  s.homepage = %q{http://github.com/shadowbq/pcaprub}
37
38
  s.rdoc_options = ["--charset=UTF-8"]
38
39
  s.require_paths = ["lib"]
40
+ s.rubyforge_project = %q{pcaprub}
39
41
  s.rubygems_version = %q{1.3.5}
40
42
  s.summary = %q{libpcap bindings for ruby}
41
43
  s.test_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pcaprub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - shadowbq
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-04 00:00:00 -05:00
12
+ date: 2010-02-06 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -18,7 +18,7 @@ email: shadowbq@gmail.com
18
18
  executables: []
19
19
 
20
20
  extensions:
21
- - lib/extconf.rb
21
+ - ext/pcaprub/extconf.rb
22
22
  extra_rdoc_files:
23
23
  - LICENSE
24
24
  - README.rdoc
@@ -30,8 +30,9 @@ files:
30
30
  - README.rdoc
31
31
  - Rakefile
32
32
  - VERSION
33
- - lib/extconf.rb
34
- - lib/pcaprub.c
33
+ - ext/pcaprub/extconf.rb
34
+ - ext/pcaprub/mkmf.log
35
+ - ext/pcaprub/pcaprub.c
35
36
  - lib/pcaprub.rb
36
37
  - mkmf.log
37
38
  - pcaprub.gemspec
@@ -60,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
61
  version:
61
62
  requirements: []
62
63
 
63
- rubyforge_project:
64
+ rubyforge_project: pcaprub
64
65
  rubygems_version: 1.3.5
65
66
  signing_key:
66
67
  specification_version: 3
@@ -1,4 +0,0 @@
1
- require 'mkmf'
2
-
3
- have_library("pcap", "pcap_open_live")
4
- create_makefile("pcaprub")