csd 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
data/csd.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{csd}
8
- s.version = "0.1.6"
8
+ s.version = "0.1.7"
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-20}
12
+ s.date = %q{2010-07-22}
13
13
  s.default_executable = %q{ai}
14
14
  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
15
  s.email = %q{mtoday11@gmail.com}
@@ -5,6 +5,16 @@ module CSD
5
5
  module Application
6
6
  module Minisip
7
7
  class Darwin < Unix
8
+
9
+ def compile!
10
+ Cmd.mkdir Path.work
11
+ #checkout_hdviper
12
+ #make_hdviper
13
+ checkout_minisip
14
+ modify_minisip
15
+ checkout_plugins
16
+ make_minisip
17
+ end
8
18
 
9
19
  end
10
20
  end
@@ -6,15 +6,19 @@ module CSD
6
6
  module Minisip
7
7
  class Debian < Linux
8
8
 
9
- # A list of apt-get packages that are required by this application.
9
+ # A list of apt-get packages that are required to compile minisip including hdviper and ffmpeg
10
10
  #
11
- DEBIAN_DEPENDENCIES = %w{ libxv-dev libssl-dev libgtkmm-2.4-dev libglademm-2.4-dev libsdl-dev git-core subversion automake libtool libltdl3-dev build-essential libavcodec-dev libswscale-dev libasound2-dev libsdl-ttf2.0-dev nasm yasm ffmpeg }
12
-
11
+ DEBIAN_DEPENDENCIES = %w{ automake build-essential ffmpeg git-core libasound2-dev libavcodec-dev libglademm-2.4-dev libgtkmm-2.4-dev libltdl3-dev libsdl-dev libsdl-ttf2.0-dev libssl-dev libswscale-dev libtool libxv-dev nasm subversion yasm }
12
+
13
13
  def compile!
14
14
  install_aptitude_dependencies if Options.apt_get
15
+ after_aptitude_dependencies
15
16
  super
16
17
  end
17
18
 
19
+ def after_aptitude_dependencies
20
+ end
21
+
18
22
  def package!
19
23
  modify_libminisip_rules
20
24
  super
@@ -22,9 +26,11 @@ module CSD
22
26
 
23
27
  def install_aptitude_dependencies
24
28
  Cmd.run("sudo apt-get update")
25
- DEBIAN_DEPENDENCIES.each do |apt|
26
- Cmd.run("sudo apt-get install #{apt} --yes --fix-missing")
27
- end
29
+ #DEBIAN_DEPENDENCIES.each do |apt|
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")
28
34
  end
29
35
 
30
36
  def modify_libminisip_rules
@@ -6,7 +6,7 @@ module CSD
6
6
  module Minisip
7
7
  class Ubuntu10 < Debian
8
8
 
9
- def compile!
9
+ def after_aptitude_dependencies
10
10
  fix_ubuntu_10_04
11
11
  exit if Options.only_fix_giomm
12
12
  super
data/lib/csd/commands.rb CHANGED
@@ -176,23 +176,24 @@ module CSD
176
176
  # [+:exit_on_failure+] If the exit code of the command was not 0, exit the CSD application (default: +true+).
177
177
  # [+:silent+] Don't show the command's output prints by any means (default: +false+).
178
178
  # [+:announce_pwd+] Before running the command, say in which path the command will be executed (default: +true+).
179
+ # [+:announce_cmd+] Before running the command, state the command to be executed. Used to overwrite the +silent+ parameter (default: +true+).
179
180
  # [+:verbose+] Instead of printing just one `.´ per command output line, print the original command output lines (default: +false+).
180
181
  #
181
182
  def run(cmd, params={})
182
- default_params = { :die_on_failure => true, :silent => false, :announce_pwd => true, :verbose => false }
183
+ default_params = { :die_on_failure => true, :silent => false, :announce_pwd => true, :announce_cmd => true, :verbose => false }
183
184
  params[:verbose] = true if Options.verbose
184
185
  params = default_params.merge(params)
185
186
  result = CommandResult.new
186
187
  cmd = cmd.to_s
187
- UI.error "The current working directory (aka 'pwd') could not be identified. It was probably deleted." and return unless pwd
188
+ UI.error "The current working directory (a.k.a. 'pwd') could not be identified. It was probably deleted." and return unless pwd
188
189
  UI.info "Running command in #{pwd}".yellow unless (!params[:announce_pwd] or params[:silent])
189
- UI.info cmd.cyan unless params[:silent]
190
+ UI.info cmd.cyan if (!params[:silent] or params[:announce_cmd])
190
191
  if Options.reveal
191
192
  result.success = true
192
193
  return result
193
194
  end
194
195
  result.output = ''
195
- $stderr.reopen '/dev/null' if params[:silent] # This prevents even output of error messages from the executed commands
196
+ #$stderr.reopen '/dev/null' if params[:silent] # This prevents even output of error messages from the executed commands
196
197
  IO.popen(cmd) do |stdout|
197
198
  stdout.each do |line|
198
199
  if params[:verbose]
@@ -204,6 +205,7 @@ module CSD
204
205
  result.output << line
205
206
  end
206
207
  end
208
+ #$stderr.reopen STDERR if params[:silent] # Setting the error output back to normal
207
209
  UI.separator if (!params[:silent] and !params[:verbose]) # i.e. if dots are outputted, we should create a new line after them
208
210
  result.success = $?.success?
209
211
  if params[:die_on_failure] and !result.success
@@ -240,20 +242,23 @@ module CSD
240
242
  # This command will not do anything if the destination already exists.
241
243
  #
242
244
  def git_clone(name, repository, destination, params={})
243
- default_params = { :announce_pwd => false, :silent => true }
245
+ default_params = { :die_on_failure => false, :announce_cmd => true, :announce_pwd => false, :silent => false }
244
246
  params = default_params.merge(params)
245
247
  result = CommandResult.new
246
248
  destination = destination.pathnamify
247
249
  # At this point we break off if the destination already exists, but in reveal-mode we want to continue.
248
- UI.warn "Skipping #{name} download, because the directory already exists: #{destination.enquote}" and return if (destination.directory? and !Options.reveal)
249
- if destination.parent.writable? or Options.reveal
250
- UI.info "Downloading #{name} to #{destination.enquote}".green.bold
251
- result.success = Cmd.run("git clone #{repository} #{destination} #{('--quiet' if params[:silent])}", params.merge({:die_on_failure => false})).success?
250
+ if (destination.directory? and !Options.reveal)
251
+ UI.warn "Skipping #{name} download, because the directory already exists: #{destination.enquote}"
252
252
  else
253
- UI.error "Could not download #{name} (no permission): #{destination.enquote}"
254
- result.success = false
253
+ if destination.parent.writable? or Options.reveal
254
+ UI.info "Downloading #{name} to #{destination.enquote}".green.bold
255
+ result.success = Cmd.run("git clone #{repository} #{destination} #{('--quiet' if params[:silent])}", params).success?
256
+ else
257
+ UI.error "Could not download #{name} (no permission): #{destination.enquote}"
258
+ result.success = false
259
+ end
260
+ result
255
261
  end
256
- result
257
262
  end
258
263
 
259
264
  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', :silent => true).output.chop if os == 'linux'
22
+ Cmd.run('uname --kernel-version', :silent => 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', :silent => true).output.chop if os == 'linux'
28
+ Cmd.run('uname --kernel-release', :silent => true).output.to_s.chop if os == 'linux'
29
29
  end
30
30
 
31
31
  end
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: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Technology Transfer Alliance Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-20 00:00:00 +02:00
18
+ date: 2010-07-22 00:00:00 +02:00
19
19
  default_executable: ai
20
20
  dependencies: []
21
21