Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 95 lines (86 sloc) 2.539 kB
eea3757 Packaging
wycats@localhost authored
1 require 'rubygems'
2 require 'rake/gempackagetask'
3 require 'rubygems/specification'
4 require 'date'
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
5 require 'fileutils'
547209c Hook in libtest build
Wayne Meissner authored
6 require 'rbconfig'
eea3757 Packaging
wycats@localhost authored
7
8 GEM = "ffi"
43ec6db Bump version to 0.2
Wayne Meissner authored
9 GEM_VERSION = "0.2.0"
eea3757 Packaging
wycats@localhost authored
10 AUTHOR = "Wayne Meissner"
11 EMAIL = "wmeissner@gmail.com"
12 HOMEPAGE = "http://kenai.com/projects/ruby-ffi"
379e9dd Fixup SUMMARY
Wayne Meissner authored
13 SUMMARY = "A Ruby foreign function interface (compatible with Rubinius and JRuby FFI)"
eea3757 Packaging
wycats@localhost authored
14
15 spec = Gem::Specification.new do |s|
16 s.name = GEM
17 s.version = GEM_VERSION
18 s.platform = Gem::Platform::RUBY
19 s.has_rdoc = true
20 s.extra_rdoc_files = ["README", "LICENSE"]
21 s.summary = SUMMARY
22 s.description = s.summary
23 s.author = AUTHOR
24 s.email = EMAIL
25 s.homepage = HOMEPAGE
c2be701 Add rubyforge_project
Wayne Meissner authored
26 s.rubyforge_project = 'ffi'
3b0110a Hook in generation of platform types
Wayne Meissner authored
27 s.extensions = %w(ext/extconf.rb gen/Rakefile)
eea3757 Packaging
wycats@localhost authored
28
29 s.require_path = 'lib'
30 s.autorequire = GEM
31 s.files = %w(LICENSE README Rakefile) + Dir.glob("{ext,lib,nbproject,samples,specs}/**/*")
32 end
33
68da870 @wycats rake specs works right on jruby and mri
wycats authored
34 if RUBY_PLATFORM == "java"
7892618 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
Wayne Meissner authored
35 desc "Run all specs"
68da870 @wycats rake specs works right on jruby and mri
wycats authored
36 task :specs do
9ad1bb6 Move rubinius-api-only specs into specs/rbx
Wayne Meissner authored
37 sh %{#{Gem.ruby} -S spec #{Dir["specs/**/*_spec.rb"].join(" ")} -fs --color}
68da870 @wycats rake specs works right on jruby and mri
wycats authored
38 end
7892618 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
Wayne Meissner authored
39 desc "Run rubinius specs"
e6e3518 Add FFI::Buffer specs
Wayne Meissner authored
40 task :rbxspecs do
41 sh %{#{Gem.ruby} -S spec #{Dir["specs/rbx/**/*_spec.rb"].join(" ")} -fs --color}
42 end
68da870 @wycats rake specs works right on jruby and mri
wycats authored
43 else
7892618 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
Wayne Meissner authored
44 desc "Run all specs"
68da870 @wycats rake specs works right on jruby and mri
wycats authored
45 task :specs do
46 ENV["MRI_FFI"] = "1"
7892618 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
Wayne Meissner authored
47 sh %{#{Gem.ruby} -I. -Ilib -S spec #{Dir["specs/**/*_spec.rb"].join(" ")} -fs --color}
68da870 @wycats rake specs works right on jruby and mri
wycats authored
48 end
7892618 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
Wayne Meissner authored
49 desc "Run rubinius specs"
e6e3518 Add FFI::Buffer specs
Wayne Meissner authored
50 task :rbxspecs do
51 ENV["MRI_FFI"] = "1"
7892618 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
Wayne Meissner authored
52 sh %{#{Gem.ruby} -I. -Ilib -S spec #{Dir["specs/rbx/**/*_spec.rb"].join(" ")} -fs --color}
e6e3518 Add FFI::Buffer specs
Wayne Meissner authored
53 end
348eda3 @wycats specs
wycats authored
54 end
55
eea3757 Packaging
wycats@localhost authored
56 Rake::GemPackageTask.new(spec) do |pkg|
57 pkg.gem_spec = spec
58 end
59
60 desc "install the gem locally"
61 task :install => [:package] do
62 sh %{sudo #{Gem.ruby} -S gem install pkg/#{GEM}-#{GEM_VERSION}}
63 end
64
65 desc "create a gemspec file"
66 task :make_spec do
67 File.open("#{GEM}.gemspec", "w") do |file|
68 file.puts spec.to_ruby
69 end
379e9dd Fixup SUMMARY
Wayne Meissner authored
70 end
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
71 file "Makefile" do
72 sh %{#{Gem.ruby} ext/extconf.rb}
73 end
286f236 Make the compile target show up via rake -T
Wayne Meissner authored
74 desc "Compile the native module"
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
75 task :compile => "Makefile" do
76 sh %{make}
77 end
547209c Hook in libtest build
Wayne Meissner authored
78 desc "Clean all built files"
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
79 task :clean do
c2be701 Add rubyforge_project
Wayne Meissner authored
80 sh %{make clean} if File.exists?("Makefile")
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
81 FileUtils.rm_rf("build")
cb1df03 Remove conftest.dSYM
Wayne Meissner authored
82 FileUtils.rm_rf("conftest.dSYM")
a074a74 Fix build on ubuntu 6.06
wmeissner authored
83 FileUtils.rm_f(Dir["pkg/*.gem"])
84 FileUtils.rm_f("Makefile")
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
85 end
547209c Hook in libtest build
Wayne Meissner authored
86 LIBEXT = if Config::CONFIG['host_os'].downcase =~ /darwin/; "dylib"; else "so"; end
3bb83ae Fix build+test on OpenBSD
Wayne Meissner authored
87 GMAKE = Config::CONFIG['host_os'].downcase =~ /bsd/ ? "gmake" : "make"
470fea4 Add some primitive argument packing tests. These test a combination …
Wayne Meissner authored
88 task "build/libtest.#{LIBEXT}" do
3bb83ae Fix build+test on OpenBSD
Wayne Meissner authored
89 sh %{#{GMAKE} -f libtest/GNUmakefile}
547209c Hook in libtest build
Wayne Meissner authored
90 end
91 desc "Test the extension"
92 task :test => [ :compile, "build/libtest.#{LIBEXT}", :specs ] do
93
94 end
Something went wrong with that request. Please try again.