reap 5.10.10 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. data/COPYING +400 -8
  2. data/README +136 -75
  3. data/bin/reap +2 -2
  4. data/bin/rubytest +5 -0
  5. data/data/reap/scaffold/standard/COPYING +403 -0
  6. data/data/reap/scaffold/{ChangeLog → standard/ChangeLog} +0 -0
  7. data/data/reap/scaffold/standard/INSTALL +14 -0
  8. data/data/reap/scaffold/{ProjectInfo → standard/ProjectInfo} +23 -24
  9. data/data/reap/scaffold/standard/README +3 -0
  10. data/data/reap/scaffold/standard/Rakefile +10 -0
  11. data/{Rakefile → data/reap/scaffold/standard/TODO} +0 -0
  12. data/data/reap/scaffold/{setup.rb → standard/setup.rb} +287 -270
  13. data/data/reap/scaffold/subversion/trunk/COPYING +403 -0
  14. data/data/reap/scaffold/{INSTALL → subversion/trunk/ChangeLog} +0 -0
  15. data/data/reap/scaffold/subversion/trunk/INSTALL +14 -0
  16. data/data/reap/scaffold/subversion/trunk/ProjectInfo +76 -0
  17. data/data/reap/scaffold/subversion/trunk/README +3 -0
  18. data/data/reap/scaffold/subversion/trunk/Rakefile +10 -0
  19. data/data/reap/scaffold/{README → subversion/trunk/TODO} +0 -0
  20. data/data/reap/scaffold/subversion/trunk/setup.rb +1568 -0
  21. data/data/reap/setup.rb +1568 -0
  22. data/lib/reap/bin/reap.rb +176 -80
  23. data/lib/reap/bin/rubytest.rb +53 -0
  24. data/lib/reap/class/announce.rb +220 -0
  25. data/lib/reap/class/doap.rb +80 -0
  26. data/lib/reap/class/extest.rb +151 -0
  27. data/lib/reap/class/filer.rb +62 -0
  28. data/lib/reap/class/installer.rb +178 -0
  29. data/lib/reap/class/manifest.rb +72 -0
  30. data/lib/reap/class/package.rb +468 -0
  31. data/lib/reap/class/publish.rb +152 -0
  32. data/lib/reap/class/rdoc.rb +131 -0
  33. data/lib/reap/class/test.rb +269 -0
  34. data/lib/reap/projectinfo.rb +187 -30
  35. data/lib/reap/rake.rb +42 -0
  36. data/lib/reap/reap.rb +89 -0
  37. data/lib/reap/tasks.rb +672 -11
  38. data/lib/reap/taskutils.rb +122 -0
  39. data/sample/ProjectInfo +96 -0
  40. data/sample/Rakefile +9 -0
  41. data/sample/Reapfile +11 -0
  42. data/sample/task/demo.rb +15 -0
  43. data/setup.rb +287 -272
  44. metadata +99 -257
  45. data/ANN +0 -3
  46. data/ChangeLog +0 -25
  47. data/ProjectInfo +0 -65
  48. data/data/reap/scaffold/COPYING +0 -11
  49. data/data/reap/scaffold/Rakefile +0 -146
  50. data/data/reap/scaffold/Todo +0 -0
  51. data/dev/Rakefile +0 -60
  52. data/dev/composite_task.rb +0 -27
  53. data/dev/compositepublisher.rb +0 -24
  54. data/dev/ftptools.rb +0 -139
  55. data/dev/license-each.rb +0 -85
  56. data/dev/publisher.rb +0 -75
  57. data/dev/rubyforgepublisher.rb +0 -18
  58. data/dev/sshpublisher.rb +0 -47
  59. data/dev/suby-cvs.rb +0 -46
  60. data/dev/template.rb +0 -72
  61. data/lib/reap/lint.rb +0 -0
  62. data/lib/reap/readymade.rb +0 -21
  63. data/lib/reap/task.rb +0 -187
  64. data/lib/reap/task/announce.rb +0 -156
  65. data/lib/reap/task/fileperm.rb +0 -82
  66. data/lib/reap/task/info.rb +0 -20
  67. data/lib/reap/task/install.rb +0 -33
  68. data/lib/reap/task/noop.rb +0 -26
  69. data/lib/reap/task/package.rb +0 -204
  70. data/lib/reap/task/publish.rb +0 -49
  71. data/lib/reap/task/rdoc.rb +0 -82
  72. data/lib/reap/task/scaffold.rb +0 -114
  73. data/lib/reap/task/test.rb +0 -186
  74. data/lib/reap/task/testext.rb +0 -110
  75. data/lib/reap/task/webpublish.rb +0 -43
  76. data/lib/reap/test.rb +0 -138
  77. data/test/tc_reap.rb +0 -11
  78. data/web/ProjectInfo +0 -57
  79. data/web/images/appleboy.jpg +0 -0
  80. data/web/images/grape.jpg +0 -0
  81. data/web/index.html +0 -124
  82. data/web/rdoc/classes/Object.html +0 -121
  83. data/web/rdoc/classes/ProjectInfo.html +0 -207
  84. data/web/rdoc/classes/ProjectInfo.src/M000094.html +0 -18
  85. data/web/rdoc/classes/ProjectInfo.src/M000095.html +0 -24
  86. data/web/rdoc/classes/ProjectInfo.src/M000096.html +0 -22
  87. data/web/rdoc/classes/ProjectInfo.src/M000097.html +0 -21
  88. data/web/rdoc/classes/ProjectInfo.src/M000098.html +0 -18
  89. data/web/rdoc/classes/Reap.html +0 -248
  90. data/web/rdoc/classes/Reap.src/M000023.html +0 -16
  91. data/web/rdoc/classes/Reap.src/M000024.html +0 -21
  92. data/web/rdoc/classes/Reap.src/M000025.html +0 -16
  93. data/web/rdoc/classes/Reap.src/M000026.html +0 -21
  94. data/web/rdoc/classes/Reap/Announce.html +0 -262
  95. data/web/rdoc/classes/Reap/Announce.src/M000030.html +0 -18
  96. data/web/rdoc/classes/Reap/Announce.src/M000031.html +0 -114
  97. data/web/rdoc/classes/Reap/Announce.src/M000032.html +0 -46
  98. data/web/rdoc/classes/Reap/Info.html +0 -176
  99. data/web/rdoc/classes/Reap/Info.src/M000033.html +0 -18
  100. data/web/rdoc/classes/Reap/Info.src/M000034.html +0 -17
  101. data/web/rdoc/classes/Reap/Info.src/M000035.html +0 -18
  102. data/web/rdoc/classes/Reap/Install.html +0 -193
  103. data/web/rdoc/classes/Reap/Install.src/M000036.html +0 -18
  104. data/web/rdoc/classes/Reap/Install.src/M000037.html +0 -20
  105. data/web/rdoc/classes/Reap/Install.src/M000038.html +0 -26
  106. data/web/rdoc/classes/Reap/Noop.html +0 -192
  107. data/web/rdoc/classes/Reap/Noop.src/M000027.html +0 -18
  108. data/web/rdoc/classes/Reap/Noop.src/M000028.html +0 -17
  109. data/web/rdoc/classes/Reap/Noop.src/M000029.html +0 -18
  110. data/web/rdoc/classes/Reap/Package.html +0 -310
  111. data/web/rdoc/classes/Reap/Package.src/M000055.html +0 -18
  112. data/web/rdoc/classes/Reap/Package.src/M000056.html +0 -68
  113. data/web/rdoc/classes/Reap/Package.src/M000057.html +0 -84
  114. data/web/rdoc/classes/Reap/Package.src/M000058.html +0 -61
  115. data/web/rdoc/classes/Reap/Perm.html +0 -236
  116. data/web/rdoc/classes/Reap/Perm.src/M000078.html +0 -18
  117. data/web/rdoc/classes/Reap/Perm.src/M000079.html +0 -21
  118. data/web/rdoc/classes/Reap/Perm.src/M000080.html +0 -42
  119. data/web/rdoc/classes/Reap/Perm.src/M000081.html +0 -26
  120. data/web/rdoc/classes/Reap/Perm.src/M000082.html +0 -18
  121. data/web/rdoc/classes/Reap/Publish.html +0 -213
  122. data/web/rdoc/classes/Reap/Publish.src/M000070.html +0 -18
  123. data/web/rdoc/classes/Reap/Publish.src/M000071.html +0 -22
  124. data/web/rdoc/classes/Reap/Publish.src/M000072.html +0 -37
  125. data/web/rdoc/classes/Reap/RDoc.html +0 -218
  126. data/web/rdoc/classes/Reap/RDoc.src/M000059.html +0 -18
  127. data/web/rdoc/classes/Reap/RDoc.src/M000060.html +0 -24
  128. data/web/rdoc/classes/Reap/RDoc.src/M000061.html +0 -70
  129. data/web/rdoc/classes/Reap/Task.html +0 -396
  130. data/web/rdoc/classes/Reap/Task.src/M000039.html +0 -18
  131. data/web/rdoc/classes/Reap/Task.src/M000040.html +0 -16
  132. data/web/rdoc/classes/Reap/Task.src/M000041.html +0 -16
  133. data/web/rdoc/classes/Reap/Task.src/M000042.html +0 -16
  134. data/web/rdoc/classes/Reap/Task.src/M000043.html +0 -16
  135. data/web/rdoc/classes/Reap/Task.src/M000044.html +0 -22
  136. data/web/rdoc/classes/Reap/Task.src/M000045.html +0 -16
  137. data/web/rdoc/classes/Reap/Task.src/M000046.html +0 -16
  138. data/web/rdoc/classes/Reap/Task.src/M000047.html +0 -16
  139. data/web/rdoc/classes/Reap/Task.src/M000048.html +0 -16
  140. data/web/rdoc/classes/Reap/Task.src/M000049.html +0 -16
  141. data/web/rdoc/classes/Reap/Task.src/M000050.html +0 -27
  142. data/web/rdoc/classes/Reap/Task.src/M000051.html +0 -19
  143. data/web/rdoc/classes/Reap/Task.src/M000052.html +0 -18
  144. data/web/rdoc/classes/Reap/Task.src/M000053.html +0 -18
  145. data/web/rdoc/classes/Reap/Task.src/M000054.html +0 -19
  146. data/web/rdoc/classes/Reap/Test.html +0 -253
  147. data/web/rdoc/classes/Reap/Test.src/M000062.html +0 -18
  148. data/web/rdoc/classes/Reap/Test.src/M000063.html +0 -26
  149. data/web/rdoc/classes/Reap/Test.src/M000064.html +0 -77
  150. data/web/rdoc/classes/Reap/Test.src/M000065.html +0 -27
  151. data/web/rdoc/classes/Reap/Test.src/M000066.html +0 -50
  152. data/web/rdoc/classes/Reap/Test/TestResults.html +0 -205
  153. data/web/rdoc/classes/Reap/Test/TestResults.src/M000067.html +0 -21
  154. data/web/rdoc/classes/Reap/Test/TestResults.src/M000068.html +0 -21
  155. data/web/rdoc/classes/Reap/Test/TestResults.src/M000069.html +0 -23
  156. data/web/rdoc/classes/Reap/TestExt.html +0 -234
  157. data/web/rdoc/classes/Reap/TestExt.src/M000073.html +0 -18
  158. data/web/rdoc/classes/Reap/TestExt.src/M000074.html +0 -20
  159. data/web/rdoc/classes/Reap/TestExt.src/M000075.html +0 -49
  160. data/web/rdoc/classes/Reap/TestExt.src/M000076.html +0 -34
  161. data/web/rdoc/classes/Reap/TestExt.src/M000077.html +0 -27
  162. data/web/rdoc/classes/Reap/WebPublish.html +0 -213
  163. data/web/rdoc/classes/Reap/WebPublish.src/M000083.html +0 -18
  164. data/web/rdoc/classes/Reap/WebPublish.src/M000084.html +0 -21
  165. data/web/rdoc/classes/Reap/WebPublish.src/M000085.html +0 -32
  166. data/web/rdoc/classes/ReapCommand.html +0 -425
  167. data/web/rdoc/classes/ReapCommand.src/M000001.html +0 -16
  168. data/web/rdoc/classes/ReapCommand.src/M000003.html +0 -16
  169. data/web/rdoc/classes/ReapCommand.src/M000005.html +0 -16
  170. data/web/rdoc/classes/ReapCommand.src/M000007.html +0 -16
  171. data/web/rdoc/classes/ReapCommand.src/M000009.html +0 -16
  172. data/web/rdoc/classes/ReapCommand.src/M000011.html +0 -16
  173. data/web/rdoc/classes/ReapCommand.src/M000013.html +0 -18
  174. data/web/rdoc/classes/ReapCommand.src/M000014.html +0 -19
  175. data/web/rdoc/classes/ReapCommand.src/M000015.html +0 -19
  176. data/web/rdoc/classes/ReapCommand.src/M000016.html +0 -24
  177. data/web/rdoc/classes/ReapCommand.src/M000018.html +0 -29
  178. data/web/rdoc/classes/Scaffold.html +0 -211
  179. data/web/rdoc/classes/Scaffold.src/M000086.html +0 -16
  180. data/web/rdoc/classes/Scaffold.src/M000087.html +0 -28
  181. data/web/rdoc/classes/Scaffold.src/M000088.html +0 -32
  182. data/web/rdoc/classes/Scaffold.src/M000089.html +0 -18
  183. data/web/rdoc/classes/UnitTestKernel.html +0 -176
  184. data/web/rdoc/classes/UnitTestKernel.src/M000019.html +0 -18
  185. data/web/rdoc/classes/UnitTestKernel.src/M000020.html +0 -18
  186. data/web/rdoc/classes/UnitTestKernel.src/M000021.html +0 -22
  187. data/web/rdoc/classes/UnitTestKernel.src/M000022.html +0 -22
  188. data/web/rdoc/classes/UnitTesting.html +0 -165
  189. data/web/rdoc/classes/UnitTesting.src/M000090.html +0 -34
  190. data/web/rdoc/classes/UnitTesting.src/M000091.html +0 -18
  191. data/web/rdoc/classes/UnitTesting/Failure.html +0 -156
  192. data/web/rdoc/classes/UnitTesting/Failure.src/M000092.html +0 -18
  193. data/web/rdoc/classes/UnitTesting/Failure.src/M000093.html +0 -21
  194. data/web/rdoc/created.rid +0 -1
  195. data/web/rdoc/files/ANN.html +0 -107
  196. data/web/rdoc/files/COPYING.html +0 -119
  197. data/web/rdoc/files/ChangeLog.html +0 -144
  198. data/web/rdoc/files/ProjectInfo.html +0 -190
  199. data/web/rdoc/files/README.html +0 -274
  200. data/web/rdoc/files/Rakefile.html +0 -101
  201. data/web/rdoc/files/lib/reap/bin/reap_rb.html +0 -129
  202. data/web/rdoc/files/lib/reap/lint_rb.html +0 -101
  203. data/web/rdoc/files/lib/reap/projectinfo_rb.html +0 -110
  204. data/web/rdoc/files/lib/reap/readymade_rb.html +0 -123
  205. data/web/rdoc/files/lib/reap/task/announce_rb.html +0 -114
  206. data/web/rdoc/files/lib/reap/task/fileperm_rb.html +0 -108
  207. data/web/rdoc/files/lib/reap/task/info_rb.html +0 -108
  208. data/web/rdoc/files/lib/reap/task/install_rb.html +0 -108
  209. data/web/rdoc/files/lib/reap/task/noop_rb.html +0 -108
  210. data/web/rdoc/files/lib/reap/task/package_rb.html +0 -109
  211. data/web/rdoc/files/lib/reap/task/publish_rb.html +0 -108
  212. data/web/rdoc/files/lib/reap/task/rdoc_rb.html +0 -108
  213. data/web/rdoc/files/lib/reap/task/scaffold_rb.html +0 -107
  214. data/web/rdoc/files/lib/reap/task/test_rb.html +0 -110
  215. data/web/rdoc/files/lib/reap/task/testext_rb.html +0 -109
  216. data/web/rdoc/files/lib/reap/task/webpublish_rb.html +0 -108
  217. data/web/rdoc/files/lib/reap/task_rb.html +0 -120
  218. data/web/rdoc/files/lib/reap/tasks_rb.html +0 -116
  219. data/web/rdoc/files/lib/reap/test_rb.html +0 -109
  220. data/web/rdoc/fr_class_index.html +0 -47
  221. data/web/rdoc/fr_file_index.html +0 -51
  222. data/web/rdoc/fr_method_index.html +0 -124
  223. data/web/rdoc/index.html +0 -24
  224. data/web/rdoc/rdoc-style.css +0 -208
@@ -0,0 +1,3 @@
1
+ = YOUR PROJECT
2
+
3
+ Tells us all about your project here.
@@ -0,0 +1,10 @@
1
+
2
+ require 'rake'
3
+
4
+ # Add rake tasks.
5
+ #
6
+ # desc "Some task."
7
+ # task :name do
8
+ # # ...
9
+ # end
10
+ #
@@ -8,21 +8,50 @@
8
8
  # the GNU LGPL, Lesser General Public License version 2.1.
9
9
  #
10
10
 
11
- unless Enumerable.method_defined?(:map) # Ruby 1.4.6
12
- module Enumerable
13
- alias map collect
14
- end
11
+ #############################
12
+ # Forked from version 3.2.1 #
13
+ # #
14
+ # -trans #
15
+ #############################
16
+
17
+ # CHANGE No longer need to support 1.4.6 or 1.6 versions of Ruby.
18
+
19
+ # unless Enumerable.method_defined?(:map) # Ruby 1.4.6
20
+ # module Enumerable
21
+ # alias map collect
22
+ # end
23
+ # end
24
+
25
+ # unless File.respond_to?(:read) # Ruby 1.6
26
+ # def File.read(fname)
27
+ # open(fname) {|f|
28
+ # return f.read
29
+ # }
30
+ # end
31
+ # end
32
+
33
+ # This is hack!
34
+ # This is needed to install within an abitrary root dir.
35
+ # B/c setup.rb has become spegetti code, I was forced to do this hack.
36
+ # Setup.rb shuld be re-writ. I would use package.rb instead but
37
+ # it lacks hooks and extension compilation. But we'll keep
38
+ # an eye on that one for the future. -trans.
39
+
40
+ $setup_install_root = nil
41
+ ARGV.each{ |a|
42
+ if md = /--root=(.*)/.match( a )
43
+ $setup_install_root = md[1]
44
+ end
45
+ }
46
+ if $setup_install_root
47
+ ARGV.delete("--root=#{$setup_install_root}")
48
+ $setup_install_root = File.expand_path($setup_install_root)
49
+ puts "(root=#{$setup_install_root})"
15
50
  end
16
51
 
17
- unless File.respond_to?(:read) # Ruby 1.6
18
- def File.read(fname)
19
- open(fname) {|f|
20
- return f.read
21
- }
22
- end
23
- end
52
+ # Windows?
24
53
 
25
- unless Errno.const_defined?(:ENOTEMPTY) # Windows?
54
+ unless Errno.const_defined?(:ENOTEMPTY)
26
55
  module Errno
27
56
  class ENOTEMPTY
28
57
  # We do not raise this exception, implementation is not needed.
@@ -55,25 +84,16 @@ class ConfigTable
55
84
  @config_opt = nil
56
85
  @verbose = true
57
86
  @no_harm = false
58
- @libsrc_pattern = '*.rb'
59
87
  end
60
88
 
61
89
  attr_accessor :install_prefix
62
90
  attr_accessor :config_opt
63
91
 
64
- attr_writer :verbose
65
-
66
- def verbose?
67
- @verbose
68
- end
69
-
70
- attr_writer :no_harm
92
+ def verbose=(x) @verbose = x end
93
+ def verbose?() @verbose end
71
94
 
72
- def no_harm?
73
- @no_harm
74
- end
75
-
76
- attr_accessor :libsrc_pattern
95
+ def no_harm=(x) @no_harm = x end
96
+ def no_harm?() @no_harm end
77
97
 
78
98
  def [](key)
79
99
  lookup(key).resolve(self)
@@ -117,9 +137,7 @@ class ConfigTable
117
137
  end
118
138
  end
119
139
 
120
- def savefile
121
- '.config'
122
- end
140
+ def savefile() '.config' end
123
141
 
124
142
  def load_savefile
125
143
  begin
@@ -142,124 +160,126 @@ class ConfigTable
142
160
  end
143
161
 
144
162
  def load_standard_entries
145
- standard_entries(@rbconfig).each do |ent|
163
+ #standard_entries(@rbconfig).each do |ent|
164
+ standard_entries.each do |ent|
146
165
  add ent
147
166
  end
148
167
  end
149
168
 
150
- def standard_entries(rbconfig)
151
- c = rbconfig
169
+ def standard_entries #(rbconfig)
170
+ rbconfig = @rbconfig
152
171
 
153
- rubypath = c['bindir'] + '/' + c['ruby_install_name']
172
+ rubypath = File.join(rbconfig['bindir'], rbconfig['ruby_install_name'] + rbconfig['EXEEXT'])
154
173
 
155
- major = c['MAJOR'].to_i
156
- minor = c['MINOR'].to_i
157
- teeny = c['TEENY'].to_i
174
+ major = rbconfig['MAJOR'].to_i
175
+ minor = rbconfig['MINOR'].to_i
176
+ teeny = rbconfig['TEENY'].to_i
158
177
  version = "#{major}.#{minor}"
159
178
 
160
- # ruby ver. >= 1.4.4?
161
- newpath_p = ((major >= 2) or
162
- ((major == 1) and
163
- ((minor >= 5) or
164
- ((minor == 4) and (teeny >= 4)))))
179
+ # CHANGE Do not need to support these old versions any more.
165
180
 
166
- if c['rubylibdir']
181
+ # # ruby ver. >= 1.4.4?
182
+ # newpath_p = ((major >= 2) or
183
+ # ((major == 1) and
184
+ # ((minor >= 5) or
185
+ # ((minor == 4) and (teeny >= 4)))))
186
+
187
+ #if c['rubylibdir']
167
188
  # V > 1.6.3
168
- libruby = "#{c['prefix']}/lib/ruby"
169
- librubyver = c['rubylibdir']
170
- librubyverarch = c['archdir']
171
- siteruby = c['sitedir']
172
- siterubyver = c['sitelibdir']
173
- siterubyverarch = c['sitearchdir']
174
- elsif newpath_p
175
- # 1.4.4 <= V <= 1.6.3
176
- libruby = "#{c['prefix']}/lib/ruby"
177
- librubyver = "#{c['prefix']}/lib/ruby/#{version}"
178
- librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
179
- siteruby = c['sitedir']
180
- siterubyver = "$siteruby/#{version}"
181
- siterubyverarch = "$siterubyver/#{c['arch']}"
182
- else
183
- # V < 1.4.4
184
- libruby = "#{c['prefix']}/lib/ruby"
185
- librubyver = "#{c['prefix']}/lib/ruby/#{version}"
186
- librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
187
- siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
188
- siterubyver = siteruby
189
- siterubyverarch = "$siterubyver/#{c['arch']}"
190
- end
189
+
190
+ root = '/'
191
+ prefix = rbconfig['prefix']
192
+
193
+ libruby = "#{prefix}/lib/ruby"
194
+ librubyver = rbconfig['rubylibdir']
195
+ librubyverarch = rbconfig['archdir']
196
+ siteruby = rbconfig['sitedir']
197
+ siterubyver = rbconfig['sitelibdir']
198
+ siterubyverarch = rbconfig['sitearchdir']
199
+
200
+ bindir = paramize(rbconfig['bindir'])
201
+ libdir = paramize(rbconfig['libdir'])
202
+ datadir = paramize(rbconfig['datadir'])
203
+ mandir = paramize(rbconfig['mandir'])
204
+ sysconfdir = paramize(rbconfig['sysconfdir'])
205
+ localstatedir = paramize(rbconfig['localstatedir'])
206
+
207
+ # elsif newpath_p
208
+ # # 1.4.4 <= V <= 1.6.3
209
+ # libruby = "#{c['prefix']}/lib/ruby"
210
+ # librubyver = "#{c['prefix']}/lib/ruby/#{version}"
211
+ # librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
212
+ # siteruby = c['sitedir']
213
+ # siterubyver = "$siteruby/#{version}"
214
+ # siterubyverarch = "$siterubyver/#{c['arch']}"
215
+ # else
216
+ # # V < 1.4.4
217
+ # libruby = "#{c['prefix']}/lib/ruby"
218
+ # librubyver = "#{c['prefix']}/lib/ruby/#{version}"
219
+ # librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
220
+ # siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
221
+ # siterubyver = siteruby
222
+ # siterubyverarch = "$siterubyver/#{c['arch']}"
223
+ # end
224
+
191
225
  parameterize = lambda {|path|
192
- path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')
226
+ path.sub(/\A#{Regexp.quote(rbconfig['prefix'])}/, '$prefix')
193
227
  }
194
228
 
195
- if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg }
229
+ if arg = rbconfig['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg }
196
230
  makeprog = arg.sub(/'/, '').split(/=/, 2)[1]
197
231
  else
198
232
  makeprog = 'make'
199
233
  end
200
234
 
235
+ installdir_lambda = lambda {|val, table|
236
+ case val
237
+ when 'std'
238
+ table['rbdir'] = '$librubyver'
239
+ table['sodir'] = '$librubyverarch'
240
+ when 'site'
241
+ table['rbdir'] = '$siterubyver'
242
+ table['sodir'] = '$siterubyverarch'
243
+ when 'home'
244
+ setup_rb_error '$HOME was not set' unless ENV['HOME']
245
+ table['prefix'] = ENV['HOME']
246
+ table['rbdir'] = '$libdir/ruby'
247
+ table['sodir'] = '$libdir/ruby'
248
+ end
249
+ }
250
+
201
251
  [
202
- ExecItem.new('installdirs', 'std/site/home',
203
- 'std: install under libruby; site: install under site_ruby; home: install under $HOME')\
204
- {|val, table|
205
- case val
206
- when 'std'
207
- table['rbdir'] = '$librubyver'
208
- table['sodir'] = '$librubyverarch'
209
- when 'site'
210
- table['rbdir'] = '$siterubyver'
211
- table['sodir'] = '$siterubyverarch'
212
- when 'home'
213
- setup_rb_error '$HOME was not set' unless ENV['HOME']
214
- table['prefix'] = ENV['HOME']
215
- table['rbdir'] = '$libdir/ruby'
216
- table['sodir'] = '$libdir/ruby'
217
- end
218
- },
219
- PathItem.new('prefix', 'path', c['prefix'],
220
- 'path prefix of target environment'),
221
- PathItem.new('bindir', 'path', parameterize.call(c['bindir']),
222
- 'the directory for commands'),
223
- PathItem.new('libdir', 'path', parameterize.call(c['libdir']),
224
- 'the directory for libraries'),
225
- PathItem.new('datadir', 'path', parameterize.call(c['datadir']),
226
- 'the directory for shared data'),
227
- PathItem.new('mandir', 'path', parameterize.call(c['mandir']),
228
- 'the directory for man pages'),
229
- PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']),
230
- 'the directory for system configuration files'),
231
- PathItem.new('localstatedir', 'path', parameterize.call(c['localstatedir']),
232
- 'the directory for local state data'),
233
- PathItem.new('libruby', 'path', libruby,
234
- 'the directory for ruby libraries'),
235
- PathItem.new('librubyver', 'path', librubyver,
236
- 'the directory for standard ruby libraries'),
237
- PathItem.new('librubyverarch', 'path', librubyverarch,
238
- 'the directory for standard ruby extensions'),
239
- PathItem.new('siteruby', 'path', siteruby,
240
- 'the directory for version-independent aux ruby libraries'),
241
- PathItem.new('siterubyver', 'path', siterubyver,
242
- 'the directory for aux ruby libraries'),
243
- PathItem.new('siterubyverarch', 'path', siterubyverarch,
244
- 'the directory for aux ruby binaries'),
245
- PathItem.new('rbdir', 'path', '$siterubyver',
246
- 'the directory for ruby scripts'),
247
- PathItem.new('sodir', 'path', '$siterubyverarch',
248
- 'the directory for ruby extentions'),
249
- PathItem.new('rubypath', 'path', rubypath,
250
- 'the path to set to #! line'),
251
- ProgramItem.new('rubyprog', 'name', rubypath,
252
- 'the ruby program using for installation'),
253
- ProgramItem.new('makeprog', 'name', makeprog,
254
- 'the make program to compile ruby extentions'),
255
- SelectItem.new('shebang', 'all/ruby/never', 'ruby',
256
- 'shebang line (#!) editing mode'),
257
- BoolItem.new('without-ext', 'yes/no', 'no',
258
- 'does not compile/install ruby extentions')
252
+ ExecItem.new('installdirs', 'std/site/home', 'install under libruby, site_ruby or $HOME respectively', &installdir_lambda),
253
+ PathItem.new('root', 'path', root, 'root destination directory'),
254
+ PathItem.new('prefix', 'path', prefix, 'path prefix of target environment'),
255
+ PathItem.new('bindir', 'path', bindir, 'the directory for commands'),
256
+ PathItem.new('libdir', 'path', libdir, 'the directory for libraries'),
257
+ PathItem.new('datadir', 'path', datadir, 'the directory for shared data'),
258
+ PathItem.new('mandir', 'path', mandir, 'the directory for man pages'),
259
+ PathItem.new('sysconfdir', 'path', sysconfdir, 'the directory for system configuration files'),
260
+ PathItem.new('localstatedir', 'path', localstatedir, 'the directory for local state data'),
261
+ PathItem.new('libruby', 'path', libruby, 'the directory for ruby libraries'),
262
+ PathItem.new('librubyver', 'path', librubyver, 'the directory for standard ruby libraries'),
263
+ PathItem.new('librubyverarch', 'path', librubyverarch, 'the directory for standard ruby extensions'),
264
+ PathItem.new('siteruby', 'path', siteruby, 'the directory for version-independent aux ruby libraries'),
265
+ PathItem.new('siterubyver', 'path', siterubyver, 'the directory for aux ruby libraries'),
266
+ PathItem.new('siterubyverarch', 'path', siterubyverarch, 'the directory for aux ruby binaries'),
267
+ PathItem.new('rbdir', 'path', '$siterubyver', 'the directory for ruby scripts'),
268
+ PathItem.new('sodir', 'path', '$siterubyverarch', 'the directory for ruby extentions'),
269
+ PathItem.new('rubypath', 'path', rubypath, 'the path to set to #! line'),
270
+ ProgramItem.new('rubyprog', 'name', rubypath, 'the ruby program using for installation'),
271
+ ProgramItem.new('makeprog', 'name', makeprog, 'the make program to compile ruby extentions'),
272
+ SelectItem.new('shebang', 'all/ruby/never', 'ruby', 'shebang line (#!) editing mode'),
273
+ BoolItem.new('without-ext', 'yes/no', 'no', 'does not compile/install ruby extentions')
259
274
  ]
260
275
  end
261
276
  private :standard_entries
262
277
 
278
+ def paramize( path )
279
+ path.sub(/\A#{Regexp.quote(@rbconfig['prefix'])}/, '$prefix')
280
+ end
281
+ private :paramize
282
+
263
283
  def load_multipackage_entries
264
284
  multipackage_entries().each do |ent|
265
285
  add ent
@@ -268,10 +288,8 @@ class ConfigTable
268
288
 
269
289
  def multipackage_entries
270
290
  [
271
- PackageSelectionItem.new('with', 'name,name...', '', 'ALL',
272
- 'package names that you want to install'),
273
- PackageSelectionItem.new('without', 'name,name...', '', 'NONE',
274
- 'package names that you do not want to install')
291
+ PackageSelectionItem.new('with', 'name,name...', '', 'ALL', 'package names that you want to install'),
292
+ PackageSelectionItem.new('without', 'name,name...', '', 'NONE', 'package names that you do not want to install')
275
293
  ]
276
294
  end
277
295
  private :multipackage_entries
@@ -336,13 +354,8 @@ class ConfigTable
336
354
  "--#{@name}=#{@template}"
337
355
  end
338
356
 
339
- def value?
340
- true
341
- end
342
-
343
- def value
344
- @value
345
- end
357
+ def value? ; true ; end
358
+ def value ; @value ; end
346
359
 
347
360
  def resolve(table)
348
361
  @value.gsub(%r<\$([^/]+)>) { table[$1] }
@@ -361,9 +374,7 @@ class ConfigTable
361
374
  end
362
375
 
363
376
  class BoolItem < Item
364
- def config_type
365
- 'bool'
366
- end
377
+ def config_type() 'bool' end
367
378
 
368
379
  def help_opt
369
380
  "--#{@name}"
@@ -373,20 +384,19 @@ class ConfigTable
373
384
 
374
385
  def check(val)
375
386
  return 'yes' unless val
376
- unless /\A(y(es)?|n(o)?|t(rue)?|f(alse))\z/i =~ val
387
+ case val
388
+ when /\Ay(es)?\z/i, /\At(rue)?\z/i then 'yes'
389
+ when /\An(o)?\z/i, /\Af(alse)\z/i then 'no'
390
+ else
377
391
  setup_rb_error "config: --#{@name} accepts only yes/no for argument"
378
392
  end
379
- (/\Ay(es)?|\At(rue)/i =~ value) ? 'yes' : 'no'
380
393
  end
381
394
  end
382
395
 
383
396
  class PathItem < Item
384
- def config_type
385
- 'path'
386
- end
397
+ def config_type() 'path' end
387
398
 
388
399
  private
389
-
390
400
  def check(path)
391
401
  setup_rb_error "config: --#{@name} requires argument" unless path
392
402
  path[0,1] == '$' ? path : File.expand_path(path)
@@ -394,9 +404,7 @@ class ConfigTable
394
404
  end
395
405
 
396
406
  class ProgramItem < Item
397
- def config_type
398
- 'program'
399
- end
407
+ def config_type() 'program' end
400
408
  end
401
409
 
402
410
  class SelectItem < Item
@@ -405,12 +413,9 @@ class ConfigTable
405
413
  @ok = selection.split('/')
406
414
  end
407
415
 
408
- def config_type
409
- 'select'
410
- end
416
+ def config_type() 'select' end
411
417
 
412
418
  private
413
-
414
419
  def check(val)
415
420
  unless @ok.include?(val.strip)
416
421
  setup_rb_error "config: use --#{@name}=#{@template} (#{val})"
@@ -472,7 +477,7 @@ class ConfigTable
472
477
  end
473
478
 
474
479
  class MetaConfigEnvironment
475
- def intiailize(config, installer)
480
+ def initialize(config, installer)
476
481
  @config = config
477
482
  @installer = installer
478
483
  end
@@ -537,7 +542,9 @@ end # class ConfigTable
537
542
  module FileOperations
538
543
 
539
544
  def mkdir_p(dirname, prefix = nil)
540
- dirname = prefix + File.expand_path(dirname) if prefix
545
+ dirname = File.join(prefix, File.expand_path(dirname)) if prefix
546
+ dirname = File.join( $setup_install_root, dirname ) if $setup_install_root
547
+
541
548
  $stderr.puts "mkdir -p #{dirname}" if verbose?
542
549
  return if no_harm?
543
550
 
@@ -621,11 +628,15 @@ module FileOperations
621
628
  end
622
629
 
623
630
  def install(from, dest, mode, prefix = nil)
631
+
632
+ realdest = prefix ? File.join(prefix, File.expand_path(dest)) : dest
633
+ realdest = File.join($setup_install_root, File.expand_path(realdest)) if $setup_install_root
634
+
624
635
  $stderr.puts "install #{from} #{dest}" if verbose?
625
636
  return if no_harm?
626
637
 
627
- realdest = prefix ? prefix + File.expand_path(dest) : dest
628
638
  realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest)
639
+
629
640
  str = File.binread(from)
630
641
  if diff?(str, realdest)
631
642
  verbose_off {
@@ -636,6 +647,10 @@ module FileOperations
636
647
  }
637
648
  File.chmod mode, realdest
638
649
 
650
+ # Do not make InstalledFiles entry if to alternate root.
651
+ # This prevents problem with root permissions on this file.
652
+ return true unless $setup_install_root
653
+
639
654
  File.open("#{objdir_root()}/InstalledFiles", 'a') {|f|
640
655
  if prefix
641
656
  f.puts realdest.sub(prefix, '')
@@ -660,7 +675,7 @@ module FileOperations
660
675
  def ruby(*args)
661
676
  command config('rubyprog'), *args
662
677
  end
663
-
678
+
664
679
  def make(task = nil)
665
680
  command(*[config('makeprog'), task].compact)
666
681
  end
@@ -700,33 +715,14 @@ module HookScriptAPI
700
715
  @config[key] = val
701
716
  end
702
717
 
703
- #
704
718
  # srcdir/objdir (works only in the package directory)
705
- #
706
-
707
- def curr_srcdir
708
- "#{srcdir_root()}/#{relpath()}"
709
- end
710
-
711
- def curr_objdir
712
- "#{objdir_root()}/#{relpath()}"
713
- end
714
-
715
- def srcfile(path)
716
- "#{curr_srcdir()}/#{path}"
717
- end
718
719
 
719
- def srcexist?(path)
720
- File.exist?(srcfile(path))
721
- end
722
-
723
- def srcdirectory?(path)
724
- File.dir?(srcfile(path))
725
- end
726
-
727
- def srcfile?(path)
728
- File.file?(srcfile(path))
729
- end
720
+ def curr_srcdir() "#{srcdir_root()}/#{relpath()}" end
721
+ def curr_objdir() "#{objdir_root()}/#{relpath()}" end
722
+ def srcfile(path) "#{curr_srcdir()}/#{path}" end
723
+ def srcexist?(path) File.exist?(srcfile(path)) end
724
+ def srcdirectory?(path) File.dir?(srcfile(path)) end
725
+ def srcfile?(path) File.file?(srcfile(path)) end
730
726
 
731
727
  def srcentries(path = '.')
732
728
  Dir.open("#{curr_srcdir()}/#{path}") {|d|
@@ -751,7 +747,7 @@ end
751
747
 
752
748
  class ToplevelInstaller
753
749
 
754
- Version = '3.4.0'
750
+ Version = '3.4.1'
755
751
  Copyright = 'Copyright (c) 2000-2005 Minero Aoki'
756
752
 
757
753
  TASKS = [
@@ -765,8 +761,8 @@ class ToplevelInstaller
765
761
  [ 'distclean',"does `make distclean' for each extention" ]
766
762
  ]
767
763
 
768
- def ToplevelInstaller.invoke
769
- config = ConfigTable.new(load_rbconfig())
764
+ def self.invoke
765
+ config = ConfigTable.new(load_rbconfig)
770
766
  config.load_standard_entries
771
767
  config.load_multipackage_entries if multipackage?
772
768
  config.fixup
@@ -774,11 +770,11 @@ class ToplevelInstaller
774
770
  klass.new(File.dirname($0), config).invoke
775
771
  end
776
772
 
777
- def ToplevelInstaller.multipackage?
773
+ def self.multipackage?
778
774
  File.dir?(File.dirname($0) + '/packages')
779
775
  end
780
776
 
781
- def ToplevelInstaller.load_rbconfig
777
+ def self.load_rbconfig
782
778
  if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg }
783
779
  ARGV.delete(arg)
784
780
  load File.expand_path(arg.split(/=/, 2)[1])
@@ -789,6 +785,7 @@ class ToplevelInstaller
789
785
  ::Config::CONFIG
790
786
  end
791
787
 
788
+
792
789
  def initialize(ardir_root, config)
793
790
  @ardir = File.expand_path(ardir_root)
794
791
  @config = config
@@ -827,7 +824,7 @@ class ToplevelInstaller
827
824
  __send__ "exec_#{task}"
828
825
  end
829
826
  end
830
-
827
+
831
828
  def run_metaconfigs
832
829
  @config.load_script "#{@ardir}/metaconfig"
833
830
  end
@@ -840,17 +837,9 @@ class ToplevelInstaller
840
837
  # Hook Script API bases
841
838
  #
842
839
 
843
- def srcdir_root
844
- @ardir
845
- end
846
-
847
- def objdir_root
848
- '.'
849
- end
850
-
851
- def relpath
852
- '.'
853
- end
840
+ def srcdir_root() @ardir end
841
+ def objdir_root() '.' end
842
+ def relpath() '.' end
854
843
 
855
844
  #
856
845
  # Option Parsing
@@ -892,6 +881,7 @@ class ToplevelInstaller
892
881
 
893
882
  def parsearg_no_options
894
883
  unless ARGV.empty?
884
+ task = caller(0).first.slice(%r<`parsearg_(\w+)'>, 1)
895
885
  setup_rb_error "#{task}: unknown options: #{ARGV.join(' ')}"
896
886
  end
897
887
  end
@@ -979,6 +969,7 @@ class ToplevelInstaller
979
969
  out.puts
980
970
  out.puts 'Options for INSTALL:'
981
971
  out.printf fmt, '--no-harm', 'only display what to do if given', 'off'
972
+ out.printf fmt, '--root=path', 'install root directory (effects all paths)', '/'
982
973
  out.printf fmt, '--prefix=path', 'install path prefix', ''
983
974
  out.puts
984
975
  end
@@ -1173,21 +1164,15 @@ class Installer
1173
1164
  "#<#{self.class} #{File.basename(@srcdir)}>"
1174
1165
  end
1175
1166
 
1167
+ def noop(rel) ; end
1168
+
1176
1169
  #
1177
1170
  # Hook Script API base methods
1178
1171
  #
1179
1172
 
1180
- def srcdir_root
1181
- @srcdir
1182
- end
1183
-
1184
- def objdir_root
1185
- @objdir
1186
- end
1187
-
1188
- def relpath
1189
- @currdir
1190
- end
1173
+ def srcdir_root() @srcdir end
1174
+ def objdir_root() @objdir end
1175
+ def relpath() @currdir end
1191
1176
 
1192
1177
  #
1193
1178
  # Config Access
@@ -1220,29 +1205,21 @@ class Installer
1220
1205
  exec_task_traverse 'config'
1221
1206
  end
1222
1207
 
1223
- def config_dir_bin(rel)
1224
- end
1225
-
1226
- def config_dir_lib(rel)
1227
- end
1228
-
1229
- def config_dir_man(rel)
1230
- end
1208
+ alias config_dir_bin noop
1209
+ alias config_dir_lib noop
1231
1210
 
1232
1211
  def config_dir_ext(rel)
1233
1212
  extconf if extdir?(curr_srcdir())
1234
1213
  end
1235
1214
 
1215
+ alias config_dir_data noop
1216
+ alias config_dir_conf noop
1217
+ alias config_dir_man noop
1218
+
1236
1219
  def extconf
1237
1220
  ruby "#{curr_srcdir()}/extconf.rb", *@config.config_opt
1238
1221
  end
1239
1222
 
1240
- def config_dir_data(rel)
1241
- end
1242
-
1243
- def config_dir_conf(rel)
1244
- end
1245
-
1246
1223
  #
1247
1224
  # TASK setup
1248
1225
  #
@@ -1253,43 +1230,89 @@ class Installer
1253
1230
 
1254
1231
  def setup_dir_bin(rel)
1255
1232
  files_of(curr_srcdir()).each do |fname|
1256
- adjust_shebang "#{curr_srcdir()}/#{fname}"
1233
+ update_shebang_line "#{curr_srcdir()}/#{fname}"
1257
1234
  end
1258
1235
  end
1259
1236
 
1260
- def adjust_shebang(path)
1237
+ alias setup_dir_lib noop
1238
+
1239
+ def setup_dir_ext(rel)
1240
+ make if extdir?(curr_srcdir())
1241
+ end
1242
+
1243
+ alias setup_dir_data noop
1244
+ alias setup_dir_conf noop
1245
+ alias setup_dir_man noop
1246
+
1247
+ def update_shebang_line(path)
1261
1248
  return if no_harm?
1249
+ return if config('shebang') == 'never'
1250
+ old = Shebang.load(path)
1251
+ if old
1252
+ $stderr.puts "warning: #{path}: Shebang line includes too many args. It is not portable and your program may not work." if old.args.size > 1
1253
+ new = new_shebang(old)
1254
+ return if new.to_s == old.to_s
1255
+ else
1256
+ return unless config('shebang') == 'all'
1257
+ new = Shebang.new(config('rubypath'))
1258
+ end
1259
+ $stderr.puts "updating shebang: #{File.basename(path)}" if verbose?
1260
+ open_atomic_writer(path) {|output|
1261
+ File.open(path, 'rb') {|f|
1262
+ f.gets if old # discard
1263
+ output.puts new.to_s
1264
+ output.print f.read
1265
+ }
1266
+ }
1267
+ end
1268
+
1269
+ def new_shebang(old)
1270
+ if /\Aruby/ =~ File.basename(old.cmd)
1271
+ Shebang.new(config('rubypath'), old.args)
1272
+ elsif File.basename(old.cmd) == 'env' and old.args.first == 'ruby'
1273
+ Shebang.new(config('rubypath'), old.args[1..-1])
1274
+ else
1275
+ return old unless config('shebang') == 'all'
1276
+ Shebang.new(config('rubypath'))
1277
+ end
1278
+ end
1279
+
1280
+ def open_atomic_writer(path, &block)
1262
1281
  tmpfile = File.basename(path) + '.tmp'
1263
1282
  begin
1264
- File.open(path, 'rb') {|r|
1265
- first = r.gets
1266
- return unless File.basename(first.sub(/\A\#!/, '').split[0].to_s) == 'ruby'
1267
- $stderr.puts "adjusting shebang: #{File.basename(path)}" if verbose?
1268
- File.open(tmpfile, 'wb') {|w|
1269
- w.print first.sub(/\A\#!\s*\S+/, '#! ' + config('rubypath'))
1270
- w.write r.read
1271
- }
1272
- }
1273
- move_file tmpfile, File.basename(path)
1283
+ File.open(tmpfile, 'wb', &block)
1284
+ File.rename tmpfile, File.basename(path)
1274
1285
  ensure
1275
1286
  File.unlink tmpfile if File.exist?(tmpfile)
1276
1287
  end
1277
1288
  end
1278
1289
 
1279
- def setup_dir_lib(rel)
1280
- end
1290
+ class Shebang
1291
+ def Shebang.load(path)
1292
+ line = nil
1293
+ File.open(path) {|f|
1294
+ line = f.gets
1295
+ }
1296
+ return nil unless /\A#!/ =~ line
1297
+ parse(line)
1298
+ end
1281
1299
 
1282
- def setup_dir_man(rel)
1283
- end
1300
+ def Shebang.parse(line)
1301
+ cmd, *args = *line.strip.sub(/\A\#!/, '').split(' ')
1302
+ new(cmd, args)
1303
+ end
1284
1304
 
1285
- def setup_dir_ext(rel)
1286
- make if extdir?(curr_srcdir())
1287
- end
1305
+ def initialize(cmd, args = [])
1306
+ @cmd = cmd
1307
+ @args = args
1308
+ end
1288
1309
 
1289
- def setup_dir_data(rel)
1290
- end
1310
+ attr_reader :cmd
1311
+ attr_reader :args
1291
1312
 
1292
- def setup_dir_conf(rel)
1313
+ def to_s
1314
+ "#! #{@cmd}" + (@args.empty? ? '' : " #{@args.join(' ')}")
1315
+ end
1293
1316
  end
1294
1317
 
1295
1318
  #
@@ -1306,7 +1329,7 @@ class Installer
1306
1329
  end
1307
1330
 
1308
1331
  def install_dir_lib(rel)
1309
- install_files rubyscripts(), "#{config('rbdir')}/#{rel}", 0644
1332
+ install_files libfiles(), "#{config('rbdir')}/#{rel}", 0644
1310
1333
  end
1311
1334
 
1312
1335
  def install_dir_ext(rel)
@@ -1332,13 +1355,14 @@ class Installer
1332
1355
 
1333
1356
  def install_files(list, dest, mode)
1334
1357
  mkdir_p dest, @config.install_prefix
1358
+ #mkdir_p dest, offset_dir
1335
1359
  list.each do |fname|
1336
1360
  install fname, dest, mode, @config.install_prefix
1337
1361
  end
1338
1362
  end
1339
1363
 
1340
- def rubyscripts
1341
- glob_select(@config.libsrc_pattern, targetfiles())
1364
+ def libfiles
1365
+ glob_reject(%w(*.y *.output), targetfiles())
1342
1366
  end
1343
1367
 
1344
1368
  def rubyextentions(dir)
@@ -1416,7 +1440,11 @@ class Installer
1416
1440
  return
1417
1441
  end
1418
1442
  $stderr.puts 'Running tests...' if verbose?
1419
- require 'test/unit'
1443
+ begin
1444
+ require 'test/unit'
1445
+ rescue LoadError
1446
+ setup_rb_error 'test/unit cannot loaded. You need Ruby 1.8 or later to invoke this task.'
1447
+ end
1420
1448
  runner = Test::Unit::AutoRunner.new(true)
1421
1449
  runner.to_run << TESTDIR
1422
1450
  runner.run
@@ -1432,23 +1460,17 @@ class Installer
1432
1460
  rm_f 'InstalledFiles'
1433
1461
  end
1434
1462
 
1435
- def clean_dir_bin(rel)
1436
- end
1437
-
1438
- def clean_dir_lib(rel)
1439
- end
1463
+ alias clean_dir_bin noop
1464
+ alias clean_dir_lib noop
1465
+ alias clean_dir_data noop
1466
+ alias clean_dir_conf noop
1467
+ alias clean_dir_man noop
1440
1468
 
1441
1469
  def clean_dir_ext(rel)
1442
1470
  return unless extdir?(curr_srcdir())
1443
1471
  make 'clean' if File.file?('Makefile')
1444
1472
  end
1445
1473
 
1446
- def clean_dir_data(rel)
1447
- end
1448
-
1449
- def clean_dir_conf(rel)
1450
- end
1451
-
1452
1474
  #
1453
1475
  # TASK distclean
1454
1476
  #
@@ -1459,31 +1481,26 @@ class Installer
1459
1481
  rm_f 'InstalledFiles'
1460
1482
  end
1461
1483
 
1462
- def distclean_dir_bin(rel)
1463
- end
1464
-
1465
- def distclean_dir_lib(rel)
1466
- end
1484
+ alias distclean_dir_bin noop
1485
+ alias distclean_dir_lib noop
1467
1486
 
1468
1487
  def distclean_dir_ext(rel)
1469
1488
  return unless extdir?(curr_srcdir())
1470
1489
  make 'distclean' if File.file?('Makefile')
1471
1490
  end
1472
1491
 
1473
- def distclean_dir_data(rel)
1474
- end
1475
-
1476
- def distclean_dir_conf(rel)
1477
- end
1492
+ alias distclean_dir_data noop
1493
+ alias distclean_dir_conf noop
1494
+ alias distclean_dir_man noop
1478
1495
 
1479
1496
  #
1480
- # lib
1497
+ # Traversing
1481
1498
  #
1482
1499
 
1483
1500
  def exec_task_traverse(task)
1484
1501
  run_hook "pre-#{task}"
1485
1502
  FILETYPES.each do |type|
1486
- if config('without-ext') == 'yes' and type == 'ext'
1503
+ if type == 'ext' and config('without-ext') == 'yes'
1487
1504
  $stderr.puts 'skipping ext/* by user option' if verbose?
1488
1505
  next
1489
1506
  end