reap 4.3.3 → 4.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/COPYING +400 -8
  2. data/ProjectInfo +26 -26
  3. data/ProjectInfo.rb +88 -0
  4. data/bin/reap +1 -1
  5. data/bin/rubytest +1 -1
  6. data/data/reap/scaffold/standard/COPYING +403 -0
  7. data/data/reap/scaffold/{ChangeLog → standard/ChangeLog} +0 -0
  8. data/data/reap/scaffold/standard/INSTALL +14 -0
  9. data/data/reap/scaffold/{ProjectInfo → standard/ProjectInfo} +12 -12
  10. data/data/reap/scaffold/standard/README +3 -0
  11. data/data/reap/scaffold/standard/Rakefile +10 -0
  12. data/data/reap/scaffold/{INSTALL → standard/TODO} +0 -0
  13. data/data/reap/scaffold/subversion/trunk/COPYING +403 -0
  14. data/data/reap/scaffold/{README → subversion/trunk/ChangeLog} +0 -0
  15. data/data/reap/scaffold/subversion/trunk/INSTALL +14 -0
  16. data/data/reap/scaffold/subversion/trunk/ProjectInfo +78 -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/{Todo → subversion/trunk/TODO} +0 -0
  20. data/data/reap/{setup-3.4.1/setup.rb → setup.rb} +181 -202
  21. data/{ChangeLog → doc/ChangeLog} +0 -0
  22. data/doc/doap.xml +27 -0
  23. data/doc/note/Rakefile.htm +69 -0
  24. data/{note/Rakefile → doc/note/aRakefile} +0 -0
  25. data/{note → doc/note}/composite_task.rb +0 -0
  26. data/{note → doc/note}/compositepublisher.rb +0 -0
  27. data/{note → doc/note}/ftptools.rb +0 -0
  28. data/{note → doc/note}/interface/interface.rb +0 -0
  29. data/{note → doc/note}/interface/rubyforge.rb +0 -0
  30. data/{note → doc/note}/license-each.rb +0 -0
  31. data/{note → doc/note}/package.rb.0 +0 -0
  32. data/{note → doc/note}/publisher.rb +0 -0
  33. data/{note → doc/note}/rubyforgepublisher.rb +0 -0
  34. data/{lib/reap/task → doc/note}/scaffold.rb +4 -3
  35. data/{lib/reap → doc/note}/setup.rb +7 -6
  36. data/{note → doc/note}/sshpublisher.rb +0 -0
  37. data/{note → doc/note}/suby-cvs.rb +0 -0
  38. data/{note → doc/note}/template.rb +0 -0
  39. data/lib/reap/bin/reap.rb +75 -51
  40. data/lib/reap/bin/{lint.rb → rubylint.rb} +0 -0
  41. data/lib/reap/projectinfo.rb +107 -50
  42. data/lib/reap/reap.rb +60 -0
  43. data/lib/reap/task.rb +46 -60
  44. data/lib/reap/task/doap.rb +67 -0
  45. data/lib/reap/task/info.rb +2 -2
  46. data/lib/reap/task/install.rb +29 -18
  47. data/lib/reap/task/package.rb +56 -56
  48. data/lib/reap/task/release.rb +34 -13
  49. data/package.rb +627 -0
  50. data/setup.rb +287 -272
  51. data/test/tc_reap.rb +1 -1
  52. metadata +64 -61
  53. data/ANN +0 -8
  54. data/data/reap/scaffold/COPYING +0 -11
  55. data/data/reap/scaffold/Rakefile +0 -146
  56. data/data/reap/scaffold/setup.rb +0 -1551
  57. data/data/reap/setup-3.4.1/COPYING +0 -515
  58. data/data/reap/setup-3.4.1/ChangeLog +0 -732
  59. data/data/reap/setup-3.4.1/Makefile +0 -56
  60. data/data/reap/setup-3.4.1/NEWS.en +0 -155
  61. data/data/reap/setup-3.4.1/NEWS.ja +0 -152
  62. data/data/reap/setup-3.4.1/README.en +0 -30
  63. data/data/reap/setup-3.4.1/README.ja +0 -34
  64. data/data/reap/setup-3.4.1/TODO +0 -14
  65. data/data/reap/setup-3.4.1/Template.README.en +0 -41
  66. data/data/reap/setup-3.4.1/Template.README.ja +0 -46
  67. data/data/reap/setup-3.4.1/Usage_en.txt +0 -231
  68. data/data/reap/setup-3.4.1/Usage_ja.txt +0 -250
  69. data/data/reap/setup-3.4.1/doc.en/hookapi.html +0 -91
  70. data/data/reap/setup-3.4.1/doc.en/index.html +0 -28
  71. data/data/reap/setup-3.4.1/doc.en/metaconfapi.html +0 -79
  72. data/data/reap/setup-3.4.1/doc.en/news.html +0 -189
  73. data/data/reap/setup-3.4.1/doc.en/usage.html +0 -297
  74. data/data/reap/setup-3.4.1/doc.ja/hookapi.html +0 -84
  75. data/data/reap/setup-3.4.1/doc.ja/index.html +0 -28
  76. data/data/reap/setup-3.4.1/doc.ja/metaconfapi.html +0 -80
  77. data/data/reap/setup-3.4.1/doc.ja/news.html +0 -186
  78. data/data/reap/setup-3.4.1/doc.ja/usage.html +0 -319
  79. data/data/reap/setup-3.4.1/sample/add-task.rb +0 -15
  80. data/data/reap/setup-3.4.1/test/test_installer.rb +0 -136
data/lib/reap/reap.rb ADDED
@@ -0,0 +1,60 @@
1
+
2
+ # Reap support
3
+ require 'reap/projectinfo'
4
+ require 'reap/task'
5
+
6
+ # Reap tasks
7
+ require 'reap/task/fileperm'
8
+ require 'reap/task/test'
9
+ require 'reap/task/testext'
10
+ require 'reap/task/rdoc'
11
+ require 'reap/task/announce'
12
+ require 'reap/task/package'
13
+ require 'reap/task/publish'
14
+ require 'reap/task/info'
15
+ require 'reap/task/install'
16
+ require 'reap/task/release'
17
+ require 'reap/task/doap'
18
+ #require 'reap/task/noop'
19
+
20
+
21
+ module Reap
22
+
23
+ Version = "4.3.4"
24
+
25
+ # Hash of all possible tasks
26
+ # { task name => task class }
27
+
28
+ def self.registry
29
+ Task.task_list
30
+ end
31
+
32
+ # Hash of tasks available to this project
33
+
34
+ def self.tasks
35
+ unless @tasks
36
+ @tasks = {}
37
+ registry.each do |name, klass|
38
+ @tasks[name] = klass if klass.verify?
39
+ end
40
+ end
41
+ @tasks
42
+ end
43
+
44
+ def self.register( alternative_project_file=nil )
45
+ $PROJECT_INFO = ProjectInfo.new( alternative_project_file )
46
+ $PROJECT_INFO.exists?
47
+ end
48
+
49
+ def self.projectfile?
50
+ $PROJECT_INFO.exists?
51
+ end
52
+
53
+ # def self.initialize
54
+ # @tasks ||= {}
55
+ # registry.each do |name, klass|
56
+ # @tasks[name] = klass.new
57
+ # end
58
+ # end
59
+
60
+ end
data/lib/reap/task.rb CHANGED
@@ -18,73 +18,35 @@ require 'facet/openobject'
18
18
 
19
19
  # Base class for reap tasks.
20
20
  #
21
- # Here's an oh so simple example:
21
+ # Here's a simple example:
22
22
  #
23
23
  # class MyTask < Reap::Task
24
24
  #
25
- # register 'mytask'
25
+ # task_desc 'this is a custom reap task'
26
26
  #
27
- # default_desc 'this is a custom reap task'
28
- #
29
- # attr_accessor :message
27
+ # task_attr :mytask
30
28
  #
31
29
  # def init
32
- # @message ||= master['default'] || 'None Found!'
30
+ # mytask.message ||= 'None Found!'
33
31
  # end
34
32
  #
35
33
  # def run
36
- # puts @message
34
+ # puts mytask.message #=> Hello!
35
+ # puts master.default #=> Yo!
36
+ # puts mytask.default #=> Yo! (inherited from master)
37
37
  # end
38
38
  # end
39
39
  #
40
- # The corresponding settings in the ProjectInfo file will then be:
40
+ # With the corresponding settings in the ProjectInfo file as:
41
41
  #
42
- # default: Default text, if any.
42
+ # default: Yo!
43
43
  #
44
- # myname:
45
- # TASK: mytask
46
- # message: Message text, if any.
44
+ # mytask:
45
+ # message: Hello!
47
46
  #
48
47
 
49
48
  module Reap
50
49
 
51
- @registry ||= {}
52
-
53
- # Hash of all task classes
54
- def self.registry ; @registry ; end
55
-
56
- # Hash of tasks available to this project
57
- def self.tasks
58
- unless @tasks
59
- @tasks = {}
60
- @registry.each { |name, klass|
61
- @tasks[name] = klass if klass.verify?
62
- }
63
- end
64
- @tasks
65
- end
66
-
67
- def self.register
68
- $PROJECT_INFO = ProjectInfo.new( $PROJECT_FILE )
69
-
70
- #@registry ||= {}
71
- #ObjectSpace.each_object(Class) { |klass|
72
- # if klass < ::Reap::Task
73
- # if klass.verify
74
- # @registry[klass.basename.downcase] = klass
75
- # end
76
- # end
77
- #}
78
- end
79
-
80
- # def self.initialize
81
- # @tasks ||= {}
82
- # registry.each do |name, klass|
83
- # @tasks[name] = klass.new
84
- # end
85
- # end
86
-
87
-
88
50
  class Task
89
51
 
90
52
  include ::Config
@@ -94,11 +56,19 @@ module Reap
94
56
 
95
57
  class << self
96
58
 
59
+ # When this class is inherited the new task is registered.
60
+
97
61
  def inherited( base )
98
- Reap.registry[base.task_name] = base
62
+ task_list[base.task_name] = base
99
63
  end
100
64
 
101
- def task_name ; basename.downcase ; end
65
+ def task_list
66
+ @task_list ||= {}
67
+ end
68
+
69
+ def task_name
70
+ basename.downcase
71
+ end
102
72
 
103
73
  def task_desc( text=nil, &block )
104
74
  return @task_desc = proc { text } if text
@@ -127,6 +97,10 @@ module Reap
127
97
  true
128
98
  end
129
99
 
100
+ def master
101
+ @master ||= CascadingOpenObject.new( $PROJECT_INFO )
102
+ end
103
+
130
104
  # def master_attributes ; @master_attributes ||= [] ; end
131
105
  #
132
106
  # # Use this DSL method to define master task attributes.
@@ -139,11 +113,11 @@ module Reap
139
113
  # properties not to be looked up in master
140
114
  # if they are not in regular task section
141
115
 
142
- def task_only_properties ; @task_only_properties ||= [] ; end
143
- def task_only_property( *names )
144
- @task_only_properties ||= []
145
- @task_only_properties |= names.collect { |n| n.to_s }
146
- end
116
+ # def task_only_properties ; @task_only_properties ||= [] ; end
117
+ # def task_only_property( *names )
118
+ # @task_only_properties ||= []
119
+ # @task_only_properties |= names.collect { |n| n.to_s }
120
+ # end
147
121
 
148
122
  end #<< class
149
123
 
@@ -156,13 +130,13 @@ module Reap
156
130
  def section_required? ; self.class.section_required? ; end
157
131
 
158
132
  #def master ; ::ProjectInfo.info ; end
159
- def master ; @master ; end
133
+ def master ; self.class.master ; end
160
134
  def section ; @section ; end
161
135
  def task ; @task ; end
162
136
 
163
137
  def initialize( *args )
164
- @master = CascadingOpenObject.new( $PROJECT_INFO )
165
- section = @master[task_name]
138
+ #@master = CascadingOpenObject.new( $PROJECT_INFO )
139
+ section = master[task_name]
166
140
  case section
167
141
  when Array
168
142
  section.each do |s|
@@ -181,7 +155,7 @@ module Reap
181
155
  task_properties = {}
182
156
  #self.class.task_only_properties.each { |t| section[t] ||= nil }
183
157
  task_properties = CascadingOpenObject.new( section )
184
- task_properties.__parent__ = @master
158
+ task_properties.__parent__ = master
185
159
  @task = task_properties
186
160
 
187
161
  init #task
@@ -226,6 +200,18 @@ module Reap
226
200
  system arg unless $PRETEND
227
201
  end
228
202
 
203
+ def provide_setup_rb
204
+ return true if File.exists?( 'setup.rb')
205
+ # copy from data dir to current directory
206
+ f = File.join( Config::CONFIG['datadir'], 'reap', 'setup_rb', 'setup.rb' )
207
+ if File.exists?(f)
208
+ File.cp( f, '.' )
209
+ true
210
+ else
211
+ nil
212
+ end
213
+ end
214
+
229
215
  end #class Task
230
216
 
231
217
  end #module Reap
@@ -0,0 +1,67 @@
1
+
2
+ module Reap
3
+
4
+ class Doap < Task
5
+
6
+ task_desc %{Generate DOAP project file.}
7
+
8
+ task_help %{
9
+
10
+ reap doap
11
+
12
+ DOAP is an XML/RTF format for describing a project. It contains
13
+ much of the same information as Reap's ProjectInfo file, but is
14
+ more suitable to RESTful interapplication communications, like
15
+ RSS/Atom feeds.
16
+
17
+ }
18
+
19
+ task_attr :prj
20
+
21
+ # Setup doap data
22
+
23
+ def init
24
+
25
+ end
26
+
27
+ # Generate doap file
28
+
29
+ def run
30
+ puts "Generating doap.xml file..."
31
+
32
+ x = ''
33
+ x << %{
34
+ |<Project xmlns="http://usefulinc.com/ns/doap#"\n
35
+ | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n
36
+ | xmlns:foaf="http://xmlns.com/foaf/0.1/">
37
+ | <name>#{prj.title}</name>
38
+ | <shortname>#{prj.name}</shortname>
39
+ | <homepage rdf:resource="#{prj.homepage}" />
40
+ | <wiki rdf:resource="#{prj.wiki}" />
41
+ | <created>#{prj.created}</created>
42
+ | <shortdesc xml:lang="en">
43
+ }.margin
44
+ x << "\n" << prj.summary.word_wrap(50).indent(6)
45
+ x << %{
46
+ | </shortdesc>
47
+ | <description xml:lang="en">
48
+ }.margin
49
+ x << "\n" << prj.description.word_wrap(50).indent(6)
50
+ x << %{
51
+ | </description>
52
+ | <maintainer>
53
+ | <foaf:Person>
54
+ | <foaf:name>#{prj.maintainer}</foaf:name>
55
+ | <foaf:email>#{prj.email}</foaf:name>
56
+ | <foaf:homepage rdf:resource="#{prj.homepage}" />
57
+ | </foaf:Person>
58
+ | </maintainer>
59
+ | </Project>
60
+ }.margin
61
+
62
+ File.open( "doap.xml", 'w' ) { |f| f << x }
63
+ end
64
+
65
+ end
66
+
67
+ end
@@ -23,11 +23,11 @@ class Reap::Info < Reap::Task
23
23
 
24
24
  }
25
25
 
26
- def init( na )
26
+ def init
27
27
  # no initialization
28
28
  end
29
29
 
30
- def run( na )
30
+ def run
31
31
  puts $PROJECT_INFO.info_stream
32
32
  end
33
33
 
@@ -23,26 +23,37 @@ class Reap::Install < Reap::Task
23
23
  #exe = %w{ setup.rb install.rb }.find{ |f| File.exists?(f) }
24
24
  #raise "setup.rb or install.rb not found" if exe == nil
25
25
 
26
- puts "Reap is shelling out work to setup.rb..."
27
-
28
- # prepare for using internalized setup.rb
29
-
30
- ARGV.delete('install')
31
- ARGV << '-q' unless $VERBOSE
32
- ARGV.concat(task.options)
33
-
34
- $setup_pwd = $PROJECT_INFO.info_dir #Dir.pwd
26
+ unless provide_setup_rb
27
+ puts "Setup.rb is missing. Forced to skip debian package creation."
28
+ return nil
29
+ end
35
30
 
36
- # invoke setup.rb
31
+ puts "Reap is shelling out work to setup.rb..."
37
32
 
38
- begin
39
- ToplevelInstaller.invoke
40
- rescue SetupError
41
- raise if $DEBUG
42
- $stderr.puts $!.message
43
- $stderr.puts "Try 'reap --help' for detailed usage."
44
- exit 1
45
- end
33
+ # # prepare for using internalized setup.rb
34
+ #
35
+ # ARGV.delete('install')
36
+ # ARGV << '-q' unless $VERBOSE
37
+ # ARGV.concat(task.options)
38
+ #
39
+ # $setup_pwd = $PROJECT_INFO.info_dir #Dir.pwd
40
+ #
41
+ # # invoke setup.rb
42
+ #
43
+ # begin
44
+ # ToplevelInstaller.invoke
45
+ # rescue SetupError
46
+ # raise if $DEBUG
47
+ # $stderr.puts $!.message
48
+ # $stderr.puts "Try 'reap --help' for detailed usage."
49
+ # exit 1
50
+ # end
51
+
52
+ exe = %{ruby setup.rb}
53
+ exe << ' -q ' unless $VERBOSE
54
+ exe << task.options.join(' ')
55
+ exe << ' all'
56
+ sh exe
46
57
 
47
58
  puts "Setup complete!"
48
59
  end
@@ -16,7 +16,7 @@ end
16
16
  # = Package Task
17
17
  #
18
18
  # This task creates standard .zip, .tgz, or .tbz
19
- # packages, plus .gem distributions.
19
+ # packages, plus .gem or .deb distributions.
20
20
 
21
21
 
22
22
  class Reap::Package < Reap::Task
@@ -27,7 +27,11 @@ class Reap::Package < Reap::Task
27
27
  # Task line description
28
28
 
29
29
  task_desc do
30
- disttypes = $PROJECT_INFO['distribute'] || [ 'gem', 'tar.bz2', 'zip' ]
30
+ if master.package
31
+ disttypes = master.package.distribute || master.distribute || [ 'gem', 'tar.bz2', 'zip' ]
32
+ else
33
+ disttypes = master.distribute || [ 'gem', 'tar.bz2', 'zip' ]
34
+ end
31
35
  "Build distribution packages (#{disttypes.join(', ')})."
32
36
  end
33
37
 
@@ -64,7 +68,7 @@ class Reap::Package < Reap::Task
64
68
 
65
69
  The package task also has subsection for each type of distribution.
66
70
  These can be used to override settings in the package information
67
- if it in some way differs. Possible subsections are:
71
+ if they in some way differ. Possible subsections are:
68
72
 
69
73
  gems
70
74
  pacman
@@ -147,27 +151,21 @@ class Reap::Package < Reap::Task
147
151
 
148
152
  def run
149
153
 
150
- puts "Creating #{pkg.distribute.join(',')} packages..."
151
-
152
- # create package image
153
154
  group_dir_path = File.join( pkg.dir, pkg.package_name )
154
155
  package_dir_path = File.join( pkg.dir, pkg.package_name, pkg.package_name )
155
156
 
156
157
  if FileTest.directory?(group_dir_path)
157
- print "Package directory '#{pkg.package_name}' already exists. Continue or [R]emove and continue? [y/r/N] "
158
- until inp = $stdin.gets[0,1] ; sleep 1 ; end
159
- inp = inp.to_s.downcase
160
- case inp
161
- when 'y'
162
- # continue...
163
- when 'r'
158
+ if $FORCE
164
159
  puts "Removing old directory '#{File.expand_path(group_dir_path)}'..."
165
160
  FileUtils.rm_r(group_dir_path)
166
161
  else
167
- puts "Reap package task canceled."
162
+ puts "Package directory '#{pkg.package_name}' already exists. Use -f option to overwrite."
168
163
  return nil
169
164
  end
170
165
  end
166
+
167
+ puts "Creating #{pkg.distribute.join(',')} packages..."
168
+
171
169
  package_files = FileList.new
172
170
  package_files.include(*pkg.include)
173
171
  package_files.exclude(*pkg.exclude) if pkg.exclude and not pkg.exclude.empty?
@@ -252,8 +250,7 @@ private
252
250
 
253
251
  def run_gem
254
252
 
255
- use_subsection :gem
256
- #pkg = sub ? sub : pkg
253
+ use_subsection :gems
257
254
 
258
255
  spec = Gem::Specification.new { |s|
259
256
  s.name = pkg.name
@@ -309,11 +306,11 @@ private
309
306
 
310
307
  def run_deb
311
308
 
312
- use_subsection :deb
309
+ use_subsection :debian
313
310
 
314
311
  # build the debian control file
315
312
 
316
- _dep = pkg.dependencies.collect{ |d, v|
313
+ dep = pkg.dependencies.collect{ |d, v|
317
314
  if v
318
315
  "#{d} (#{v})"
319
316
  else
@@ -327,42 +324,55 @@ private
327
324
  # Pre-Depends: perl, ...
328
325
  # Suggests: docbook
329
326
 
327
+ arch = pkg.architecture.downcase
328
+ arch = (arch == 'any' ? 'all' : arch)
329
+
330
330
  ctrl = %{
331
331
  Package: #{pkg.name}
332
332
  Version: #{pkg.version}
333
333
  Priority: optional
334
- Architecture: #{pkg.architecture}
334
+ Architecture: #{arch}
335
335
  Essential: no
336
336
  }.tabto(0)
337
- ctrl << "Section: #{pkg.category}" if pkg.category
338
- ctrl << "Depends: #{pkg.dep}" unless _dep.empty?
339
- ctrl << "Recommends: #{pkg.recommends.join(' | ')}" unless pkg.recommends.empty?
340
- ctrl << "Conflicts: #{pkg.conflicts.join(', ')}" unless pkg.conflicts.empty?
341
- ctrl << %{
342
- Maintainer: #{pkg.maintainer} [#{pkg.email}]
343
- Provides: #{pkg.name}
344
- Description: #{pkg.summary}
345
- .
346
- #{pkg.description}
347
- }.tabto(0)
348
-
349
- if pkg.architecture == 'any'
350
- debname = "ruby_#{pkg.name}_#{pkg.version}.deb"
337
+ ctrl << "Section: #{pkg.category}\n" if pkg.category
338
+ ctrl << "Depends: #{dep}\n" unless dep.empty?
339
+ ctrl << "Recommends: #{pkg.recommends.join(' | ')}\n" unless pkg.recommends.empty?
340
+ ctrl << "Conflicts: #{pkg.conflicts.join(', ')}\n" unless pkg.conflicts.empty?
341
+ ctrl << "Maintainer: #{pkg.maintainer} <#{pkg.email}>\n"
342
+ ctrl << "Provides: #{pkg.name}\n"
343
+ ctrl << "Description: #{pkg.summary}\n"
344
+ ctrl << " #{pkg.description}\n"
345
+
346
+ if arch == 'all'
347
+ debname = "#{pkg.name}-ruby_#{pkg.version}.deb"
351
348
  else
352
- debname = "ruby_#{pkg.name}_#{pkg.version}_#{pkg.architecture}.deb"
349
+ debname = "#{pkg.name}-ruby_#{pkg.version}_#{pkg.architecture}.deb"
350
+ end
351
+ pkgdir = File.join( pkg.dir, pkg.package_name )
352
+ debdir = File.join( pkgdir, 'debian' )
353
+
354
+ #debdebdir = File.join( debdir, 'DEBIAN' )
355
+ debfile = File.join( pkgdir, debname )
356
+
357
+ unless provide_setup_rb
358
+ puts "Setup.rb is missing. Forced to skip debian package creation."
359
+ return nil
353
360
  end
354
- debdir = File.join( pkg.dir, pkg.package_name, 'debian' )
355
- debdebdir = File.join( debdir, 'DEBIAN' )
356
- debfile = File.join( debdir, debname )
357
361
 
358
362
  puts "Reap is shelling out work to the deb-pkg..."
363
+
364
+ cmd = %{ruby setup.rb }
365
+ cmd << '-q ' unless $VERBOSE
366
+ cmd << %{all --installdirs=std --root=#{debdir}}
367
+
359
368
  FileUtils.mkdir_p(debdir)
360
- sh %{ruby setup.rb all --prefix=#{debdir}}
361
- FileUtils.mkdir_p(debdebdir)
362
- File.open( File.join(debdebdir, 'control'), 'w') { |f| f << ctrl }
363
- #sh %{dpkg-deb -b #{debdir} #{debfile}}
364
- end
369
+ sh cmd
365
370
 
371
+ FileUtils.mkdir_p( File.join(debdir, 'DEBIAN') )
372
+ File.open( File.join(debdir, 'DEBIAN', 'control'), 'w') { |f| f << ctrl }
373
+
374
+ sh %{dpkg-deb -b #{debdir} #{debfile}}
375
+ end
366
376
 
367
377
  # This builds a pacman (archlinux) PKGBUILD script.
368
378
 
@@ -375,19 +385,9 @@ private
375
385
  return nil
376
386
  end
377
387
 
378
- # if section.key?('pac')
379
- # _dep = pkg.pac.dependenciers || pkg.dependencies
380
- # _rep = pkg.pac.replaces || pkg.replaces
381
- # _con = pkg.pac.conflicts || pkg.conflicts
382
- # else
383
- _dep = pkg.dependencies
384
- _rep = pkg.replaces
385
- _con = pkg.conflicts
386
- # end
387
-
388
- _dep = _dep.collect{ |d| "'#{d}'" }.join(' ')
389
- _rep = _rep.collect{ |d| "'#{d}'" }.join(' ')
390
- _con = _rep.collect{ |d| "'#{d}'" }.join(' ')
388
+ _dep = pkg.dependencies.collect{ |d| "'#{d}'" }.join(' ')
389
+ _rep = pkg.replaces.collect{ |d| "'#{d}'" }.join(' ')
390
+ _con = pkg.conflicts.collect{ |d| "'#{d}'" }.join(' ')
391
391
 
392
392
  proto = %{
393
393
  pkgname=#{pkg.name}
@@ -435,7 +435,7 @@ private
435
435
  #sh %{ruby setup.rb all --prefix=#{debdir}}
436
436
  #FileUtils.mkdir_p(pacpacdir)
437
437
  File.open( pacfile, 'w') { |f| f << proto }
438
- #sh %{dpkg-deb -b #{debdir} #{debfile}}
438
+ #sh %{}
439
439
 
440
440
  end
441
441