csd 0.0.16 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/csd.gemspec +1 -7
- data/lib/csd/application/default/base.rb +2 -0
- data/lib/csd/application/minisip/base.rb +20 -19
- data/lib/csd/application/minisip/options/compile.rb +5 -0
- data/lib/csd/commands.rb +5 -5
- data/test/unit/test_dir.rb +1 -1
- data/test/unit/test_pathname.rb +1 -1
- metadata +5 -35
data/Rakefile
CHANGED
@@ -11,8 +11,8 @@ begin
|
|
11
11
|
gemspec.email = "mtoday11@gmail.com"
|
12
12
|
gemspec.homepage = "http://github.com/csd/csd"
|
13
13
|
gemspec.authors = ["Technology Transfer Alliance Team"]
|
14
|
-
gemspec.add_dependency "term-ansicolor", ">= 0"
|
15
|
-
gemspec.add_dependency "activesupport", "3.0.0.beta3" # needs to be active_support in the next release of it, I guess
|
14
|
+
#gemspec.add_dependency "term-ansicolor", ">= 0"
|
15
|
+
#gemspec.add_dependency "activesupport", "3.0.0.beta3" # needs to be active_support in the next release of it, I guess
|
16
16
|
gemspec.executables = ["ai"]
|
17
17
|
gemspec.post_install_message = %q{
|
18
18
|
==================================================================================
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/csd.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{csd}
|
8
|
-
s.version = "0.0
|
8
|
+
s.version = "0.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Technology Transfer Alliance Team"]
|
@@ -305,15 +305,9 @@ Gem::Specification.new do |s|
|
|
305
305
|
s.specification_version = 3
|
306
306
|
|
307
307
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
308
|
-
s.add_runtime_dependency(%q<term-ansicolor>, [">= 0"])
|
309
|
-
s.add_runtime_dependency(%q<activesupport>, ["= 3.0.0.beta3"])
|
310
308
|
else
|
311
|
-
s.add_dependency(%q<term-ansicolor>, [">= 0"])
|
312
|
-
s.add_dependency(%q<activesupport>, ["= 3.0.0.beta3"])
|
313
309
|
end
|
314
310
|
else
|
315
|
-
s.add_dependency(%q<term-ansicolor>, [">= 0"])
|
316
|
-
s.add_dependency(%q<activesupport>, ["= 3.0.0.beta3"])
|
317
311
|
end
|
318
312
|
end
|
319
313
|
|
@@ -8,6 +8,7 @@ module CSD
|
|
8
8
|
def compile!
|
9
9
|
define_root_path
|
10
10
|
define_paths
|
11
|
+
fix_ubuntu_10_04 and return if Options.only_fix_giomm
|
11
12
|
UI.separator
|
12
13
|
UI.info "This operation will download and compile MiniSIP.".green.bold
|
13
14
|
UI.separator
|
@@ -27,17 +28,13 @@ module CSD
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def compile_process
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
unless Options.only_fix_giomm
|
38
|
-
make_minisip
|
39
|
-
after_compile
|
40
|
-
end
|
31
|
+
before_compile
|
32
|
+
Cmd.mkdir Path.work
|
33
|
+
make_hdviper if checkout_hdviper or Options.dry
|
34
|
+
checkout_minisip
|
35
|
+
fix_ubuntu_10_04 if Gem::Platform.local.kernel_version == '#36-Ubuntu SMP Thu Jun 3 22:02:19 UTC 2010'
|
36
|
+
make_minisip
|
37
|
+
after_compile
|
41
38
|
end
|
42
39
|
|
43
40
|
def define_root_path
|
@@ -66,7 +63,7 @@ module CSD
|
|
66
63
|
Path.build_lib_pkg_config = Pathname.new(File.join(Path.build_lib, 'pkgconfig'))
|
67
64
|
Path.build_share = Pathname.new(File.join(Path.build, 'share'))
|
68
65
|
Path.build_share_aclocal = Pathname.new(File.join(Path.build_share, 'aclocal'))
|
69
|
-
Path.giomm_header = Pathname.new(File.join('/', 'usr', '
|
66
|
+
Path.giomm_header = Pathname.new(File.join('/', 'usr', 'include', 'giomm-2.4', 'giomm.h'))
|
70
67
|
end
|
71
68
|
|
72
69
|
def checkout_hdviper
|
@@ -108,13 +105,17 @@ module CSD
|
|
108
105
|
end
|
109
106
|
|
110
107
|
def fix_ubuntu_10_04
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
108
|
+
if File.exist?("#{Path.giomm_header}.ai-backup")
|
109
|
+
UI.warn "giomm-2.4 seems to be fixed already, I won't touch it. Delete `#{"#{Path.giomm_header}.ai-backup"}´ to enforce it."
|
110
|
+
else
|
111
|
+
Path.new_giomm_header = File.join(Dir.mktmpdir, 'giomm.h')
|
112
|
+
Cmd.copy(Path.giomm_header, Path.new_giomm_header)
|
113
|
+
Cmd.replace(Path.new_giomm_header, '#include <giomm/socket.h>', "/* ----- AI COMMENTING OUT START ----- \n#include <giomm/socket.h>")
|
114
|
+
Cmd.replace(Path.new_giomm_header, '#include <giomm/srvtarget.h>', "#include <giomm/srvtarget.h>\n ----- AI COMMENTING OUT END ----- */")
|
115
|
+
Cmd.replace(Path.new_giomm_header, '# include <giomm/unixconnection.h>', "// #include <giomm/unixconnection.h> // COMMENTED OUT BY AI")
|
116
|
+
Cmd.run("sudo cp #{Path.giomm_header} #{Path.giomm_header}.backup")
|
117
|
+
Cmd.run("sudo cp #{Path.new_giomm_header} #{Path.giomm_header}")
|
118
|
+
end
|
118
119
|
end
|
119
120
|
|
120
121
|
def make_minisip
|
@@ -24,6 +24,11 @@ end
|
|
24
24
|
# end
|
25
25
|
#end
|
26
26
|
|
27
|
+
self.only_fix_giomm = false
|
28
|
+
opts.on("--only-fix-giomm","Forces the AI to do nothing except trying to bugfix the Ubuntu 10.04 giomm") do |value|
|
29
|
+
self.only_fix_giomm = value
|
30
|
+
end
|
31
|
+
|
27
32
|
self.apt_get = true
|
28
33
|
opts.on("--no-apt-get","Don't run any apt-get commands") do |value|
|
29
34
|
self.apt_get = value
|
data/lib/csd/commands.rb
CHANGED
@@ -99,7 +99,7 @@ module CSD
|
|
99
99
|
# Copies one or several files to the destination
|
100
100
|
#
|
101
101
|
def copy(src, dest)
|
102
|
-
FileUtils.cp(src, dest)
|
102
|
+
FileUtils.cp(src, dest) unless (Options.dry or Options.reveal)
|
103
103
|
end
|
104
104
|
|
105
105
|
# This returns the current pwd. However, it will return a fake result if we are in reveal-commands-mode.
|
@@ -126,11 +126,11 @@ module CSD
|
|
126
126
|
UI.info "Modifying contents of `#{filepath}´ as follows:".blue
|
127
127
|
UI.info " (Replacing all occurences of `#{pattern}´ with `#{substitution}´)".blue
|
128
128
|
new_file_content = File.read(filepath).gsub(pattern, substitution)
|
129
|
-
File.open(filepath, 'w+') { |file| file << new_file_content }
|
129
|
+
File.open(filepath, 'w+') { |file| file << new_file_content } unless (Options.dry or Options.reveal)
|
130
130
|
rescue Errno::ENOENT => e
|
131
131
|
result.success = false
|
132
132
|
end
|
133
|
-
result.success = true
|
133
|
+
result.success = true if Options.reveal
|
134
134
|
result
|
135
135
|
end
|
136
136
|
|
@@ -153,7 +153,7 @@ module CSD
|
|
153
153
|
UI.info "Running command in #{pwd}".yellow
|
154
154
|
UI.info cmd.cyan
|
155
155
|
end
|
156
|
-
return '' if Options.reveal
|
156
|
+
return '' if Options.reveal or Options.dry
|
157
157
|
ret = ''
|
158
158
|
IO.popen(cmd) do |stdout|
|
159
159
|
stdout.each do |line|
|
@@ -180,7 +180,7 @@ module CSD
|
|
180
180
|
# Wrapping the CommandsInstance class
|
181
181
|
#
|
182
182
|
class Cmd
|
183
|
-
COMMANDS = %w{ mkdir cd run replace }
|
183
|
+
COMMANDS = %w{ mkdir cd run replace copy }
|
184
184
|
|
185
185
|
def self.instance
|
186
186
|
@@instance ||= CommandsInstance.new
|
data/test/unit/test_dir.rb
CHANGED
@@ -22,7 +22,7 @@ class TestDir < Test::Unit::TestCase
|
|
22
22
|
|
23
23
|
should "return all subdirectory names as an array" do
|
24
24
|
result = Dir.directories(@tmp).map { |dirname| dirname }
|
25
|
-
assert_equal @subdirs.sort, result
|
25
|
+
assert_equal @subdirs.sort, result.sort
|
26
26
|
end
|
27
27
|
|
28
28
|
should "yield all subdirectories in a block" do
|
data/test/unit/test_pathname.rb
CHANGED
@@ -35,7 +35,7 @@ class TestPathname < Test::Unit::TestCase
|
|
35
35
|
|
36
36
|
should "return all subdirectory names as an array" do
|
37
37
|
result = Pathname.new(@tmp).children_directories.map { |pathname| pathname }
|
38
|
-
assert_equal @subdirs.sort, result
|
38
|
+
assert_equal @subdirs.sort, result.sort
|
39
39
|
end
|
40
40
|
|
41
41
|
should "yield all subdirectories in a block" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.16
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Technology Transfer Alliance Team
|
@@ -17,38 +17,8 @@ cert_chain: []
|
|
17
17
|
|
18
18
|
date: 2010-07-13 00:00:00 +02:00
|
19
19
|
default_executable: ai
|
20
|
-
dependencies:
|
21
|
-
|
22
|
-
name: term-ansicolor
|
23
|
-
prerelease: false
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
33
|
-
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: activesupport
|
37
|
-
prerelease: false
|
38
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - "="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: -1848230021
|
44
|
-
segments:
|
45
|
-
- 3
|
46
|
-
- 0
|
47
|
-
- 0
|
48
|
-
- beta3
|
49
|
-
version: 3.0.0.beta3
|
50
|
-
type: :runtime
|
51
|
-
version_requirements: *id002
|
20
|
+
dependencies: []
|
21
|
+
|
52
22
|
description: CSD stands for Communication Systems Design and is a project of the Telecommunication Systems Laboratory (TSLab) of the Royal Institute of Technology in Stockholm, Sweden. Within CSD many software tools are used to build up various networks and services. This gem is supposed to automate processes to handle the compilation and installation of these software tools. Technology Transfer Alliance (TTA) is the project team, which maintains this code.
|
53
23
|
email: mtoday11@gmail.com
|
54
24
|
executables:
|