forked from mtodd/geoip
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
55 lines (43 loc) · 1.61 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
task :default => [:compile, :test]
CLEAN.add "geoip.{o,bundle,so,obj,pdb,lib,def,exp}"
CLOBBER.add ['Makefile', 'mkmf.log','doc']
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.add ['README', 'geoip.c']
rdoc.main = "README" # page to start on
rdoc.rdoc_dir = 'doc/' # rdoc output folder
end
Rake::TestTask.new do |t|
t.test_files = 'test.rb'
t.verbose = true
end
spec = Gem::Specification.new do |s|
s.name = 'geoip-c'
s.version = "0.7.0.2"
s.authors = ['Ryah Dahl', 'Matt Todd', 'Charles Brian Quinn', 'Michael Sheakoski', 'Silvio Quadri', 'Thomas Morgan']
s.email = '[email protected]'
s.summary = "A Binding to the GeoIP C library"
s.description = 'Generic GeoIP lookup tool. Based on the geoip_city RubyGem by Ryah Dahl and the geoip-c Gem by Matt Todd'
s.homepage = "http://github.com/zarqman/geoip"
s.files = ["Rakefile", "extconf.rb", "test.rb", "geoip.c", "README.md"]
s.test_files = 'test.rb'
s.extensions = 'extconf.rb'
s.require_path = '.'
end
Rake::GemPackageTask.new(spec) do |p|
p.need_tar = true
p.gem_spec = spec
end
desc 'compile the extension'
task(:compile => 'Makefile') { sh 'make' }
file('Makefile' => "geoip.c") { ruby 'extconf.rb' }
task :install => [:gem] do
`env ARCHFLAGS="-arch i386" gem install pkg/geoip-c-0.5.0.gem -- --with-geoip-dir=/usr/local/GeoIP`
end
task(:webpage) do
sh 'scp -r doc/* [email protected]:/var/www/gforge-projects/geoip-city/'
end