rpgem 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/rpgem +8 -0
  2. data/lib/rpgem.rb +3 -2
  3. data/lib/template.spec.erb +12 -1
  4. metadata +4 -4
data/bin/rpgem CHANGED
@@ -84,6 +84,14 @@ begin
84
84
  ) do
85
85
  options[:ree] = true
86
86
  end
87
+
88
+ opts.on('-k TASK',
89
+ '--rake TASK',
90
+ 'Run the specified rake task during build.'
91
+ ) do |t|
92
+ options[:rake_tasks] ||= []
93
+ options[:rake_tasks] << t
94
+ end
87
95
  end.parse!
88
96
 
89
97
  options.rmerge!({
@@ -57,7 +57,8 @@ class RPGem
57
57
  :prefix => '/usr',
58
58
  :dependencies => [],
59
59
  :build_dependencies => [],
60
- :ree => false
60
+ :ree => false,
61
+ :rake_tasks => [],
61
62
  })
62
63
 
63
64
  @options.each do |k,v|
@@ -159,7 +160,7 @@ class RPGem
159
160
  puts
160
161
  puts "-*- Building RPM rpgem-#{self.to_s} -*-"
161
162
  FileUtils.in_dir RPMBUILD_DIR do
162
- system("rpmbuild -ba #{spec_loc}")
163
+ system("rpmbuild -ba -v #{spec_loc}")
163
164
  end
164
165
  puts "-*- Done Building RPM rpgem-#{self.to_s} -*-"
165
166
  end
@@ -40,7 +40,7 @@ Requires: <%= requires %>
40
40
 
41
41
  Prefix: <%=@prefix%>
42
42
 
43
- %define gem_prefix %{prefix}/lib/ruby/gems/%(%{prefix}/bin/ruby -e "puts VERSION.split('.')[0..1].join('.')")
43
+ %define gem_prefix %{prefix}/lib/ruby/gems/%(ruby -e "puts VERSION.split('.')[0..1].join('.')")
44
44
 
45
45
  %description
46
46
  <%= spec.description %>
@@ -52,6 +52,11 @@ Prefix: <%=@prefix%>
52
52
  rm -rf $RPM_BUILD_ROOT
53
53
  mkdir $RPM_BUILD_ROOT
54
54
  gem install %{SOURCE0} --force --local --no-rdoc --no-ri --install-dir=.
55
+ ls
56
+ <%= "cd gems/%{rbname}-%{version}" unless @rake_tasks.empty? %>
57
+ <% @rake_tasks.each do |t| %>
58
+ rake <%=t%>
59
+ <% end %>
55
60
 
56
61
  %install
57
62
 
@@ -59,6 +64,11 @@ rm -rf $RPM_BUILD_ROOT%{gem_prefix}
59
64
  mkdir -p $RPM_BUILD_ROOT%{gem_prefix}
60
65
  mv * $RPM_BUILD_ROOT%{gem_prefix}
61
66
 
67
+ mkdir $RPM_BUILD_ROOT%{prefix}/bin
68
+ <% spec.executables.each do |e| %>
69
+ ln -s %{gem_prefix}/bin/<%=e%> $RPM_BUILD_ROOT%{prefix}/bin/<%=e%>
70
+ <% end %>
71
+
62
72
  #remove test and spec files, or RPM throws a fit.
63
73
  rm -rf $RPM_BUILD_ROOT%{gem_prefix}/gems/%{rbname}-%{version}/{test,spec}
64
74
 
@@ -75,6 +85,7 @@ rm -rf $RPM_BUILD_ROOT
75
85
  %{gem_prefix}/cache/%{rbname}-%{version}.gem
76
86
  <% spec.executables.each do |e| %>
77
87
  %{gem_prefix}/bin/<%= e %>
88
+ %{prefix}/bin/<%= e %>
78
89
  <% end %>
79
90
 
80
91
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpgem
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jay Adkisson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-18 00:00:00 -07:00
18
+ date: 2010-05-24 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency