csd 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -0,0 +1,175 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{csd}
8
+ s.version = "0.3.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Technology Transfer Alliance Team"]
12
+ s.date = %q{2010-09-10}
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.}
14
+ s.email = %q{mtoday11@gmail.com}
15
+ s.executables = ["ai", "ttai"]
16
+ s.extra_rdoc_files = [
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "COPYING",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "bin/ai",
27
+ "bin/ttai",
28
+ "csd.gemspec",
29
+ "lib/csd.rb",
30
+ "lib/csd/application.rb",
31
+ "lib/csd/application/decklink.rb",
32
+ "lib/csd/application/decklink/about.yml",
33
+ "lib/csd/application/decklink/base.rb",
34
+ "lib/csd/application/decklink/options/common.rb",
35
+ "lib/csd/application/decklink/options/common_defaults.rb",
36
+ "lib/csd/application/default.rb",
37
+ "lib/csd/application/default/base.rb",
38
+ "lib/csd/application/graphics.rb",
39
+ "lib/csd/application/graphics/about.yml",
40
+ "lib/csd/application/graphics/base.rb",
41
+ "lib/csd/application/graphics/error.rb",
42
+ "lib/csd/application/graphics/options/common.rb",
43
+ "lib/csd/application/graphics/options/common_defaults.rb",
44
+ "lib/csd/application/graphics/options/install.rb",
45
+ "lib/csd/application/graphics/options/install_defaults.rb",
46
+ "lib/csd/application/i2conf.rb",
47
+ "lib/csd/application/i2conf/about.yml",
48
+ "lib/csd/application/i2conf/base.rb",
49
+ "lib/csd/application/i2conf/config_example.rb",
50
+ "lib/csd/application/i2conf/options/common.rb",
51
+ "lib/csd/application/i2conf/options/common_defaults.rb",
52
+ "lib/csd/application/i2conf/options/install.rb",
53
+ "lib/csd/application/i2conf/options/install_defaults.rb",
54
+ "lib/csd/application/minisip.rb",
55
+ "lib/csd/application/minisip/about.yml",
56
+ "lib/csd/application/minisip/base.rb",
57
+ "lib/csd/application/minisip/component.rb",
58
+ "lib/csd/application/minisip/component/core.rb",
59
+ "lib/csd/application/minisip/component/core_packaging.rb",
60
+ "lib/csd/application/minisip/component/ffmpeg.rb",
61
+ "lib/csd/application/minisip/component/gnome.rb",
62
+ "lib/csd/application/minisip/component/hdviper.rb",
63
+ "lib/csd/application/minisip/component/network.rb",
64
+ "lib/csd/application/minisip/component/plugins.rb",
65
+ "lib/csd/application/minisip/component/x264.rb",
66
+ "lib/csd/application/minisip/error.rb",
67
+ "lib/csd/application/minisip/options/common.rb",
68
+ "lib/csd/application/minisip/options/common_defaults.rb",
69
+ "lib/csd/application/minisip/options/install.rb",
70
+ "lib/csd/application/minisip/options/install_defaults.rb",
71
+ "lib/csd/application/minisip/options/package.rb",
72
+ "lib/csd/application/minisip/options/package_defaults.rb",
73
+ "lib/csd/application/minisip/phonebook_example.rb",
74
+ "lib/csd/application/minisip/unix.rb",
75
+ "lib/csd/application/minisip/unix/darwin.rb",
76
+ "lib/csd/application/minisip/unix/linux.rb",
77
+ "lib/csd/application/minisip/unix/linux/debian.rb",
78
+ "lib/csd/application/minisip/unix/linux/debian/ubuntu10.rb",
79
+ "lib/csd/application/mslog.rb",
80
+ "lib/csd/application/mslog/about.yml",
81
+ "lib/csd/application/mslog/base.rb",
82
+ "lib/csd/application/mslog/options/common.rb",
83
+ "lib/csd/application/mslog/options/common_defaults.rb",
84
+ "lib/csd/applications.rb",
85
+ "lib/csd/commands.rb",
86
+ "lib/csd/container.rb",
87
+ "lib/csd/error.rb",
88
+ "lib/csd/extensions.rb",
89
+ "lib/csd/extensions/core/array.rb",
90
+ "lib/csd/extensions/core/dir.rb",
91
+ "lib/csd/extensions/core/kernel.rb",
92
+ "lib/csd/extensions/core/object.rb",
93
+ "lib/csd/extensions/core/open_struct.rb",
94
+ "lib/csd/extensions/core/option_parser.rb",
95
+ "lib/csd/extensions/core/pathname.rb",
96
+ "lib/csd/extensions/core/string.rb",
97
+ "lib/csd/extensions/gem/platform.rb",
98
+ "lib/csd/options_parser.rb",
99
+ "lib/csd/path_container.rb",
100
+ "lib/csd/user_interface.rb",
101
+ "lib/csd/user_interface/base.rb",
102
+ "lib/csd/user_interface/cli.rb",
103
+ "lib/csd/user_interface/silent.rb",
104
+ "lib/csd/vendor/active_support/MIT-LICENSE",
105
+ "lib/csd/vendor/active_support/inflector.rb",
106
+ "lib/csd/vendor/active_support/object_extensions.rb",
107
+ "lib/csd/vendor/term/GPL2-LICENSE",
108
+ "lib/csd/vendor/term/ansicolor.rb",
109
+ "lib/csd/vendor/zentest/zentest_assertions.rb",
110
+ "lib/csd/version.rb",
111
+ "test/application/test_minisip.rb",
112
+ "test/functional/test_application_base.rb",
113
+ "test/functional/test_application_default.rb",
114
+ "test/functional/test_applications.rb",
115
+ "test/functional/test_cli.rb",
116
+ "test/functional/test_commands.rb",
117
+ "test/functional/test_csd.rb",
118
+ "test/functional/test_options.rb",
119
+ "test/helper.rb",
120
+ "test/unit/test_container.rb",
121
+ "test/unit/test_dir.rb",
122
+ "test/unit/test_open_struct.rb",
123
+ "test/unit/test_pathname.rb",
124
+ "test/unit/test_platform.rb",
125
+ "test/unit/test_string.rb"
126
+ ]
127
+ s.homepage = %q{http://github.com/csd/csd}
128
+ s.post_install_message = %q{
129
+ ============================================================
130
+
131
+ Thank you for installing the TTA Automated Installer!
132
+
133
+ You can run it by typing `ai´ in your command line.
134
+
135
+ NOTE: On DEBIAN and UBUNTU the executable `ai´ is *maybe*
136
+ not in your PATH by default. If that is the case,
137
+ you can fix it by running this command:
138
+
139
+ echo "export PATH=\$PATH:$(gem env | grep "E D" | sed "s/[^\w]* //")" >> ~/.bashrc;. ~/.bashrc
140
+
141
+ ============================================================
142
+ }
143
+ s.rdoc_options = ["--charset=UTF-8"]
144
+ s.require_paths = ["lib"]
145
+ s.rubygems_version = %q{1.3.7}
146
+ s.summary = %q{Installation and compilation handler for software used in CSD projects.}
147
+ s.test_files = [
148
+ "test/application/test_minisip.rb",
149
+ "test/functional/test_application_base.rb",
150
+ "test/functional/test_application_default.rb",
151
+ "test/functional/test_applications.rb",
152
+ "test/functional/test_cli.rb",
153
+ "test/functional/test_commands.rb",
154
+ "test/functional/test_csd.rb",
155
+ "test/functional/test_options.rb",
156
+ "test/helper.rb",
157
+ "test/unit/test_container.rb",
158
+ "test/unit/test_dir.rb",
159
+ "test/unit/test_open_struct.rb",
160
+ "test/unit/test_pathname.rb",
161
+ "test/unit/test_platform.rb",
162
+ "test/unit/test_string.rb"
163
+ ]
164
+
165
+ if s.respond_to? :specification_version then
166
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
167
+ s.specification_version = 3
168
+
169
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
170
+ else
171
+ end
172
+ else
173
+ end
174
+ end
175
+
@@ -94,9 +94,11 @@ module CSD
94
94
  if Options.branch == 'master'
95
95
  # Before TTA made changes in the edge version, this was the location of the address book.
96
96
  # The master branch resembles the vendor's SVN branch. Whereas any other branch is made by TTA.
97
- Path.phonebook = Pathname.new(File.join(ENV['HOME'], '.minisip.addr'))
97
+ Path.phonebook_dir = Pathname.new(ENV['HOME'])
98
+ Path.phonebook = Pathname.new(File.join(Path.phonebook_dir, '.minisip.addr'))
98
99
  else
99
- Path.phonebook = Pathname.new(File.join(ENV['HOME'], '.minisip', 'minisip.addr'))
100
+ Path.phonebook_dir = Pathname.new(File.join(ENV['HOME'], '.minisip'))
101
+ Path.phonebook = Pathname.new(File.join(Path.phonebook_dir, 'minisip.addr'))
100
102
  end
101
103
  Path.build_bin = Pathname.new(File.join(Path.build, 'bin'))
102
104
  Path.build_gtkgui = Pathname.new(File.join(Path.build_bin, 'minisip_gtkgui'))
@@ -1,4 +1,5 @@
1
1
  # -*- encoding: UTF-8 -*-
2
+ require 'csd/application/minisip/component/core_packaging'
2
3
  require 'csd/application/minisip/component/core'
3
4
  require 'csd/application/minisip/component/ffmpeg'
4
5
  require 'csd/application/minisip/component/gnome'
@@ -38,6 +38,10 @@ module CSD
38
38
  create_address_book
39
39
  end
40
40
 
41
+ def package!
42
+ Packaging.package!
43
+ end
44
+
41
45
  def remove_ffmpeg
42
46
  ffmpeg_available = Cmd.run('ffmpeg -h', :internal => true, :die_on_failure => false).success?
43
47
  return if Options.ffmpeg_first or !libraries.include?('libminisip') or !ffmpeg_available
@@ -84,7 +88,9 @@ module CSD
84
88
  #
85
89
  def checkout
86
90
  Cmd.git_clone 'MiniSIP repository', 'http://github.com/csd/minisip.git', Path.repository
87
- if Options.branch
91
+ # Note that the command above will checkout the master branch.
92
+ # In that case we are not allowed to checkout the master branch again.
93
+ if Options.branch and Options.branch != 'master'
88
94
  Cmd.cd Path.repository, :internal => true
89
95
  Cmd.run "git checkout -b #{Options.branch} origin/#{Options.branch}"
90
96
  end
@@ -124,6 +130,16 @@ module CSD
124
130
  Cmd.replace Path.repository_avcoder_cxx, 'PIX_FMT_RGBA32', 'PIX_FMT_RGB32'
125
131
  Cmd.replace Path.repository_avdecoder_cxx, 'PIX_FMT_RGBA32', 'PIX_FMT_RGB32'
126
132
  end
133
+ modify_libminisip_rules
134
+ end
135
+
136
+ def modify_libminisip_rules
137
+ if Path.repository_libminisip_rules_backup.file?
138
+ 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."
139
+ else
140
+ Cmd.copy Path.repository_libminisip_rules, Path.repository_libminisip_rules_backup
141
+ Cmd.replace Path.repository_libminisip_rules, 'AUTOMATED_INSTALLER_PLACEHOLDER=""', [libminisip_cpp_flags, libminisip_ld_flags].join(' ')
142
+ end
127
143
  end
128
144
 
129
145
  # Usually, Ubuntu ignores <tt>/usr/local/share/aclocal</tt>. So we need to create a file called
@@ -258,72 +274,14 @@ module CSD
258
274
  end
259
275
  end
260
276
 
261
- def modify_libminisip_rules
262
- if Path.repository_libminisip_rules_backup.file?
263
- 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."
264
- else
265
- Cmd.copy Path.repository_libminisip_rules, Path.repository_libminisip_rules_backup
266
- Cmd.replace Path.repository_libminisip_rules, 'AUTOMATED_INSTALLER_PLACEHOLDER=""', [libminisip_cpp_flags, libminisip_ld_flags].join(' ')
267
- end
268
- end
269
-
270
277
  def create_address_book
271
278
  return unless !Path.phonebook.file? or ::CSD::Application::Minisip::OUTDATED_PHONEBOOKS.include?(File.read(Path.phonebook).hashed)
272
279
  UI.info "Creating default MiniSIP phonebook".green.bold
280
+ Cmd.mkdir Path.phonebook_dir
273
281
  Cmd.touch_and_replace_content Path.phonebook, ::CSD::Application::Minisip::PHONEBOOK_EXAMPLE, :internal => true
274
282
  UI.info " Phonebook successfully saved in #{Path.phonebook}".yellow
275
283
  end
276
284
 
277
- # Iteratively makes debian packages of the internal MiniSIP libraries.
278
- # TODO: Refactor this, it looks terribly sensitive.
279
- # TODO: Check for GPL and LGLP license conflicts.
280
- #
281
- def package!
282
- Cmd.mkdir(Path.packaging)
283
- libraries.each do |library|
284
- directory = Pathname.new(File.join(Path.repository, library))
285
- next if Options.only and !Options.only.include?(library)
286
- UI.info "Making #{library} with target dist".green.bold
287
- if Cmd.cd(directory) or Options.reveal
288
- Cmd.run("make dist")
289
-
290
- tar_filename = File.basename(Dir[File.join(directory, '*.tar.gz')].first)
291
- Cmd.move(File.join(directory, tar_filename.to_s), Path.packaging) if tar_filename or Options.reveal
292
-
293
- if Cmd.cd(Path.packaging) or Options.reveal
294
- Cmd.run("tar -xzf #{tar_filename}")
295
- tar_dirname = File.basename(tar_filename.to_s, '.tar.gz')
296
- if Cmd.cd(File.join(Path.packaging, tar_dirname))
297
- Cmd.run("dpkg-buildpackage -rfakeroot")
298
- if library == 'minisip'
299
- if Cmd.cd(Path.packaging)
300
- package = File.basename(Dir[File.join(Path.packaging, "#{library}*.deb")].first)
301
- Cmd.run("sudo dpkg -i #{package}") if package or Options.reveal
302
- end
303
- else
304
- if Cmd.cd(Path.packaging)
305
- package = File.basename(Dir[File.join(Path.packaging, "#{library}0*.deb")].first)
306
- Cmd.run("sudo dpkg -i #{package}") if package or Options.reveal
307
- dev_package = File.basename(Dir[File.join(Path.packaging, "#{library}-dev*.deb")].first)
308
- Cmd.run("sudo dpkg -i #{dev_package}") if dev_package or Options.reveal
309
- end
310
- end
311
- else
312
- UI.error "Could not enter #{File.join(Path.packaging, tar_dirname)}."
313
- end
314
-
315
- else
316
- UI.error "Could not enter #{Path.packaging}."
317
- end
318
-
319
- else
320
- UI.error "Could not enter #{directory}."
321
- end
322
- end
323
- Cmd.cd '/'
324
- Cmd.run('minisip_gtkgui')
325
- end
326
-
327
285
  end
328
286
  end
329
287
  end
@@ -0,0 +1,66 @@
1
+ # -*- encoding: UTF-8 -*-
2
+
3
+ module CSD
4
+ module Application
5
+ module Minisip
6
+ module Component
7
+ module Core
8
+ # This "outsourced" module is responsible for the packaging action. It would be too complex to
9
+ # have this mixed with the installing logic.
10
+ #
11
+ module Packaging
12
+
13
+ # Iteratively makes debian packages of the internal MiniSIP libraries.
14
+ # TODO: Refactor this, it looks terribly sensitive.
15
+ # TODO: Check for GPL and LGLP license conflicts.
16
+ #
17
+ def package!
18
+ Cmd.mkdir Path.packaging
19
+ libraries.each do |library|
20
+ directory = Pathname.new(File.join(Path.repository, library))
21
+ next if Options.only and !Options.only.include?(library)
22
+ UI.info "Making #{library} with target dist".green.bold
23
+ if Cmd.cd(directory) or Options.reveal
24
+ Cmd.run("make dist")
25
+
26
+ tar_filename = File.basename(Dir[File.join(directory, '*.tar.gz')].first)
27
+ Cmd.move(File.join(directory, tar_filename.to_s), Path.packaging) if tar_filename or Options.reveal
28
+
29
+ if Cmd.cd(Path.packaging) or Options.reveal
30
+ Cmd.run("tar -xzf #{tar_filename}")
31
+ tar_dirname = File.basename(tar_filename.to_s, '.tar.gz')
32
+ if Cmd.cd(File.join(Path.packaging, tar_dirname))
33
+ Cmd.run("dpkg-buildpackage -rfakeroot")
34
+ if library == 'minisip'
35
+ if Cmd.cd(Path.packaging)
36
+ package = File.basename(Dir[File.join(Path.packaging, "#{library}*.deb")].first)
37
+ Cmd.run("sudo dpkg -i #{package}") if package or Options.reveal
38
+ end
39
+ else
40
+ if Cmd.cd(Path.packaging)
41
+ package = File.basename(Dir[File.join(Path.packaging, "#{library}0*.deb")].first)
42
+ Cmd.run("sudo dpkg -i #{package}") if package or Options.reveal
43
+ dev_package = File.basename(Dir[File.join(Path.packaging, "#{library}-dev*.deb")].first)
44
+ Cmd.run("sudo dpkg -i #{dev_package}") if dev_package or Options.reveal
45
+ end
46
+ end
47
+ else
48
+ UI.error "Could not enter #{File.join(Path.packaging, tar_dirname)}."
49
+ end
50
+
51
+ else
52
+ UI.error "Could not enter #{Path.packaging}."
53
+ end
54
+
55
+ else
56
+ UI.error "Could not enter #{directory}."
57
+ end
58
+ end
59
+ end
60
+
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -8,7 +8,7 @@ module CSD
8
8
  #
9
9
  OUTDATED_PHONEBOOKS = [
10
10
  'ad51d1f3ec295dec000d9690bd1b7b801027c958', # This is the default MiniSIP phonebook
11
- '611e86dfbf82457d6137371884b8f56d224fbf59' # This is the AI-made phonebook up to version 0.3.1
11
+ '611e86dfbf82457d6137371884b8f56d224fbf59' # This is the AI-made phonebook up to (and including) version 0.3.1
12
12
  ]
13
13
 
14
14
  PHONEBOOK_EXAMPLE = %{
@@ -75,7 +75,7 @@ module CSD
75
75
  </name>
76
76
  <pop>
77
77
  <desc>
78
- Carenet-SE MCU
78
+ Carenet-SE
79
79
  </desc>
80
80
  <uri>
81
81
  mcu@carenet-se.se
@@ -83,7 +83,7 @@ module CSD
83
83
  </pop>
84
84
  <pop>
85
85
  <desc>
86
- CESNET MCU
86
+ CESNET
87
87
  </desc>
88
88
  <uri>
89
89
  950087999@cesnet.cz
@@ -91,7 +91,7 @@ module CSD
91
91
  </pop>
92
92
  <pop>
93
93
  <desc>
94
- TTA MCU
94
+ TTA
95
95
  </desc>
96
96
  <uri>
97
97
  ttamcu@carenet-se.se
@@ -21,7 +21,6 @@ module CSD
21
21
 
22
22
  def package!
23
23
  create_working_directory
24
- Core.modify_libminisip_rules # TODO: Oursource into Component::Core
25
24
  super
26
25
  end
27
26
 
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
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
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-09-09 00:00:00 +02:00
18
+ date: 2010-09-10 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -37,6 +37,7 @@ files:
37
37
  - VERSION
38
38
  - bin/ai
39
39
  - bin/ttai
40
+ - csd.gemspec
40
41
  - lib/csd.rb
41
42
  - lib/csd/application.rb
42
43
  - lib/csd/application/decklink.rb
@@ -67,6 +68,7 @@ files:
67
68
  - lib/csd/application/minisip/base.rb
68
69
  - lib/csd/application/minisip/component.rb
69
70
  - lib/csd/application/minisip/component/core.rb
71
+ - lib/csd/application/minisip/component/core_packaging.rb
70
72
  - lib/csd/application/minisip/component/ffmpeg.rb
71
73
  - lib/csd/application/minisip/component/gnome.rb
72
74
  - lib/csd/application/minisip/component/hdviper.rb