jameskilton / gccxml_gem

Binary gem installation of the GCCXML project

This URL has Read+Write access

gccxml_gem / Rakefile
100644 76 lines (62 sloc) 1.558 kb
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
 
PROJECT_NAME = "gccxml_gem"
GCCXML_VERSION = "0.9.2"
RUBYFORGE_USERNAME = "jameskilton"
 
desc "Build gccxml for this system"
task :build_gccxml => [:clean, :unpack, :build, :install]
 
task :unpack do
  cd "ext" do
    sh "tar xzvf gccxml.tar.gz"
    mkdir "gccxml-build"
  end
end
 
task :build do
  install_path = File.expand_path(File.dirname(__FILE__))
  cd "ext/gccxml-build" do
    sh "cmake -DCMAKE_INSTALL_PREFIX:PATH=#{install_path} ../gccxml"
    sh "make"
  end
end
 
task :install do
  cd "ext/gccxml-build" do
    sh "make install"
  end
 
  sh "chmod a+x bin/*"
  sh "chmod -R a+rx share/"
end
 
desc "Clean up everything"
task :clean => [:clobber] do
  rm_rf "ext/gccxml"
  rm_rf "ext/gccxml-build"
  rm_rf "bin"
  rm_rf "share"
end
 
spec = Gem::Specification.new do |s|
  s.platform = Gem::Platform::CURRENT
  s.name = PROJECT_NAME
  s.version = GCCXML_VERSION
  s.summary = 'Easy install for GCCXML'
  s.homepage = 'http://rbplusplus.rubyforge.org/'
  s.rubyforge_project = "rbplusplus"
  s.author = 'Jason Roelofs'
  s.email = 'jameskilton@gmail.com'
  
  s.description = <<-END
Because GCCXML is difficult to install on all platforms,
this binary gem is provided for ease of installing
and using RbGCCXML.
END
 
  patterns = [
    'Rakefile',
    '*.rb',
    'bin/*',
    'share/**/*'
  ]
 
  s.files = patterns.map {|p| Dir.glob(p) }.flatten
 
  s.require_paths = ['.']
end
 
Rake::GemPackageTask.new(spec) do |pkg|
  pkg.need_zip = true
  pkg.need_tar = true
end