reap 4.3.2 → 4.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ANN +6 -1
- data/ProjectInfo +9 -7
- data/README +44 -13
- data/data/reap/setup-3.4.1/COPYING +515 -0
- data/data/reap/setup-3.4.1/ChangeLog +732 -0
- data/data/reap/setup-3.4.1/Makefile +56 -0
- data/data/reap/setup-3.4.1/NEWS.en +155 -0
- data/data/reap/setup-3.4.1/NEWS.ja +152 -0
- data/data/reap/setup-3.4.1/README.en +30 -0
- data/data/reap/setup-3.4.1/README.ja +34 -0
- data/data/reap/setup-3.4.1/TODO +14 -0
- data/data/reap/setup-3.4.1/Template.README.en +41 -0
- data/data/reap/setup-3.4.1/Template.README.ja +46 -0
- data/data/reap/setup-3.4.1/Usage_en.txt +231 -0
- data/data/reap/setup-3.4.1/Usage_ja.txt +250 -0
- data/data/reap/setup-3.4.1/doc.en/hookapi.html +91 -0
- data/data/reap/setup-3.4.1/doc.en/index.html +28 -0
- data/data/reap/setup-3.4.1/doc.en/metaconfapi.html +79 -0
- data/data/reap/setup-3.4.1/doc.en/news.html +189 -0
- data/data/reap/setup-3.4.1/doc.en/usage.html +297 -0
- data/data/reap/setup-3.4.1/doc.ja/hookapi.html +84 -0
- data/data/reap/setup-3.4.1/doc.ja/index.html +28 -0
- data/data/reap/setup-3.4.1/doc.ja/metaconfapi.html +80 -0
- data/data/reap/setup-3.4.1/doc.ja/news.html +186 -0
- data/data/reap/setup-3.4.1/doc.ja/usage.html +319 -0
- data/data/reap/setup-3.4.1/sample/add-task.rb +15 -0
- data/data/reap/setup-3.4.1/setup.rb +1585 -0
- data/data/reap/setup-3.4.1/test/test_installer.rb +136 -0
- data/lib/reap/{lint.rb → bin/lint.rb} +0 -0
- data/lib/reap/bin/reap.rb +3 -2
- data/lib/reap/projectinfo.rb +4 -0
- data/lib/reap/task.rb +84 -74
- data/lib/reap/task/announce.rb +137 -91
- data/lib/reap/task/fileperm.rb +26 -9
- data/lib/reap/task/info.rb +19 -3
- data/lib/reap/task/install.rb +9 -7
- data/lib/reap/task/noop.rb +3 -5
- data/lib/reap/task/package.rb +247 -105
- data/lib/reap/task/publish.rb +40 -14
- data/lib/reap/task/rdoc.rb +53 -27
- data/lib/reap/task/release.rb +275 -73
- data/lib/reap/task/scaffold.rb +14 -6
- data/lib/reap/task/test.rb +67 -48
- data/lib/reap/task/testext.rb +38 -11
- data/lib/reap/vendor/http-access2.rb +1590 -0
- data/lib/reap/vendor/http-access2/cookie.rb +538 -0
- data/lib/reap/vendor/http-access2/http.rb +542 -0
- data/{lib/reap → note}/interface/interface.rb +0 -0
- data/{lib/reap → note}/interface/rubyforge.rb +0 -0
- data/note/package.rb.0 +394 -0
- metadata +43 -8
- data/lib/reap/reap.rb +0 -0
data/lib/reap/task/fileperm.rb
CHANGED
@@ -1,21 +1,39 @@
|
|
1
1
|
|
2
2
|
require 'reap/task'
|
3
3
|
|
4
|
+
# ___ _ _ _____ _
|
5
|
+
# | _ \___ _ _ _ __ (_)_____(_)___ _ _ ___ |_ _|_ _ __| |__
|
6
|
+
# | _/ -_) '_| ' \| (_-<_-< / _ \ ' \(_-< | |/ _` (_-< / /
|
7
|
+
# |_| \___|_| |_|_|_|_/__/__/_\___/_||_/__/ |_|\__,_/__/_\_\
|
4
8
|
#
|
5
|
-
|
6
|
-
#
|
9
|
+
|
10
|
+
# = File Permissions Task
|
11
|
+
|
7
12
|
class Reap::Perm < Reap::Task
|
8
13
|
|
9
|
-
task_desc "Normalize ownership and permissions of package files."
|
10
14
|
section_required true
|
11
15
|
|
12
|
-
|
16
|
+
task_desc "Normalize ownership and permissions of package files."
|
17
|
+
|
18
|
+
task_help %{
|
19
|
+
|
20
|
+
reap perm
|
21
|
+
|
22
|
+
Normalizes file permissions.
|
23
|
+
|
24
|
+
user user name to use
|
25
|
+
group group name to use
|
26
|
+
|
27
|
+
}
|
28
|
+
|
29
|
+
#attr_accessor :user, :group, :filemod, :dirmod
|
30
|
+
|
31
|
+
task_attr :perm
|
13
32
|
|
14
33
|
def init
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
@dirmod ||= 755
|
34
|
+
perm.group ||= perm.user
|
35
|
+
perm.filemod ||= 644
|
36
|
+
perm.dirmod ||= 755
|
19
37
|
end
|
20
38
|
|
21
39
|
def run
|
@@ -76,4 +94,3 @@ class Reap::Perm < Reap::Task
|
|
76
94
|
|
77
95
|
end
|
78
96
|
|
79
|
-
#Reap.register( Reap::Perm )
|
data/lib/reap/task/info.rb
CHANGED
@@ -1,17 +1,33 @@
|
|
1
1
|
|
2
2
|
require 'reap/task'
|
3
3
|
|
4
|
+
# ___ __ _____ _
|
5
|
+
# |_ _|_ _ / _|___ |_ _|_ _ __| |__
|
6
|
+
# | || ' \| _/ _ \ | |/ _` (_-< / /
|
7
|
+
# |___|_||_|_| \___/ |_|\__,_/__/_\_\
|
4
8
|
#
|
5
|
-
|
9
|
+
|
10
|
+
# = Info Task
|
6
11
|
#
|
12
|
+
# Displays the ProjectInfo file.
|
13
|
+
|
7
14
|
class Reap::Info < Reap::Task
|
8
15
|
|
9
16
|
task_desc "Display ProjectInfo file."
|
10
17
|
|
11
|
-
|
18
|
+
task_help %{
|
19
|
+
|
20
|
+
reap info
|
21
|
+
|
22
|
+
Display ProjectInfo file.
|
23
|
+
|
24
|
+
}
|
25
|
+
|
26
|
+
def init( na )
|
27
|
+
# no initialization
|
12
28
|
end
|
13
29
|
|
14
|
-
def run
|
30
|
+
def run( na )
|
15
31
|
puts $PROJECT_INFO.info_stream
|
16
32
|
end
|
17
33
|
|
data/lib/reap/task/install.rb
CHANGED
@@ -3,17 +3,19 @@
|
|
3
3
|
require 'reap/task'
|
4
4
|
require 'reap/setup'
|
5
5
|
|
6
|
+
# ___ _ _ _ _____ _
|
7
|
+
# |_ _|_ __ ___| |_ __ _| | | |_ _|_ _ ___| | __
|
8
|
+
# | || '_ \/ __| __/ _` | | | | |/ _` / __| |/ /
|
9
|
+
# | || | | \__ \ || (_| | | | | | (_| \__ \ <
|
10
|
+
# |___|_| |_|___/\__\__,_|_|_| |_|\__,_|___/_|\_\
|
6
11
|
#
|
7
|
-
# Install Task
|
8
|
-
#
|
9
|
-
class Reap::Install < Reap::Task
|
10
12
|
|
11
|
-
|
13
|
+
class Reap::Install < Reap::Task
|
12
14
|
|
13
|
-
|
15
|
+
task_desc "Locally install package using built-in setup.rb."
|
14
16
|
|
15
17
|
def init
|
16
|
-
|
18
|
+
task.options ||= []
|
17
19
|
#@sudo ||= true
|
18
20
|
end
|
19
21
|
|
@@ -27,7 +29,7 @@ class Reap::Install < Reap::Task
|
|
27
29
|
|
28
30
|
ARGV.delete('install')
|
29
31
|
ARGV << '-q' unless $VERBOSE
|
30
|
-
ARGV.concat(options)
|
32
|
+
ARGV.concat(task.options)
|
31
33
|
|
32
34
|
$setup_pwd = $PROJECT_INFO.info_dir #Dir.pwd
|
33
35
|
|
data/lib/reap/task/noop.rb
CHANGED
@@ -15,13 +15,11 @@ class Reap::Noop < Reap::Task
|
|
15
15
|
|
16
16
|
task_desc "A no-op task to help debug reap itself."
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
def init
|
18
|
+
def init( msg )
|
21
19
|
end
|
22
20
|
|
23
|
-
def run
|
24
|
-
puts ( message || 'No message field in noop section.' )
|
21
|
+
def run( msg )
|
22
|
+
puts ( msg.message || 'No message field in noop section.' )
|
25
23
|
end
|
26
24
|
|
27
25
|
end
|
data/lib/reap/task/package.rb
CHANGED
@@ -7,112 +7,154 @@ rescue LoadError
|
|
7
7
|
# no rubygems
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
#
|
10
|
+
# ___ _ _____ _
|
11
|
+
# | _ \__ _ __| |____ _ __ _ ___ |_ _|_ _ __| |__
|
12
|
+
# | _/ _` / _| / / _` / _` / -_) | |/ _` (_-< / /
|
13
|
+
# |_| \__,_\__|_\_\__,_\__, \___| |_|\__,_/__/_\_\
|
14
|
+
# |___/
|
15
|
+
|
16
|
+
# = Package Task
|
12
17
|
#
|
13
18
|
# This task creates standard .zip, .tgz, or .tbz
|
14
19
|
# packages, plus .gem distributions.
|
15
|
-
|
20
|
+
|
21
|
+
|
16
22
|
class Reap::Package < Reap::Task
|
17
23
|
|
24
|
+
MUST_EXCLUDE = [ 'InstalledFiles', '**/CVS/**/*', '**/*~', 'dist', 'pkg' ]
|
25
|
+
LOCATIONS = [ '../leaf', '../dist', '../pkg', 'dist', 'pkg' ]
|
26
|
+
|
27
|
+
# Task line description
|
28
|
+
|
18
29
|
task_desc do
|
19
30
|
disttypes = $PROJECT_INFO['distribute'] || [ 'gem', 'tar.bz2', 'zip' ]
|
20
31
|
"Build distribution packages (#{disttypes.join(', ')})."
|
21
32
|
end
|
22
33
|
|
23
|
-
|
24
|
-
|
34
|
+
# Help information
|
35
|
+
|
36
|
+
task_help %{
|
37
|
+
|
38
|
+
reap package
|
39
|
+
|
40
|
+
Builds distribution packages. The package task supports
|
41
|
+
tar.gz, tar.bz2, zip source packages and gem, pacman and
|
42
|
+
debian ditribution packages.
|
43
|
+
|
44
|
+
dir Directory in which to store distributions.
|
45
|
+
include Files to include in distribution.
|
46
|
+
exclude Files to exclude from those.
|
47
|
+
distribute Distribution types.
|
48
|
+
tgz, tar.gz, tbz, tar.bz2, zip
|
49
|
+
gem, deb, pac
|
50
|
+
project Project name.
|
51
|
+
category Software category.
|
52
|
+
architecture Can be any, i368, i686, ppc, etc.
|
53
|
+
dependencies List of packages this program depends.
|
54
|
+
recommends List of packages that can be used with this package.
|
55
|
+
replaces List of packages this one replaces.
|
56
|
+
executables Executable files in this distribution.
|
57
|
+
source URL of source package (typically a tar.gz file).
|
58
|
+
md5 MD% checksum of source file.
|
25
59
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
:category, :recommends
|
60
|
+
These are RubyGems specific.
|
61
|
+
autorequire
|
62
|
+
platform
|
63
|
+
require_paths
|
31
64
|
|
32
|
-
|
33
|
-
|
65
|
+
The package task also has subsection for each type of distribution.
|
66
|
+
These can be used to override settings in the package information
|
67
|
+
if it in some way differs. Possible subsections are:
|
34
68
|
|
35
|
-
|
69
|
+
gems
|
70
|
+
pacman
|
71
|
+
debian
|
36
72
|
|
73
|
+
}
|
37
74
|
|
38
|
-
|
39
|
-
@dir ||= LOCATIONS.find { |f| File.directory?(f) } || 'dist'
|
75
|
+
# Alternate for task properties accessor.
|
40
76
|
|
41
|
-
|
42
|
-
#@status ||= master['status'] || 'beta/stable'
|
43
|
-
#@date ||= master['date'] || Time.now.strftime("%Y-%m-%d")
|
44
|
-
#@series ||= master['series'] || '1'
|
77
|
+
task_attr :pkg
|
45
78
|
|
46
|
-
|
47
|
-
@status ||= 'beta/stable'
|
48
|
-
@date ||= Time.now.strftime("%Y-%m-%d")
|
49
|
-
@series ||= '1'
|
50
|
-
@architecture ||= 'any'
|
79
|
+
# Setup package task.
|
51
80
|
|
52
|
-
|
81
|
+
def init
|
82
|
+
|
83
|
+
# Do not look in master information for this
|
84
|
+
|
85
|
+
pkg.dir = section.dir || LOCATIONS.find { |f| File.directory?(f) } || 'dist'
|
86
|
+
|
87
|
+
# Set defaults
|
88
|
+
|
89
|
+
pkg.status ||= 'beta/stable'
|
90
|
+
pkg.date ||= Time.now.strftime("%Y-%m-%d")
|
91
|
+
pkg.series ||= '1'
|
92
|
+
pkg.author ||= "Anonymous"
|
93
|
+
pkg.maintainer ||= pkg.author
|
94
|
+
pkg.email ||= ""
|
95
|
+
pkg.summary ||= ""
|
96
|
+
pkg.architecture ||= 'any'
|
97
|
+
pkg.license ||= 'Ruby/GPL'
|
98
|
+
pkg.project ||= master.rubyforge.project
|
99
|
+
pkg.homepage ||= master.rubyforge.homepage
|
100
|
+
|
101
|
+
d = pkg.date.split('-').collect{ |e| e.to_i }
|
53
102
|
#d[0] = d[0] - 2000 # No need to keep the 2000
|
54
|
-
|
103
|
+
pkg.version ||= d.join('.')
|
55
104
|
|
56
105
|
if $BUILD_VERSION
|
57
|
-
buildno =
|
58
|
-
|
106
|
+
pkg.buildno = Time.now.strftime("%H*60+%M")
|
107
|
+
pkg.version += ".#{pkg.buildno}"
|
59
108
|
end
|
60
109
|
|
61
|
-
|
62
|
-
puts "Series is required."
|
63
|
-
exit 0
|
64
|
-
end
|
110
|
+
pkg.package_name ||= "#{pkg.name}-#{pkg.version}"
|
65
111
|
|
66
|
-
|
67
|
-
|
112
|
+
pkg.exclude ||= []
|
113
|
+
pkg.exclude |= MUST_EXCLUDE
|
68
114
|
|
69
|
-
|
70
|
-
#@email ||= master['email']
|
71
|
-
#@summary ||= master['summary']
|
72
|
-
@project ||= master['rubyforge']['project']
|
73
|
-
#@homepage ||= master['homepage'] || master['rubyforge']['homepage']
|
74
|
-
@homepage ||= master['rubyforge']['homepage']
|
115
|
+
pkg.include ||= ['**/*']
|
75
116
|
|
76
|
-
|
77
|
-
@exclude |= MUST_EXCLUDE
|
117
|
+
# distribute types include 'tgz', 'tbz', 'zip', 'tar.gz' 'tar.bz2', 'gem', 'pac' and 'deb'.
|
78
118
|
|
79
|
-
|
119
|
+
pkg.distribute ||= [ 'gem', 'tar.bz2', 'zip' ]
|
120
|
+
pkg.distribute = [pkg.distribute].flatten.collect { |t| t.to_s.strip.downcase }
|
80
121
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
122
|
+
pkg.dependencies ||= []
|
123
|
+
pkg.executables ||= []
|
124
|
+
pkg.requirements ||= []
|
125
|
+
pkg.recommends ||= []
|
126
|
+
pkg.conflicts ||= []
|
127
|
+
pkg.replaces ||= []
|
85
128
|
|
86
|
-
|
87
|
-
@executables ||= []
|
88
|
-
@requirements ||= []
|
89
|
-
@recommends ||= []
|
129
|
+
# Gem specific properties
|
90
130
|
|
91
|
-
|
92
|
-
|
93
|
-
if @platform
|
131
|
+
if defined?(::Gem) and pkg.gem
|
132
|
+
if pkg.gem.platform
|
94
133
|
begin
|
95
|
-
|
134
|
+
pkg.gem.platform = ::Gem::Platform.const_get(pkg.gem.platform.upcase)
|
96
135
|
rescue NameError
|
97
|
-
|
136
|
+
pkg.gem.platform = ::Gem::Platform::RUBY
|
98
137
|
end
|
99
138
|
else
|
100
|
-
|
139
|
+
pkg.gem.platform = ::Gem::Platform::RUBY
|
101
140
|
end
|
102
141
|
#@autorequire
|
103
142
|
end
|
104
143
|
|
105
144
|
end
|
106
145
|
|
107
|
-
|
108
|
-
|
146
|
+
# Run package task.
|
147
|
+
|
148
|
+
def run
|
149
|
+
|
150
|
+
puts "Creating #{pkg.distribute.join(',')} packages..."
|
109
151
|
|
110
152
|
# create package image
|
111
|
-
group_dir_path = File.join(
|
112
|
-
package_dir_path = File.join(
|
153
|
+
group_dir_path = File.join( pkg.dir, pkg.package_name )
|
154
|
+
package_dir_path = File.join( pkg.dir, pkg.package_name, pkg.package_name )
|
113
155
|
|
114
156
|
if FileTest.directory?(group_dir_path)
|
115
|
-
print "Package directory '#{package_name}' already exists.
|
157
|
+
print "Package directory '#{pkg.package_name}' already exists. Continue or [R]emove and continue? [y/r/N] "
|
116
158
|
until inp = $stdin.gets[0,1] ; sleep 1 ; end
|
117
159
|
inp = inp.to_s.downcase
|
118
160
|
case inp
|
@@ -127,9 +169,9 @@ class Reap::Package < Reap::Task
|
|
127
169
|
end
|
128
170
|
end
|
129
171
|
package_files = FileList.new
|
130
|
-
package_files.include(
|
131
|
-
package_files.exclude(
|
132
|
-
FileUtils.mkdir_p
|
172
|
+
package_files.include(*pkg.include)
|
173
|
+
package_files.exclude(*pkg.exclude) if pkg.exclude and not pkg.exclude.empty?
|
174
|
+
FileUtils.mkdir_p pkg.dir #rescue nil
|
133
175
|
package_files.each do |f|
|
134
176
|
pkgf = File.join(package_dir_path, f)
|
135
177
|
fdir = File.dirname(pkgf)
|
@@ -143,8 +185,8 @@ class Reap::Package < Reap::Task
|
|
143
185
|
end
|
144
186
|
|
145
187
|
# create standard package files
|
146
|
-
FileUtils.chdir( File.join(
|
147
|
-
|
188
|
+
FileUtils.chdir( File.join( pkg.dir, pkg.package_name ) ) do
|
189
|
+
pkg.distribute.each do |t|
|
148
190
|
sh_cmd = nil
|
149
191
|
prefix = 'ERROR' # in case of unforseen bug
|
150
192
|
case t
|
@@ -160,20 +202,21 @@ class Reap::Package < Reap::Task
|
|
160
202
|
prefix = 'zip'
|
161
203
|
sh_cmd = 'zip -r'
|
162
204
|
puts "\nReap is shelling out work to zip..."
|
163
|
-
when 'gem', 'deb'
|
205
|
+
when 'gem', 'deb', 'pac'
|
164
206
|
sh_cmd = nil
|
165
207
|
else
|
166
208
|
puts "Unknown package type '#{t}' skipped."
|
167
209
|
sh_cmd = nil
|
168
210
|
end
|
169
|
-
sh %{#{sh_cmd} #{
|
211
|
+
sh %{#{sh_cmd} #{pkg.package_name}.#{prefix} #{pkg.package_name}} if sh_cmd
|
170
212
|
end
|
171
213
|
puts
|
172
214
|
end
|
173
215
|
|
174
216
|
# create gem package
|
175
|
-
|
176
|
-
|
217
|
+
|
218
|
+
if pkg.distribute.include?('gem')
|
219
|
+
if defined?(::Gem)
|
177
220
|
run_gem
|
178
221
|
else
|
179
222
|
puts "Package .gem requested, but rubygems not found (skipped)."
|
@@ -181,7 +224,8 @@ class Reap::Package < Reap::Task
|
|
181
224
|
end
|
182
225
|
|
183
226
|
# create debian package
|
184
|
-
|
227
|
+
|
228
|
+
if pkg.distribute.include?('deb')
|
185
229
|
if true # TODO ensure required debian tools here
|
186
230
|
run_deb
|
187
231
|
else
|
@@ -189,21 +233,33 @@ class Reap::Package < Reap::Task
|
|
189
233
|
end
|
190
234
|
end
|
191
235
|
|
236
|
+
# create PKGBUILD (pacman, archlinux)
|
237
|
+
|
238
|
+
if pkg.distribute.include?('pac')
|
239
|
+
if true # TODO ensure required tools here
|
240
|
+
run_pacman
|
241
|
+
else
|
242
|
+
puts "Pacman package requested, but required tools not found (skipped)."
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
192
246
|
return true
|
193
247
|
end
|
194
248
|
|
195
|
-
|
196
|
-
|
197
|
-
private
|
249
|
+
private
|
198
250
|
|
199
251
|
# This builds the gem package.
|
200
252
|
|
201
253
|
def run_gem
|
254
|
+
|
255
|
+
use_subsection :gem
|
256
|
+
#pkg = sub ? sub : pkg
|
257
|
+
|
202
258
|
spec = Gem::Specification.new { |s|
|
203
|
-
s.name =
|
204
|
-
s.version =
|
259
|
+
s.name = pkg.name
|
260
|
+
s.version = pkg.version
|
205
261
|
|
206
|
-
|
262
|
+
pkg.dependencies.each { |d,v|
|
207
263
|
if v
|
208
264
|
s.add_dependency(d, v)
|
209
265
|
else
|
@@ -211,26 +267,30 @@ class Reap::Package < Reap::Task
|
|
211
267
|
end
|
212
268
|
}
|
213
269
|
|
214
|
-
s.
|
215
|
-
s.
|
216
|
-
s.requirements = @requirements
|
270
|
+
s.summary = pkg.summary
|
271
|
+
s.requirements = pkg.requirements
|
217
272
|
|
218
273
|
# s.files = Dir.glob("lib/**/*").delete_if {|item| item.include?("CVS")}
|
219
274
|
# s.files.concat Dir.glob("bin/**/*").delete_if {|item| item.include?("CVS")}
|
220
275
|
package_files = FileList.new
|
221
|
-
package_files.include(
|
222
|
-
package_files.exclude(
|
276
|
+
package_files.include(*pkg.include)
|
277
|
+
package_files.exclude(*pkg.exclude) if pkg.exclude and not pkg.exclude.empty?
|
223
278
|
s.files = package_files.to_a
|
224
279
|
|
280
|
+
s.author = pkg.author
|
281
|
+
s.email = pkg.email
|
282
|
+
s.rubyforge_project = pkg.project
|
283
|
+
s.homepage = pkg.homepage
|
284
|
+
|
225
285
|
s.require_path = 'lib'
|
226
|
-
s.
|
227
|
-
|
228
|
-
s.
|
229
|
-
s.
|
230
|
-
|
231
|
-
s.executables =
|
232
|
-
s.require_paths = @require_paths if @require_paths
|
286
|
+
s.require_paths = pkg.require_paths if pkg.require_paths
|
287
|
+
|
288
|
+
s.autorequire = pkg.autorequire if pkg.autorequire
|
289
|
+
s.platform = pkg.platform
|
290
|
+
|
291
|
+
s.executables = pkg.executables
|
233
292
|
s.bindir = "bin"
|
293
|
+
|
234
294
|
s.has_rdoc = true
|
235
295
|
}
|
236
296
|
|
@@ -239,7 +299,7 @@ class Reap::Package < Reap::Task
|
|
239
299
|
Gem::Builder.new(spec).build
|
240
300
|
gems = Dir.glob( './*.gem' )
|
241
301
|
gems.each{ |f|
|
242
|
-
FileUtils.mv( f, File.join(
|
302
|
+
FileUtils.mv( f, File.join( pkg.dir, pkg.package_name ) )
|
243
303
|
}
|
244
304
|
#sh %{mv ./*.gem #{@dir}/}
|
245
305
|
end
|
@@ -249,9 +309,11 @@ class Reap::Package < Reap::Task
|
|
249
309
|
|
250
310
|
def run_deb
|
251
311
|
|
312
|
+
use_subsection :deb
|
313
|
+
|
252
314
|
# build the debian control file
|
253
315
|
|
254
|
-
|
316
|
+
_dep = pkg.dependencies.collect{ |d, v|
|
255
317
|
if v
|
256
318
|
"#{d} (#{v})"
|
257
319
|
else
|
@@ -261,31 +323,35 @@ class Reap::Package < Reap::Task
|
|
261
323
|
|
262
324
|
# Some debian fields not yet used:
|
263
325
|
# Installed-Size: 1024
|
264
|
-
# Conflicts: wile-e-coyote, ...
|
265
326
|
# Replaces: sam-sheepdog
|
266
327
|
# Pre-Depends: perl, ...
|
267
328
|
# Suggests: docbook
|
268
329
|
|
269
330
|
ctrl = %{
|
270
|
-
Package: #{name}
|
271
|
-
Version: #{version}
|
331
|
+
Package: #{pkg.name}
|
332
|
+
Version: #{pkg.version}
|
272
333
|
Priority: optional
|
273
|
-
Architecture: #{architecture}
|
334
|
+
Architecture: #{pkg.architecture}
|
274
335
|
Essential: no
|
275
336
|
}.tabto(0)
|
276
|
-
ctrl << "Section: #{category}" if category
|
277
|
-
ctrl << "Depends: #{dep}" unless
|
278
|
-
ctrl << "Recommends: #{recommends.join(' | ')}" unless recommends.empty?
|
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?
|
279
341
|
ctrl << %{
|
280
|
-
Maintainer: #{maintainer} [#{email}]
|
281
|
-
Provides: #{name}
|
282
|
-
Description: #{summary}
|
342
|
+
Maintainer: #{pkg.maintainer} [#{pkg.email}]
|
343
|
+
Provides: #{pkg.name}
|
344
|
+
Description: #{pkg.summary}
|
283
345
|
.
|
284
|
-
#{description}
|
346
|
+
#{pkg.description}
|
285
347
|
}.tabto(0)
|
286
348
|
|
287
|
-
|
288
|
-
|
349
|
+
if pkg.architecture == 'any'
|
350
|
+
debname = "ruby_#{pkg.name}_#{pkg.version}.deb"
|
351
|
+
else
|
352
|
+
debname = "ruby_#{pkg.name}_#{pkg.version}_#{pkg.architecture}.deb"
|
353
|
+
end
|
354
|
+
debdir = File.join( pkg.dir, pkg.package_name, 'debian' )
|
289
355
|
debdebdir = File.join( debdir, 'DEBIAN' )
|
290
356
|
debfile = File.join( debdir, debname )
|
291
357
|
|
@@ -297,4 +363,80 @@ class Reap::Package < Reap::Task
|
|
297
363
|
#sh %{dpkg-deb -b #{debdir} #{debfile}}
|
298
364
|
end
|
299
365
|
|
366
|
+
|
367
|
+
# This builds a pacman (archlinux) PKGBUILD script.
|
368
|
+
|
369
|
+
def run_pacman
|
370
|
+
|
371
|
+
use_subsection :pacman
|
372
|
+
|
373
|
+
unless @source
|
374
|
+
puts "URL 'source' is require for proto package."
|
375
|
+
return nil
|
376
|
+
end
|
377
|
+
|
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(' ')
|
391
|
+
|
392
|
+
proto = %{
|
393
|
+
pkgname=#{pkg.name}
|
394
|
+
pkgver=#{pkg.version}
|
395
|
+
pkgrel=#{pkg.series}
|
396
|
+
pkgdesc="#{pkg.summary}"
|
397
|
+
url="#{pkg.homepage}"
|
398
|
+
license="#{pkg.license}"
|
399
|
+
depends=(#{_dep})
|
400
|
+
conflicts=(#{_con})
|
401
|
+
replaces=(#{_rep})
|
402
|
+
source=(#{pkg.source})
|
403
|
+
md5sums=(#{pkg.md5})
|
404
|
+
}.tabto(0)
|
405
|
+
|
406
|
+
# What are these for?
|
407
|
+
# install=
|
408
|
+
# backup=()
|
409
|
+
|
410
|
+
if pkg.usemake
|
411
|
+
s << %{
|
412
|
+
makedepends=()"
|
413
|
+
build() {
|
414
|
+
cd $startdir/src/$pkgname-$pkgver
|
415
|
+
./ruby setup.rb --prefix=/usr
|
416
|
+
make || return 1
|
417
|
+
make DESTDIR=$startdir/pkg install
|
418
|
+
}
|
419
|
+
}.tabto(0)
|
420
|
+
else
|
421
|
+
s << %{
|
422
|
+
build() {
|
423
|
+
cd $startdir/src/$pkgname-$pkgver
|
424
|
+
./ruby setup.rb --prefix=/usr
|
425
|
+
}
|
426
|
+
}
|
427
|
+
end
|
428
|
+
|
429
|
+
pacdir = File.join( pkg.dir, pkg.package_name, 'pacman' )
|
430
|
+
pacpacdir = File.join( pacdir, 'PACMAN' )
|
431
|
+
pacfile = File.join( pacdir, 'PKGBUILD' )
|
432
|
+
|
433
|
+
puts "Reap is shelling out work to the pacman..."
|
434
|
+
FileUtils.mkdir_p(pacdir)
|
435
|
+
#sh %{ruby setup.rb all --prefix=#{debdir}}
|
436
|
+
#FileUtils.mkdir_p(pacpacdir)
|
437
|
+
File.open( pacfile, 'w') { |f| f << proto }
|
438
|
+
#sh %{dpkg-deb -b #{debdir} #{debfile}}
|
439
|
+
|
440
|
+
end
|
441
|
+
|
300
442
|
end
|