csd 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +10 -9
- data/VERSION +1 -1
- data/bin/ai +9 -11
- data/bin/tta +26 -0
- data/csd.gemspec +13 -11
- data/lib/csd.rb +7 -5
- data/lib/csd/application/default.rb +1 -0
- data/lib/csd/application/minisip/base.rb +71 -17
- data/lib/csd/application/minisip/options/compile.rb +10 -0
- data/lib/csd/application/minisip/unix.rb +69 -14
- data/lib/csd/application/minisip/unix/linux/debian.rb +4 -8
- data/lib/csd/application/minisip/unix/linux/debian/ubuntu10.rb +1 -1
- data/lib/csd/commands.rb +47 -43
- data/lib/csd/extensions/gem/platform.rb +2 -2
- data/lib/csd/options_parser.rb +4 -4
- data/lib/csd/user_interface/cli.rb +5 -0
- data/lib/csd/vendor/active_support/inflector.rb +2 -0
- data/lib/csd/vendor/term/ansicolor.rb +2 -0
- data/lib/csd/vendor/zentest/zentest_assertions.rb +62 -0
- data/test/functional/test_commands.rb +22 -8
- data/test/helper.rb +1 -0
- metadata +10 -7
data/Rakefile
CHANGED
@@ -11,20 +11,21 @@ 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.executables = [
|
14
|
+
gemspec.executables = ['tta', 'ai']
|
15
15
|
gemspec.post_install_message = %q{
|
16
|
-
|
16
|
+
============================================================
|
17
17
|
|
18
|
-
|
18
|
+
Thank you for installing the TTA Automated Installer!
|
19
19
|
|
20
|
-
|
20
|
+
You can run it by typing `tta´ in your command line.
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
NOTE: On DEBIAN and UBUNTU the executable `tta´ is *maybe*
|
23
|
+
not in your PATH by default. If that is the case,
|
24
|
+
you can fix it by running this command:
|
24
25
|
|
25
|
-
|
26
|
+
echo "export PATH=\$PATH:$(gem env | grep "E D" | sed "s/[^\w]* //")" >> ~/.bashrc;. ~/.bashrc
|
26
27
|
|
27
|
-
|
28
|
+
============================================================
|
28
29
|
}
|
29
30
|
end
|
30
31
|
rescue LoadError
|
@@ -52,7 +53,7 @@ begin
|
|
52
53
|
end
|
53
54
|
rescue LoadError
|
54
55
|
task :rcov do
|
55
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install
|
56
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install rcov"
|
56
57
|
end
|
57
58
|
end
|
58
59
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/bin/ai
CHANGED
@@ -1,25 +1,23 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# NOTE: If you would like to execute this file as a developer
|
4
|
-
# but not install the CSD gem, you can use this command:
|
5
|
-
# ruby -I path/to/csd/lib path/to/csd/bin/ai
|
6
3
|
|
7
|
-
|
8
|
-
#
|
9
|
-
#
|
4
|
+
|
5
|
+
# This executable is DEPRECATED
|
6
|
+
# Please use 'tta' instead.
|
7
|
+
|
8
|
+
puts
|
9
|
+
puts "`ai´ is DEPRECATED. Please use `tta´ instead."
|
10
|
+
|
10
11
|
require 'rubygems'
|
11
12
|
require 'csd'
|
12
13
|
|
13
14
|
begin
|
14
|
-
# Running the CSD library and telling it who started it
|
15
15
|
CSD.bootstrap :executable => 'ai'
|
16
16
|
rescue CSD::Error::CSDError => e
|
17
|
-
# Here we catch CSD internal errors and exit with the propriate status code
|
18
|
-
# We output the error message for status codes 50+, because they are rather severe
|
19
17
|
CSD.ui.error e.message unless e.status_code <= 49
|
20
18
|
exit e.status_code
|
21
19
|
rescue Interrupt
|
22
|
-
|
20
|
+
CSD.ui.separator
|
23
21
|
CSD.ui.info "Quitting the AI...".red
|
24
|
-
|
22
|
+
exit
|
25
23
|
end
|
data/bin/tta
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# NOTE: If you would like to execute this file as a developer
|
4
|
+
# but not install the CSD gem, you can use this command:
|
5
|
+
# ruby -I path/to/csd/lib path/to/csd/bin/tta
|
6
|
+
|
7
|
+
# First, let's load the RubyGems framework and the CSD gem.
|
8
|
+
# Even though RubyGems is already loaded for Ruby >= 1.9,
|
9
|
+
# we want to go sure here and load it to provide robustness
|
10
|
+
require 'rubygems'
|
11
|
+
require 'csd'
|
12
|
+
|
13
|
+
begin
|
14
|
+
# Running the CSD library and telling it who started it
|
15
|
+
CSD.bootstrap :executable => 'tta'
|
16
|
+
rescue CSD::Error::CSDError => e
|
17
|
+
# Here we catch CSD internal errors and exit with the propriate status code
|
18
|
+
# We output the error message only for status codes 50 and higher, because they are rather severe
|
19
|
+
CSD.ui.error e.message unless e.status_code <= 49
|
20
|
+
exit e.status_code
|
21
|
+
rescue Interrupt
|
22
|
+
# Lastly, close the AI gracefully on abnormal termination
|
23
|
+
CSD.ui.separator
|
24
|
+
CSD.ui.info "Quitting the AI...".red
|
25
|
+
exit
|
26
|
+
end
|
data/csd.gemspec
CHANGED
@@ -5,15 +5,14 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{csd}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
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"]
|
12
|
-
s.date = %q{2010-07-
|
13
|
-
s.default_executable = %q{ai}
|
12
|
+
s.date = %q{2010-07-28}
|
14
13
|
s.description = %q{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.}
|
15
14
|
s.email = %q{mtoday11@gmail.com}
|
16
|
-
s.executables = ["ai"]
|
15
|
+
s.executables = ["tta", "ai"]
|
17
16
|
s.extra_rdoc_files = [
|
18
17
|
"README.rdoc"
|
19
18
|
]
|
@@ -25,6 +24,7 @@ Gem::Specification.new do |s|
|
|
25
24
|
"Rakefile",
|
26
25
|
"VERSION",
|
27
26
|
"bin/ai",
|
27
|
+
"bin/tta",
|
28
28
|
"csd.gemspec",
|
29
29
|
"lib/csd.rb",
|
30
30
|
"lib/csd/application.rb",
|
@@ -64,6 +64,7 @@ Gem::Specification.new do |s|
|
|
64
64
|
"lib/csd/vendor/active_support/inflector.rb",
|
65
65
|
"lib/csd/vendor/term/GPL2-LICENSE",
|
66
66
|
"lib/csd/vendor/term/ansicolor.rb",
|
67
|
+
"lib/csd/vendor/zentest/zentest_assertions.rb",
|
67
68
|
"lib/csd/version.rb",
|
68
69
|
"test/application/test_minisip.rb",
|
69
70
|
"test/functional/test_applications.rb",
|
@@ -76,18 +77,19 @@ Gem::Specification.new do |s|
|
|
76
77
|
]
|
77
78
|
s.homepage = %q{http://github.com/csd/csd}
|
78
79
|
s.post_install_message = %q{
|
79
|
-
|
80
|
+
============================================================
|
80
81
|
|
81
|
-
|
82
|
+
Thank you for installing the TTA Automated Installer!
|
82
83
|
|
83
|
-
|
84
|
+
You can run it by typing `tta´ in your command line.
|
84
85
|
|
85
|
-
|
86
|
-
|
86
|
+
NOTE: On DEBIAN and UBUNTU the executable `tta´ is *maybe*
|
87
|
+
not in your PATH by default. If that is the case,
|
88
|
+
you can fix it by running this command:
|
87
89
|
|
88
|
-
|
90
|
+
echo "export PATH=\$PATH:$(gem env | grep "E D" | sed "s/[^\w]* //")" >> ~/.bashrc;. ~/.bashrc
|
89
91
|
|
90
|
-
|
92
|
+
============================================================
|
91
93
|
}
|
92
94
|
s.rdoc_options = ["--charset=UTF-8"]
|
93
95
|
s.require_paths = ["lib"]
|
data/lib/csd.rb
CHANGED
@@ -44,8 +44,8 @@ module CSD
|
|
44
44
|
UI.info opts.help
|
45
45
|
end
|
46
46
|
UI.separator
|
47
|
-
UI.info ' For more information type: '.green.bold + "#{executable} [APPLICATION NAME]".cyan.bold
|
48
|
-
UI.info ' For example: '.green.bold + "#{executable} minisip".cyan.bold
|
47
|
+
UI.info ' For more information type: '.green.bold + "#{executable} [APPLICATION NAME]".cyan.bold + " Example: #{executable} minisip".dark
|
48
|
+
#UI.info ' For example: '.green.bold + "#{executable} minisip".cyan.bold
|
49
49
|
UI.separator
|
50
50
|
UI.warn "You did not specify a valid application name."
|
51
51
|
raise Error::Argument::NoApplication
|
@@ -66,9 +66,11 @@ module CSD
|
|
66
66
|
UI.info opts.help
|
67
67
|
end
|
68
68
|
UI.separator
|
69
|
-
UI.info ' To execute
|
70
|
-
UI.info '
|
71
|
-
UI.info '
|
69
|
+
UI.info ' To execute a task: '.green.bold + "#{executable} [TASK] #{Applications.current.name}".cyan.bold + " Example: #{executable} compile minisip".dark
|
70
|
+
#UI.info ' To execute a task: '.green.bold + "#{executable} [TASK] #{Applications.current.name}".cyan.bold
|
71
|
+
UI.info ' For more details: '.green.bold + "#{executable} help [TASK] #{Applications.current.name}".cyan.bold + " Example: #{executable} help compile minisip".dark
|
72
|
+
#UI.info ' For more details: '.green.bold + "#{executable} help [TASK] #{Applications.current.name}".cyan.bold
|
73
|
+
#UI.info ' Example: '.green.bold + "#{executable} help install #{Applications.current.name}".cyan.bold
|
72
74
|
UI.separator
|
73
75
|
UI.warn "You did not specify a valid task name."
|
74
76
|
raise Error::Argument::NoAction
|
@@ -24,32 +24,32 @@ module CSD
|
|
24
24
|
define_root_path
|
25
25
|
define_paths
|
26
26
|
UI.separator
|
27
|
-
UI.info " Working directory:
|
28
|
-
UI.info " Your Platform:
|
29
|
-
UI.info(" Application module:
|
27
|
+
UI.info " Working directory: ".green + Path.work.to_s.yellow
|
28
|
+
UI.info " Your Platform: ".green + Gem::Platform.local.humanize.to_s.yellow
|
29
|
+
UI.info(" Application module: ".green + self.class.name.to_s.yellow)
|
30
30
|
UI.separator
|
31
31
|
if Options.help
|
32
32
|
UI.info Options.helptext
|
33
|
-
|
33
|
+
exit
|
34
34
|
else
|
35
|
-
raise
|
35
|
+
raise Interrupt unless (Options.yes or Options.reveal or UI.ask_yes_no("Continue?".red.bold, true))
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
# CROSS-PLATFORM TASKS
|
39
|
+
# OTHER CROSS-PLATFORM TASKS
|
40
40
|
|
41
|
+
# Determines which libraries of MiniSIP should be processed, because the --only parameter might be set.
|
42
|
+
#
|
41
43
|
def libraries
|
42
44
|
Options.only ? LIBRARIES.map { |lib| lib if Options.only.to_a.include?(lib) }.compact : LIBRARIES
|
43
45
|
end
|
46
|
+
|
47
|
+
# CHECKOUTS
|
44
48
|
|
45
49
|
def checkout_minisip
|
46
50
|
Cmd.git_clone('MiniSIP repository', 'http://github.com/csd/minisip.git', Path.repository)
|
47
51
|
end
|
48
52
|
|
49
|
-
def modify_minisip
|
50
|
-
Cmd.replace(Path.repository_open_gl_display, '/home/erik', Path.build)
|
51
|
-
end
|
52
|
-
|
53
53
|
def checkout_plugins
|
54
54
|
Cmd.git_clone('additional MiniSIP plugins', 'http://github.com/csd/minisip-plugins.git', Path.plugins)
|
55
55
|
end
|
@@ -58,14 +58,58 @@ module CSD
|
|
58
58
|
Cmd.git_clone('HDVIPER', 'http://github.com/csd/libraries.git', Path.hdviper)
|
59
59
|
end
|
60
60
|
|
61
|
-
|
61
|
+
def checkout_ffmpeg
|
62
|
+
Cmd.git_clone('ffmpeg repository', 'http://github.com/csd/ffmpeg.git', Path.ffmpeg_repository)
|
63
|
+
end
|
64
|
+
|
65
|
+
def checkout_libswscale
|
66
|
+
Cmd.git_clone('ffmpeg libswscale sub-repository', 'http://github.com/csd/libswscale.git', Path.ffmpeg_libswscale)
|
67
|
+
end
|
62
68
|
|
63
|
-
def
|
64
|
-
|
69
|
+
def checkout_x264
|
70
|
+
Cmd.git_clone('x264 repository', 'http://github.com/csd/x264.git', Path.x264_repository)
|
65
71
|
end
|
66
72
|
|
67
|
-
|
68
|
-
|
73
|
+
# MODIFYING FILES
|
74
|
+
|
75
|
+
def modify_minisip
|
76
|
+
Cmd.replace(Path.repository_open_gl_display, '/home/erik', Path.build)
|
77
|
+
if Options.ffmpeg_first
|
78
|
+
# See http://www.howgeek.com/2010/03/01/ffmpeg-php-error-‘pix_fmt_rgba32’-undeclared-first-use-in-this-function/
|
79
|
+
# and http://ffmpeg.org/doxygen/0.5/pixfmt_8h.html#33d341c4f443d24492a95fb7641d0986
|
80
|
+
Cmd.replace(Path.repository_avcoder_cxx, 'PIX_FMT_RGBA32', 'PIX_FMT_RGB32')
|
81
|
+
Cmd.replace(Path.repository_avdecoder_cxx, 'PIX_FMT_RGBA32', 'PIX_FMT_RGB32')
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def modify_libavutil
|
86
|
+
if Path.ffmpeg_libavutil_common_backup.file?
|
87
|
+
UI.warn "The libavutil common.h file seems to be fixed already, I won't touch it now. Delete #{Path.ffmpeg_libavutil_common_backup.enquote} to enforce it."
|
88
|
+
else
|
89
|
+
Cmd.copy Path.ffmpeg_libavutil_common, Path.ffmpeg_libavutil_common_backup
|
90
|
+
Cmd.replace Path.ffmpeg_libavutil_common, ' if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;', " // MODIFIED BY THE AUTOMATED INSTALLER\n // if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;\n if ((a+0x80000000u) & ~(0xFFFFFFFFULL)) return (a>>63) ^ 0x7FFFFFFF;"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# FLAGS
|
95
|
+
|
96
|
+
# See http://code.google.com/p/ffmpegsource/issues/detail?id=11
|
97
|
+
# But for some reason it did not fix tue issue for us :|
|
98
|
+
#
|
99
|
+
def libminisip_c_flags
|
100
|
+
%{CFLAGS="-D__STDC_CONSTANT_MACROS"}
|
101
|
+
end
|
102
|
+
|
103
|
+
def libminisip_cpp_flags
|
104
|
+
if Options.ffmpeg_first?
|
105
|
+
%{CPPFLAGS="-I#{Path.hdviper_x264} -I#{Path.hdviper_x264_test_x264api} -I#{Path.ffmpeg_libavutil} -I#{Path.ffmpeg_libavcodec} -I#{Path.ffmpeg_libswscale} -I#{Path.repository_grabber} -I#{Path.repository_decklinksdk}"}
|
106
|
+
else
|
107
|
+
%{CPPFLAGS="-I#{Path.hdviper_x264} -I#{Path.hdviper_x264_test_x264api} -I#{Path.repository_grabber} -I#{Path.repository_decklinksdk}"}
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def libminisip_ld_flags
|
112
|
+
%{LDFLAGS="#{Path.hdviper_libx264api} #{Path.hdviper_libtidx264} -lpthread -lrt"}
|
69
113
|
end
|
70
114
|
|
71
115
|
# DEFINING PATHS ETC...
|
@@ -83,7 +127,7 @@ module CSD
|
|
83
127
|
end
|
84
128
|
|
85
129
|
def define_paths
|
86
|
-
Path.work = Pathname.new(File.join(Path.root, 'minisip'))
|
130
|
+
Path.work = Pathname.new(File.join(Path.root, 'minisip.ai'))
|
87
131
|
Path.giomm_header = Pathname.new(File.join('/', 'usr', 'include', 'giomm-2.4', 'giomm.h'))
|
88
132
|
Path.giomm_header_backup = Pathname.new(File.join('/', 'usr', 'include', 'giomm-2.4', 'giomm.h.ai-backup'))
|
89
133
|
Path.repository = Pathname.new(File.join(Path.work, 'repository'))
|
@@ -91,8 +135,16 @@ module CSD
|
|
91
135
|
Path.repository_libminisip_rules_backup = Pathname.new(File.join(Path.repository, 'libminisip', 'debian', 'rules.ai-backup'))
|
92
136
|
Path.repository_grabber = Pathname.new(File.join(Path.repository, 'libminisip', 'source', 'subsystem_media', 'video', 'grabber'))
|
93
137
|
Path.repository_open_gl_display = Pathname.new(File.join(Path.repository, 'libminisip', 'source', 'subsystem_media', 'video', 'display', 'OpenGLDisplay.cxx'))
|
138
|
+
Path.repository_avcoder_cxx = Pathname.new(File.join(Path.repository, 'libminisip', 'source', 'subsystem_media', 'video', 'codec', 'AVCoder.cxx'))
|
139
|
+
Path.repository_avdecoder_cxx = Pathname.new(File.join(Path.repository, 'libminisip', 'source', 'subsystem_media', 'video', 'codec', 'AVDecoder.cxx'))
|
94
140
|
Path.repository_decklinksdk = Pathname.new(File.join(Path.repository_grabber, 'decklinksdk'))
|
95
|
-
Path.
|
141
|
+
Path.ffmpeg_repository = Pathname.new(File.join(Path.work, 'ffmpeg'))
|
142
|
+
Path.ffmpeg_libavutil = Pathname.new(File.join(Path.ffmpeg_repository, 'libavutil'))
|
143
|
+
Path.ffmpeg_libavutil_common = Pathname.new(File.join(Path.ffmpeg_libavutil, 'common.h'))
|
144
|
+
Path.ffmpeg_libavutil_common_backup = Pathname.new(File.join(Path.ffmpeg_libavutil, 'common.h.ai-backup'))
|
145
|
+
Path.ffmpeg_libavcodec = Pathname.new(File.join(Path.ffmpeg_repository, 'libavcodec'))
|
146
|
+
Path.ffmpeg_libswscale = Pathname.new(File.join(Path.ffmpeg_repository, 'libswscale'))
|
147
|
+
Path.x264_repository = Pathname.new(File.join(Path.work, 'x264'))
|
96
148
|
Path.packaging = Pathname.new(File.join(Path.work, 'packaging'))
|
97
149
|
Path.hdviper = Pathname.new(File.join(Path.work, 'hdviper'))
|
98
150
|
Path.hdviper_x264 = Pathname.new(File.join(Path.hdviper, 'x264'))
|
@@ -107,6 +159,8 @@ module CSD
|
|
107
159
|
Path.build_lib_pkg_config = Pathname.new(File.join(Path.build_lib, 'pkgconfig'))
|
108
160
|
Path.build_share = Pathname.new(File.join(Path.build, 'share'))
|
109
161
|
Path.build_share_aclocal = Pathname.new(File.join(Path.build_share, 'aclocal'))
|
162
|
+
Path.plugins = Pathname.new(File.join(Path.work, 'plugins'))
|
163
|
+
Path.plugins_destination = Pathname.new(File.join(Path.build_lib, 'libminisip', 'plugins'))
|
110
164
|
end
|
111
165
|
|
112
166
|
end
|
@@ -25,11 +25,21 @@ end
|
|
25
25
|
# end
|
26
26
|
#end
|
27
27
|
|
28
|
+
#self.debug_minisip = false
|
29
|
+
#opts.on("--debug-minisip","Compile MiniSIP using the --enable-debug flag.") do |value|
|
30
|
+
# self.debug_minisip = value
|
31
|
+
#end
|
32
|
+
|
28
33
|
self.only_fix_giomm = false
|
29
34
|
opts.on("--only-fix-giomm","Forces the AI to do nothing except trying to bugfix the Ubuntu 10.04 giomm") do |value|
|
30
35
|
self.only_fix_giomm = value
|
31
36
|
end
|
32
37
|
|
38
|
+
self.ffmpeg_first = false
|
39
|
+
opts.on("--ffmpeg-first","Compile FFmpeg before compiling MiniSIP. Default is first MiniSIP.") do |value|
|
40
|
+
self.ffmpeg_first = value
|
41
|
+
end
|
42
|
+
|
33
43
|
self.apt_get = true
|
34
44
|
opts.on("--no-apt-get","Don't run any apt-get commands") do |value|
|
35
45
|
self.apt_get = value
|
@@ -6,14 +6,16 @@ module CSD
|
|
6
6
|
module Minisip
|
7
7
|
class Unix < Base
|
8
8
|
|
9
|
-
#
|
10
|
-
|
9
|
+
# This method presents a general overview about the task that is to be performed.
|
10
|
+
#
|
11
11
|
def introduction
|
12
12
|
UI.separator
|
13
|
-
UI.info "
|
13
|
+
UI.info " MiniSIP libraries to process: ".green + libraries.join(', ').yellow
|
14
14
|
super
|
15
15
|
end
|
16
16
|
|
17
|
+
# This method is called by the AI when the user requests the task "compile" for MiniSIP.
|
18
|
+
#
|
17
19
|
def compile
|
18
20
|
UI.separator
|
19
21
|
UI.info "This operation will download and compile MiniSIP.".green.bold
|
@@ -22,6 +24,8 @@ module CSD
|
|
22
24
|
run_minisip_gtk_gui
|
23
25
|
end
|
24
26
|
|
27
|
+
# This method is called by the AI when the user requests the task "package" for MiniSIP.
|
28
|
+
#
|
25
29
|
def package
|
26
30
|
UI.separator
|
27
31
|
UI.info("This operation will package ".green.bold + "an already compiled".red.bold + " MiniSIP.".green.bold)
|
@@ -29,31 +33,78 @@ module CSD
|
|
29
33
|
package!
|
30
34
|
end
|
31
35
|
|
32
|
-
#
|
33
|
-
|
36
|
+
# This is the internal compile procedure for MiniSIP
|
37
|
+
#
|
34
38
|
def compile!
|
35
39
|
Cmd.mkdir Path.work
|
36
|
-
checkout_hdviper
|
37
|
-
|
38
|
-
checkout_minisip
|
39
|
-
modify_minisip
|
40
|
+
make_hdviper unless checkout_hdviper.already_exists?
|
41
|
+
modify_minisip unless checkout_minisip.already_exists?
|
40
42
|
checkout_plugins
|
41
|
-
|
43
|
+
if Options.ffmpeg_first
|
44
|
+
make_x264 unless checkout_x264.already_exists?
|
45
|
+
unless checkout_ffmpeg.already_exists?
|
46
|
+
modify_libavutil
|
47
|
+
checkout_libswscale
|
48
|
+
make_ffmpeg
|
49
|
+
end
|
50
|
+
make_minisip
|
51
|
+
else
|
52
|
+
make_minisip
|
53
|
+
make_x264 unless checkout_x264.already_exists?
|
54
|
+
unless checkout_ffmpeg.already_exists?
|
55
|
+
checkout_libswscale
|
56
|
+
make_ffmpeg
|
57
|
+
end
|
58
|
+
end
|
59
|
+
copy_plugins
|
60
|
+
end
|
61
|
+
|
62
|
+
# This method compiles FFmpeg, given that FFmpeg was downloaded before.
|
63
|
+
#
|
64
|
+
def make_ffmpeg
|
65
|
+
Cmd.cd Path.ffmpeg_repository, :internal => true
|
66
|
+
Cmd.run('./configure --enable-gpl --enable-libx264 --enable-x11grab')
|
67
|
+
Cmd.run('make')
|
68
|
+
Cmd.run('sudo checkinstall --pkgname=ffmpeg --pkgversion "99:-`git log -1 --pretty=format:%h`" --backup=no --default')
|
42
69
|
end
|
43
70
|
|
71
|
+
# This method compiles x264, given that x264 was downloaded before.
|
72
|
+
#
|
73
|
+
def make_x264
|
74
|
+
Cmd.cd Path.x264_repository, :internal => true
|
75
|
+
Cmd.run('./configure')
|
76
|
+
Cmd.run('make')
|
77
|
+
Cmd.run('sudo checkinstall --pkgname=x264 --pkgversion "99:-`git log -1 --pretty=format:%h`" --backup=no --default')
|
78
|
+
end
|
79
|
+
|
80
|
+
# This method compiles HDVIPER, given that HDVIPER was downloaded before.
|
81
|
+
#
|
44
82
|
def make_hdviper
|
45
|
-
Cmd.cd Path.hdviper_x264
|
83
|
+
Cmd.cd Path.hdviper_x264, :internal => true
|
46
84
|
Cmd.run('./configure')
|
47
85
|
Cmd.run('make')
|
48
|
-
Cmd.cd Path.hdviper_x264_test_x264api
|
86
|
+
Cmd.cd Path.hdviper_x264_test_x264api, :internal => true
|
49
87
|
Cmd.run('make')
|
50
88
|
end
|
51
89
|
|
90
|
+
# Creates all build directories such as +lib+, +share+, +bin+, etc.
|
91
|
+
#
|
52
92
|
def create_build_dir
|
53
93
|
UI.info "Creating target build directories".green.bold
|
54
94
|
[Path.build, Path.build_include, Path.build_lib, Path.build_share, Path.build_share_aclocal].each { |target| Cmd.mkdir target }
|
55
95
|
end
|
56
96
|
|
97
|
+
# Copies the plugins from the repository to the final destination.
|
98
|
+
#
|
99
|
+
def copy_plugins
|
100
|
+
UI.info "Creating plugin target directory".green.bold
|
101
|
+
# result = Path.plugins_destination.parent.directory? ? Cmd.run("sudo mkdir #{Path.plugins_destination}") : CommandResult.new
|
102
|
+
# TODO: This will maybe need sudo rights in the future
|
103
|
+
Cmd.copy(Dir[File.join('Path.plugins', '*.{l,la,so}')], Path.plugins_destination) if Path.plugins_destination.directory?
|
104
|
+
end
|
105
|
+
|
106
|
+
# Iteratively configures and compiles the internal MiniSIP libraries.
|
107
|
+
#
|
57
108
|
def make_minisip
|
58
109
|
create_build_dir
|
59
110
|
libraries.each do |library|
|
@@ -68,8 +119,7 @@ module CSD
|
|
68
119
|
UI.info "Configuring #{library}".green.bold
|
69
120
|
individual_options = case library
|
70
121
|
when 'libminisip'
|
71
|
-
%Q{--enable-debug --enable-video --disable-mil --enable-decklink --enable-opengl --disable-sdl
|
72
|
-
#%Q{--enable-debug --enable-video --disable-mil --disable-decklink --enable-opengl --disable-sdl CPPFLAGS="-I#{Path.hdviper_x264}" LDFLAGS="#{File.join(Path.hdviper_x264, 'libx264.a')} -lpthread -lrt"}
|
122
|
+
%Q{--enable-debug --enable-video --disable-mil --enable-decklink --enable-opengl --disable-sdl #{libminisip_c_flags} #{libminisip_cpp_flags} #{libminisip_ld_flags}}
|
73
123
|
when 'minisip'
|
74
124
|
%Q{--enable-debug --enable-video --enable-textui --enable-opengl}
|
75
125
|
else
|
@@ -92,6 +142,8 @@ module CSD
|
|
92
142
|
end
|
93
143
|
end
|
94
144
|
|
145
|
+
# Iteratively makes debian packages of the internal MiniSIP libraries.
|
146
|
+
#
|
95
147
|
def package!
|
96
148
|
Cmd.mkdir(Path.packaging)
|
97
149
|
libraries.each do |library|
|
@@ -135,8 +187,11 @@ module CSD
|
|
135
187
|
end
|
136
188
|
end
|
137
189
|
Cmd.cd Path.root
|
190
|
+
Cmd.run('minisip_gtk_gui')
|
138
191
|
end
|
139
192
|
|
193
|
+
# Executed the MiniSIP GTK GUI.
|
194
|
+
#
|
140
195
|
def run_minisip_gtk_gui
|
141
196
|
Cmd.run(Path.build_gtkgui, :die_on_failure => false)
|
142
197
|
end
|
@@ -8,7 +8,7 @@ module CSD
|
|
8
8
|
|
9
9
|
# A list of apt-get packages that are required to compile minisip including hdviper and ffmpeg
|
10
10
|
#
|
11
|
-
DEBIAN_DEPENDENCIES = %w{ automake build-essential
|
11
|
+
DEBIAN_DEPENDENCIES = %w{ automake build-essential checkinstall git-core libasound2-dev libavcodec-dev libglademm-2.4-dev libgtkmm-2.4-dev libltdl3-dev libsdl-dev libsdl-ttf2.0-dev libssl-dev libtool libswscale-dev libx11-dev libxv-dev nasm subversion yasm }
|
12
12
|
|
13
13
|
def compile!
|
14
14
|
install_aptitude_dependencies if Options.apt_get
|
@@ -26,19 +26,15 @@ module CSD
|
|
26
26
|
|
27
27
|
def install_aptitude_dependencies
|
28
28
|
Cmd.run("sudo apt-get update")
|
29
|
-
#DEBIAN_DEPENDENCIES.
|
30
|
-
# Cmd.run("sudo apt-get install #{apt} --yes --fix-missing")
|
31
|
-
#end
|
32
|
-
# We could also do all in one command:
|
33
|
-
Cmd.run("sudo apt-get install #{DEBIAN_DEPENDENCIES.join(' ')} --yes --fix-missing")
|
29
|
+
Cmd.run("sudo apt-get install #{DEBIAN_DEPENDENCIES.sort.join(' ')} --yes --fix-missing")
|
34
30
|
end
|
35
31
|
|
36
32
|
def modify_libminisip_rules
|
37
|
-
if
|
33
|
+
if Path.repository_libminisip_rules_backup.file?
|
38
34
|
UI.warn "The libminisip rules seem to be fixed already, I won't touch them now. Delete #{Path.repository_libminisip_rules_backup.enquote} to enforce it."
|
39
35
|
else
|
40
36
|
Cmd.copy Path.repository_libminisip_rules, Path.repository_libminisip_rules_backup
|
41
|
-
Cmd.replace Path.repository_libminisip_rules, 'AUTOMATED_INSTALLER_PLACEHOLDER=""', [
|
37
|
+
Cmd.replace Path.repository_libminisip_rules, 'AUTOMATED_INSTALLER_PLACEHOLDER=""', [libminisip_cpp_flags, libminisip_ld_flags].join(' ')
|
42
38
|
end
|
43
39
|
end
|
44
40
|
|
@@ -13,7 +13,7 @@ module CSD
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def fix_ubuntu_10_04
|
16
|
-
if
|
16
|
+
if Path.giomm_header_backup.file?
|
17
17
|
UI.warn "giomm-2.4 seems to be fixed already, I won't touch it now. Delete #{Path.giomm_header_backup.enquote} to enforce it."
|
18
18
|
else
|
19
19
|
Path.new_giomm_header = File.join(Dir.mktmpdir, 'giomm.h')
|
data/lib/csd/commands.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- encoding: UTF-8 -*-
|
2
2
|
require 'pathname'
|
3
3
|
require 'ostruct'
|
4
|
+
require 'open3'
|
4
5
|
|
5
6
|
module CSD
|
6
7
|
# This class contains wrapper methods for standard file system operations. They are meant to be
|
@@ -34,7 +35,7 @@ module CSD
|
|
34
35
|
# mkdir('i/can/create/directories/recursively')
|
35
36
|
#
|
36
37
|
def mkdir(target, params={})
|
37
|
-
default_params = { :die_on_failure => true, :
|
38
|
+
default_params = { :die_on_failure => true, :internal => false }
|
38
39
|
params = default_params.merge(params)
|
39
40
|
target = target.pathnamify
|
40
41
|
result = CommandResult.new
|
@@ -43,7 +44,7 @@ module CSD
|
|
43
44
|
result.already_existed = true
|
44
45
|
else
|
45
46
|
begin
|
46
|
-
UI.info "Creating directory: #{target}".cyan
|
47
|
+
UI.info "Creating directory: #{target}".cyan unless params[:internal]
|
47
48
|
# Try to create the directory
|
48
49
|
target.mkpath unless Options.reveal
|
49
50
|
rescue Errno::EACCES => e
|
@@ -65,11 +66,11 @@ module CSD
|
|
65
66
|
# [+success?+] +true+ if pwd is where it was requested to be after the operation, +nil+ if not.
|
66
67
|
#
|
67
68
|
def cd(target, params={})
|
68
|
-
default_params = { :die_on_failure => true, :
|
69
|
+
default_params = { :die_on_failure => true, :internal => false }
|
69
70
|
params = default_params.merge(params)
|
70
71
|
target = target.pathnamify
|
71
72
|
result = CommandResult.new
|
72
|
-
UI.info "cd #{target}".yellow
|
73
|
+
UI.info "cd #{target}".yellow unless params[:internal]
|
73
74
|
if Options.reveal
|
74
75
|
# We need to fake changing the directory in reveal mode.
|
75
76
|
@pwd = target.to_s
|
@@ -150,11 +151,18 @@ module CSD
|
|
150
151
|
default_params = { :die_on_failure => true }
|
151
152
|
params = default_params.merge(params)
|
152
153
|
begin
|
153
|
-
UI.info "
|
154
|
+
UI.info " Modifying".yellow
|
155
|
+
UI.info " `#{pattern}´".blue
|
156
|
+
UI.info " to".yellow
|
157
|
+
UI.info " `#{substitution.to_s.gsub("\n", "\n ")}´".white
|
154
158
|
new_file_content = File.read(self.filepath).gsub(pattern.to_s, substitution.to_s)
|
155
159
|
File.open(self.filepath, 'w+') { |file| file << new_file_content } unless Options.reveal
|
156
160
|
result.success = true
|
157
161
|
rescue Errno::ENOENT => e
|
162
|
+
if Options.reveal
|
163
|
+
result.success = true
|
164
|
+
return result
|
165
|
+
end
|
158
166
|
result.success = false
|
159
167
|
result.reason = "Could not perform replace operation! #{e.message}"
|
160
168
|
params[:die_on_failure] ? UI.die(result.reason) : UI.error(result.reason)
|
@@ -165,48 +173,46 @@ module CSD
|
|
165
173
|
|
166
174
|
# Runs a command on the system.
|
167
175
|
#
|
168
|
-
# ==== Returns
|
169
|
-
#
|
170
|
-
# The command's output as a +String+ (with newline delimiters). Note that the exit code can be accessed via the global variable <tt>$?</tt>
|
171
|
-
#
|
172
176
|
# ==== Options
|
173
177
|
#
|
174
178
|
# The following options can be passed as a hash.
|
175
179
|
#
|
176
|
-
# [+:
|
177
|
-
# [+:
|
178
|
-
# [+:
|
179
|
-
# [+:
|
180
|
-
#
|
180
|
+
# [+:die_on_failure+] If the exit code of the command was not 0, exit the CSD application (default: +true+).
|
181
|
+
# [+:announce_pwd+] Before running the command, announce in which path the command will be executed (default: +true+).
|
182
|
+
# [+:verbose+] Instead of printing just one `.´ per command output line, print the full command output lines (default: +false+).
|
183
|
+
# [+:internal+] If this parameter is +true+, there will be no output what-so-ever for running this command. (default: +false+).
|
184
|
+
#
|
185
|
+
# ==== Returns
|
186
|
+
#
|
187
|
+
# This method returns a CommandResult object with the following values:
|
188
|
+
#
|
189
|
+
# [+success?+] +true+ if the command was successful, +nil+ if not.
|
190
|
+
# [+output?+] The command's output as a +String+ (with newline delimiters). Note that the exit code can be accessed via the global variable <tt>$?</tt>
|
181
191
|
#
|
182
192
|
def run(cmd, params={})
|
183
|
-
default_params = { :die_on_failure => true, :
|
184
|
-
params[:verbose] = true if Options.verbose
|
193
|
+
default_params = { :die_on_failure => true, :announce_pwd => true, :verbose => Options.verbose, :internal => Options.testmode }
|
185
194
|
params = default_params.merge(params)
|
186
195
|
result = CommandResult.new
|
187
196
|
cmd = cmd.to_s
|
188
|
-
UI.
|
189
|
-
UI.info
|
190
|
-
UI.info cmd.cyan if (!params[:silent] or params[:announce_cmd])
|
197
|
+
UI.info "Running command in #{pwd}".yellow if params[:announce_pwd] and !params[:internal]
|
198
|
+
UI.info cmd.cyan unless params[:internal]
|
191
199
|
if Options.reveal
|
192
200
|
result.success = true
|
193
201
|
return result
|
194
202
|
end
|
195
203
|
result.output = ''
|
196
|
-
|
197
|
-
IO.popen(cmd) do |
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
$stdout.putc '.' unless params[:silent]
|
203
|
-
$stdout.flush
|
204
|
+
STDOUT.sync = true # Because we redirect stderr into stdout to get the output and it needs to be flushing automatically
|
205
|
+
IO.popen("#{cmd} 2>&1") do |pipe| # IO redirection is performed using operators
|
206
|
+
pipe.sync = true
|
207
|
+
while line = pipe.gets
|
208
|
+
unless params[:internal] # No output needed for the unit-tests and AI-internal use
|
209
|
+
params[:verbose] ? UI.info(" #{line}") : UI.indicate_activity
|
204
210
|
end
|
205
211
|
result.output << line
|
206
212
|
end
|
207
213
|
end
|
208
|
-
|
209
|
-
|
214
|
+
UI.separator unless params[:verbose] or params[:internal] or Options.testmode # i.e. if dots are concatenated in the same line, we should create a new line after them
|
215
|
+
result.status = $?
|
210
216
|
result.success = $?.success?
|
211
217
|
if params[:die_on_failure] and !result.success
|
212
218
|
UI.info result.output unless params[:verbose] # In verbose mode, we don't need to repeat the unsuccessful command's output
|
@@ -241,24 +247,22 @@ module CSD
|
|
241
247
|
#
|
242
248
|
# This command will not do anything if the destination already exists.
|
243
249
|
#
|
244
|
-
def git_clone(name, repository, destination
|
245
|
-
default_params = { :die_on_failure => false, :announce_cmd => true, :announce_pwd => false, :silent => false }
|
246
|
-
params = default_params.merge(params)
|
250
|
+
def git_clone(name, repository, destination)
|
247
251
|
result = CommandResult.new
|
248
252
|
destination = destination.pathnamify
|
249
|
-
|
250
|
-
if (destination.directory? and !Options.reveal)
|
253
|
+
if destination.directory? and !Options.reveal
|
251
254
|
UI.warn "Skipping #{name} download, because the directory already exists: #{destination.enquote}"
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
end
|
260
|
-
result
|
255
|
+
result.already_exists = true
|
256
|
+
return result
|
257
|
+
end
|
258
|
+
unless destination.parent.writable? or Options.reveal
|
259
|
+
UI.error "Could not download #{name} (no permission): #{destination.enquote}"
|
260
|
+
result.no_permission = true
|
261
|
+
return result
|
261
262
|
end
|
263
|
+
UI.info "Downloading #{name} to #{destination.enquote}".green.bold
|
264
|
+
# We will simply return the CommandResult of the run-method.
|
265
|
+
Cmd.run("git clone #{repository} #{destination}", :announce_pwd => false, :verbose => true)
|
262
266
|
end
|
263
267
|
|
264
268
|
end
|
@@ -19,13 +19,13 @@ module CSD
|
|
19
19
|
# On linux systems, this method returns the current kernel version.
|
20
20
|
#
|
21
21
|
def kernel_version
|
22
|
-
Cmd.run('uname --kernel-version', :
|
22
|
+
Cmd.run('uname --kernel-version', :internal => true).output.to_s.chop if os == 'linux'
|
23
23
|
end
|
24
24
|
|
25
25
|
# On linux systems, this method returns the current kernel release.
|
26
26
|
#
|
27
27
|
def kernel_release
|
28
|
-
Cmd.run('uname --kernel-release', :
|
28
|
+
Cmd.run('uname --kernel-release', :internal => true).output.to_s.chop if os == 'linux'
|
29
29
|
end
|
30
30
|
|
31
31
|
end
|
data/lib/csd/options_parser.rb
CHANGED
@@ -44,7 +44,7 @@ module CSD
|
|
44
44
|
self.action = nil
|
45
45
|
# Now we define the default options
|
46
46
|
self.yes = false
|
47
|
-
self.
|
47
|
+
self.local = false
|
48
48
|
self.reveal = false
|
49
49
|
self.verbose = false
|
50
50
|
self.silent = false
|
@@ -114,9 +114,9 @@ module CSD
|
|
114
114
|
opts.on("-y", "--yes", "Answer all questions with `yes´ (batch mode)") do |value|
|
115
115
|
self.yes = value
|
116
116
|
end
|
117
|
-
opts.on("-
|
118
|
-
|
119
|
-
end
|
117
|
+
#opts.on("-l", "--local","Assume that there is no uplink to the Internet") do |value|
|
118
|
+
# self.online = !value
|
119
|
+
#end
|
120
120
|
opts.on("-r", "--reveal","List all commands that normally would be executed in this operation") do |value|
|
121
121
|
self.reveal = value
|
122
122
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# -*- encoding: UTF-8 -*-
|
2
|
+
#
|
3
|
+
# (The MIT License)
|
4
|
+
#
|
5
|
+
# Copyright (c) 2001-2006 Ryan Davis, Eric Hodel, Zen Spider Software
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
14
|
+
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
21
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
22
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
23
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
24
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
|
26
|
+
require 'test/unit/assertions'
|
27
|
+
|
28
|
+
# Extra assertions for Test::Unit
|
29
|
+
|
30
|
+
module Test::Unit::Assertions
|
31
|
+
|
32
|
+
# Captures $stdout and $stderr to StringIO objects and returns them.
|
33
|
+
# Restores $stdout and $stderr when done.
|
34
|
+
#
|
35
|
+
# Usage:
|
36
|
+
# def test_puts
|
37
|
+
# out, err = capture do
|
38
|
+
# puts 'hi'
|
39
|
+
# STDERR.puts 'bye!'
|
40
|
+
# end
|
41
|
+
# assert_equal "hi\n", out.string
|
42
|
+
# assert_equal "bye!\n", err.string
|
43
|
+
# end
|
44
|
+
#
|
45
|
+
def capture
|
46
|
+
require 'stringio'
|
47
|
+
orig_stdout = $stdout.dup
|
48
|
+
orig_stderr = $stderr.dup
|
49
|
+
captured_stdout = StringIO.new
|
50
|
+
captured_stderr = StringIO.new
|
51
|
+
$stdout = captured_stdout
|
52
|
+
$stderr = captured_stderr
|
53
|
+
yield
|
54
|
+
captured_stdout.rewind
|
55
|
+
captured_stderr.rewind
|
56
|
+
return captured_stdout.string, captured_stderr.string
|
57
|
+
ensure
|
58
|
+
$stdout = orig_stdout
|
59
|
+
$stderr = orig_stderr
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -163,6 +163,7 @@ That we in truth can nothing know!}
|
|
163
163
|
|
164
164
|
teardown do
|
165
165
|
assert FileUtils.rm_r(@tmp)
|
166
|
+
Dir.chdir '/' # Since we're removing the current directory, we should better not be in it
|
166
167
|
@tmp = Pathname.new Dir.mktmpdir
|
167
168
|
end
|
168
169
|
|
@@ -293,12 +294,30 @@ That we in truth can nothing know!}
|
|
293
294
|
setup do
|
294
295
|
Options.silent = true
|
295
296
|
Options.reveal = false
|
297
|
+
Options.online = true # Some tests need an uplink to the Internet. For now, we will hardcode here so that they should be executed.
|
298
|
+
Options.testmode = true # This puts us in test-mode, basically to prevent STDOUT and STDERR to show unnecessary output.
|
296
299
|
end
|
297
300
|
|
298
301
|
should "return a successfull CommandResult if the command was OK" do
|
299
302
|
assert_kind_of(CommandResult, result = Cmd.run('cd'))
|
303
|
+
assert_kind_of(Process::Status, result.status)
|
300
304
|
assert result.success?
|
301
305
|
end
|
306
|
+
|
307
|
+
should "not produce any output in :internal mode and in non-verbose mode" do
|
308
|
+
Options.testmode = false
|
309
|
+
out, err = capture do
|
310
|
+
assert_kind_of(CommandResult, result = Cmd.run('ls', :internal => true))
|
311
|
+
end
|
312
|
+
assert_equal '', out
|
313
|
+
end
|
314
|
+
|
315
|
+
should "should produce output in NON-:internal mode and in non-verbose mode" do
|
316
|
+
out, err = capture do
|
317
|
+
assert_kind_of(CommandResult, result = Cmd.run('which ls', :internal => false))
|
318
|
+
end
|
319
|
+
assert_equal('.', out)
|
320
|
+
end
|
302
321
|
|
303
322
|
should "return a non-successfull CommandResult if the command was bad without die_on_failure" do
|
304
323
|
assert_kind_of(CommandResult, result = Cmd.run('this-command-does-not-exist', :die_on_failure => false))
|
@@ -317,24 +336,19 @@ That we in truth can nothing know!}
|
|
317
336
|
Options.reveal = false
|
318
337
|
@tmp = Pathname.new Dir.mktmpdir
|
319
338
|
@dir = Pathname.new(File.join(@tmp, 'dummy'))
|
320
|
-
Dir.chdir @tmp # Since we're removing the directory in the teardown, we should better not be in it
|
321
339
|
end
|
322
340
|
|
323
341
|
teardown do
|
324
342
|
assert FileUtils.rm_r(@tmp)
|
343
|
+
Dir.chdir '/' # Since we're removing the current directory, we should better not be in it
|
325
344
|
end
|
326
|
-
|
327
|
-
should "not successfully download a non-existent git repository without die_on_failure" do
|
328
|
-
assert_kind_of(CommandResult, result = Cmd.git_clone('an invalid git repository', 'invalid_git_repository.git', @dir, :die_on_failure => false))
|
329
|
-
assert !result.success?
|
330
|
-
end
|
331
|
-
|
345
|
+
|
332
346
|
should "download a simple git repository" do
|
333
347
|
assert_kind_of(CommandResult, result = Cmd.git_clone('a sample git repository', DUMMY_GIT, @dir))
|
334
348
|
assert result.success?
|
335
349
|
assert @dir.directory?
|
336
350
|
assert File.exist?(File.join(@dir, 'dummy.txt'))
|
337
|
-
end
|
351
|
+
end if Options.online
|
338
352
|
|
339
353
|
should "do nothing at the destination in reveal mode" do
|
340
354
|
Options.reveal = true
|
data/test/helper.rb
CHANGED
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: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Technology Transfer Alliance Team
|
@@ -15,13 +15,14 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
19
|
-
default_executable:
|
18
|
+
date: 2010-07-28 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
22
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.
|
23
23
|
email: mtoday11@gmail.com
|
24
24
|
executables:
|
25
|
+
- tta
|
25
26
|
- ai
|
26
27
|
extensions: []
|
27
28
|
|
@@ -35,6 +36,7 @@ files:
|
|
35
36
|
- Rakefile
|
36
37
|
- VERSION
|
37
38
|
- bin/ai
|
39
|
+
- bin/tta
|
38
40
|
- csd.gemspec
|
39
41
|
- lib/csd.rb
|
40
42
|
- lib/csd/application.rb
|
@@ -74,6 +76,7 @@ files:
|
|
74
76
|
- lib/csd/vendor/active_support/inflector.rb
|
75
77
|
- lib/csd/vendor/term/GPL2-LICENSE
|
76
78
|
- lib/csd/vendor/term/ansicolor.rb
|
79
|
+
- lib/csd/vendor/zentest/zentest_assertions.rb
|
77
80
|
- lib/csd/version.rb
|
78
81
|
- test/application/test_minisip.rb
|
79
82
|
- test/functional/test_applications.rb
|
@@ -88,8 +91,8 @@ homepage: http://github.com/csd/csd
|
|
88
91
|
licenses: []
|
89
92
|
|
90
93
|
post_install_message: "\n\
|
91
|
-
|
92
|
-
|
94
|
+
============================================================\n\n Thank you for installing the TTA Automated Installer!\n\n You can run it by typing `tta\xC2\xB4 in your command line.\n\n NOTE: On DEBIAN and UBUNTU the executable `tta\xC2\xB4 is *maybe*\n not in your PATH by default. If that is the case,\n you can fix it by running this command:\n \n echo \"export PATH=\\$PATH:$(gem env | grep \"E D\" | sed \"s/[^\\w]* //\")\" >> ~/.bashrc;. ~/.bashrc\n \n\
|
95
|
+
============================================================\n "
|
93
96
|
rdoc_options:
|
94
97
|
- --charset=UTF-8
|
95
98
|
require_paths:
|