csd 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. data/COPYING +1 -2
  2. data/README.rdoc +7 -1
  3. data/Rakefile +7 -2
  4. data/VERSION +1 -1
  5. data/csd.gemspec +18 -216
  6. data/lib/csd.rb +6 -16
  7. data/lib/csd/application.rb +2 -2
  8. data/lib/csd/application/default.rb +15 -14
  9. data/lib/csd/application/default/base.rb +1 -1
  10. data/lib/csd/application/minisip.rb +43 -11
  11. data/lib/csd/application/minisip/about.yml +5 -5
  12. data/lib/csd/application/minisip/base.rb +82 -70
  13. data/lib/csd/application/minisip/error.rb +1 -1
  14. data/lib/csd/application/minisip/options/common.rb +1 -1
  15. data/lib/csd/application/minisip/options/compile.rb +1 -1
  16. data/lib/csd/application/minisip/options/package.rb +1 -1
  17. data/lib/csd/application/minisip/unix.rb +40 -27
  18. data/lib/csd/application/minisip/unix/darwin.rb +12 -0
  19. data/lib/csd/application/minisip/unix/linux.rb +1 -11
  20. data/lib/csd/application/minisip/unix/linux/debian.rb +14 -25
  21. data/lib/csd/application/minisip/unix/linux/debian/ubuntu10.rb +12 -13
  22. data/lib/csd/applications.rb +5 -5
  23. data/lib/csd/commands.rb +164 -89
  24. data/lib/csd/container.rb +61 -0
  25. data/lib/csd/error.rb +10 -1
  26. data/lib/csd/extensions.rb +3 -2
  27. data/lib/csd/extensions/core/array.rb +29 -1
  28. data/lib/csd/extensions/core/dir.rb +15 -24
  29. data/lib/csd/extensions/core/object.rb +10 -2
  30. data/lib/csd/extensions/core/option_parser.rb +22 -3
  31. data/lib/csd/extensions/core/pathname.rb +30 -2
  32. data/lib/csd/extensions/core/string.rb +51 -4
  33. data/lib/csd/extensions/gem/platform.rb +18 -3
  34. data/lib/csd/{options.rb → options_parser.rb} +16 -20
  35. data/lib/csd/path_container.rb +24 -0
  36. data/lib/csd/user_interface.rb +2 -0
  37. data/lib/csd/user_interface/base.rb +26 -0
  38. data/lib/csd/user_interface/cli.rb +37 -0
  39. data/lib/csd/vendor/active_support/MIT-LICENSE +20 -0
  40. data/lib/csd/vendor/active_support/inflector.rb +155 -0
  41. data/lib/csd/vendor/term/GPL2-LICENSE +339 -0
  42. data/lib/csd/vendor/term/ansicolor.rb +113 -0
  43. data/lib/csd/version.rb +13 -4
  44. data/test/application/test_minisip.rb +45 -0
  45. data/test/functional/test_applications.rb +10 -16
  46. data/test/functional/test_commands.rb +260 -23
  47. data/test/unit/test_string.rb +1 -1
  48. metadata +18 -216
  49. data/lib/active_support.rb +0 -75
  50. data/lib/active_support/all.rb +0 -3
  51. data/lib/active_support/backtrace_cleaner.rb +0 -94
  52. data/lib/active_support/base64.rb +0 -42
  53. data/lib/active_support/basic_object.rb +0 -21
  54. data/lib/active_support/benchmarkable.rb +0 -60
  55. data/lib/active_support/buffered_logger.rb +0 -132
  56. data/lib/active_support/builder.rb +0 -6
  57. data/lib/active_support/cache.rb +0 -626
  58. data/lib/active_support/cache/compressed_mem_cache_store.rb +0 -13
  59. data/lib/active_support/cache/file_store.rb +0 -188
  60. data/lib/active_support/cache/mem_cache_store.rb +0 -191
  61. data/lib/active_support/cache/memory_store.rb +0 -159
  62. data/lib/active_support/cache/strategy/local_cache.rb +0 -164
  63. data/lib/active_support/cache/synchronized_memory_store.rb +0 -11
  64. data/lib/active_support/callbacks.rb +0 -600
  65. data/lib/active_support/concern.rb +0 -29
  66. data/lib/active_support/configurable.rb +0 -36
  67. data/lib/active_support/core_ext.rb +0 -3
  68. data/lib/active_support/core_ext/array.rb +0 -7
  69. data/lib/active_support/core_ext/array/access.rb +0 -46
  70. data/lib/active_support/core_ext/array/conversions.rb +0 -164
  71. data/lib/active_support/core_ext/array/extract_options.rb +0 -29
  72. data/lib/active_support/core_ext/array/grouping.rb +0 -100
  73. data/lib/active_support/core_ext/array/random_access.rb +0 -20
  74. data/lib/active_support/core_ext/array/uniq_by.rb +0 -17
  75. data/lib/active_support/core_ext/array/wrap.rb +0 -22
  76. data/lib/active_support/core_ext/benchmark.rb +0 -7
  77. data/lib/active_support/core_ext/big_decimal.rb +0 -1
  78. data/lib/active_support/core_ext/big_decimal/conversions.rb +0 -27
  79. data/lib/active_support/core_ext/cgi.rb +0 -1
  80. data/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +0 -19
  81. data/lib/active_support/core_ext/class.rb +0 -4
  82. data/lib/active_support/core_ext/class/attribute.rb +0 -67
  83. data/lib/active_support/core_ext/class/attribute_accessors.rb +0 -63
  84. data/lib/active_support/core_ext/class/delegating_attributes.rb +0 -44
  85. data/lib/active_support/core_ext/class/inheritable_attributes.rb +0 -232
  86. data/lib/active_support/core_ext/class/subclasses.rb +0 -55
  87. data/lib/active_support/core_ext/date/acts_like.rb +0 -8
  88. data/lib/active_support/core_ext/date/calculations.rb +0 -240
  89. data/lib/active_support/core_ext/date/conversions.rb +0 -99
  90. data/lib/active_support/core_ext/date/freeze.rb +0 -31
  91. data/lib/active_support/core_ext/date_time/acts_like.rb +0 -13
  92. data/lib/active_support/core_ext/date_time/calculations.rb +0 -113
  93. data/lib/active_support/core_ext/date_time/conversions.rb +0 -102
  94. data/lib/active_support/core_ext/date_time/zones.rb +0 -17
  95. data/lib/active_support/core_ext/enumerable.rb +0 -119
  96. data/lib/active_support/core_ext/exception.rb +0 -3
  97. data/lib/active_support/core_ext/file.rb +0 -2
  98. data/lib/active_support/core_ext/file/atomic.rb +0 -41
  99. data/lib/active_support/core_ext/file/path.rb +0 -5
  100. data/lib/active_support/core_ext/float.rb +0 -1
  101. data/lib/active_support/core_ext/float/rounding.rb +0 -19
  102. data/lib/active_support/core_ext/hash.rb +0 -8
  103. data/lib/active_support/core_ext/hash/conversions.rb +0 -150
  104. data/lib/active_support/core_ext/hash/deep_merge.rb +0 -16
  105. data/lib/active_support/core_ext/hash/diff.rb +0 -13
  106. data/lib/active_support/core_ext/hash/except.rb +0 -24
  107. data/lib/active_support/core_ext/hash/indifferent_access.rb +0 -14
  108. data/lib/active_support/core_ext/hash/keys.rb +0 -45
  109. data/lib/active_support/core_ext/hash/reverse_merge.rb +0 -28
  110. data/lib/active_support/core_ext/hash/slice.rb +0 -38
  111. data/lib/active_support/core_ext/integer.rb +0 -3
  112. data/lib/active_support/core_ext/integer/inflections.rb +0 -14
  113. data/lib/active_support/core_ext/integer/multiple.rb +0 -6
  114. data/lib/active_support/core_ext/integer/time.rb +0 -39
  115. data/lib/active_support/core_ext/kernel.rb +0 -5
  116. data/lib/active_support/core_ext/kernel/agnostics.rb +0 -11
  117. data/lib/active_support/core_ext/kernel/debugger.rb +0 -16
  118. data/lib/active_support/core_ext/kernel/reporting.rb +0 -62
  119. data/lib/active_support/core_ext/kernel/requires.rb +0 -26
  120. data/lib/active_support/core_ext/kernel/singleton_class.rb +0 -13
  121. data/lib/active_support/core_ext/load_error.rb +0 -23
  122. data/lib/active_support/core_ext/logger.rb +0 -146
  123. data/lib/active_support/core_ext/module.rb +0 -12
  124. data/lib/active_support/core_ext/module/aliasing.rb +0 -70
  125. data/lib/active_support/core_ext/module/anonymous.rb +0 -24
  126. data/lib/active_support/core_ext/module/attr_accessor_with_default.rb +0 -31
  127. data/lib/active_support/core_ext/module/attr_internal.rb +0 -32
  128. data/lib/active_support/core_ext/module/attribute_accessors.rb +0 -66
  129. data/lib/active_support/core_ext/module/delegation.rb +0 -146
  130. data/lib/active_support/core_ext/module/deprecation.rb +0 -9
  131. data/lib/active_support/core_ext/module/introspection.rb +0 -88
  132. data/lib/active_support/core_ext/module/method_names.rb +0 -14
  133. data/lib/active_support/core_ext/module/reachable.rb +0 -10
  134. data/lib/active_support/core_ext/module/remove_method.rb +0 -6
  135. data/lib/active_support/core_ext/module/synchronization.rb +0 -42
  136. data/lib/active_support/core_ext/name_error.rb +0 -18
  137. data/lib/active_support/core_ext/numeric.rb +0 -2
  138. data/lib/active_support/core_ext/numeric/bytes.rb +0 -44
  139. data/lib/active_support/core_ext/numeric/time.rb +0 -77
  140. data/lib/active_support/core_ext/object.rb +0 -14
  141. data/lib/active_support/core_ext/object/acts_like.rb +0 -10
  142. data/lib/active_support/core_ext/object/blank.rb +0 -76
  143. data/lib/active_support/core_ext/object/conversions.rb +0 -4
  144. data/lib/active_support/core_ext/object/duplicable.rb +0 -65
  145. data/lib/active_support/core_ext/object/extending.rb +0 -11
  146. data/lib/active_support/core_ext/object/instance_variables.rb +0 -67
  147. data/lib/active_support/core_ext/object/misc.rb +0 -2
  148. data/lib/active_support/core_ext/object/returning.rb +0 -42
  149. data/lib/active_support/core_ext/object/to_param.rb +0 -49
  150. data/lib/active_support/core_ext/object/to_query.rb +0 -27
  151. data/lib/active_support/core_ext/object/try.rb +0 -36
  152. data/lib/active_support/core_ext/object/with_options.rb +0 -26
  153. data/lib/active_support/core_ext/proc.rb +0 -14
  154. data/lib/active_support/core_ext/process.rb +0 -1
  155. data/lib/active_support/core_ext/process/daemon.rb +0 -23
  156. data/lib/active_support/core_ext/range.rb +0 -4
  157. data/lib/active_support/core_ext/range/blockless_step.rb +0 -29
  158. data/lib/active_support/core_ext/range/conversions.rb +0 -21
  159. data/lib/active_support/core_ext/range/include_range.rb +0 -21
  160. data/lib/active_support/core_ext/range/overlaps.rb +0 -8
  161. data/lib/active_support/core_ext/regexp.rb +0 -5
  162. data/lib/active_support/core_ext/rexml.rb +0 -46
  163. data/lib/active_support/core_ext/string.rb +0 -12
  164. data/lib/active_support/core_ext/string/access.rb +0 -99
  165. data/lib/active_support/core_ext/string/behavior.rb +0 -7
  166. data/lib/active_support/core_ext/string/conversions.rb +0 -61
  167. data/lib/active_support/core_ext/string/encoding.rb +0 -11
  168. data/lib/active_support/core_ext/string/exclude.rb +0 -6
  169. data/lib/active_support/core_ext/string/filters.rb +0 -49
  170. data/lib/active_support/core_ext/string/inflections.rb +0 -149
  171. data/lib/active_support/core_ext/string/interpolation.rb +0 -2
  172. data/lib/active_support/core_ext/string/multibyte.rb +0 -72
  173. data/lib/active_support/core_ext/string/output_safety.rb +0 -109
  174. data/lib/active_support/core_ext/string/starts_ends_with.rb +0 -4
  175. data/lib/active_support/core_ext/string/xchar.rb +0 -18
  176. data/lib/active_support/core_ext/time/acts_like.rb +0 -8
  177. data/lib/active_support/core_ext/time/calculations.rb +0 -282
  178. data/lib/active_support/core_ext/time/conversions.rb +0 -85
  179. data/lib/active_support/core_ext/time/marshal.rb +0 -56
  180. data/lib/active_support/core_ext/time/publicize_conversion_methods.rb +0 -10
  181. data/lib/active_support/core_ext/time/zones.rb +0 -78
  182. data/lib/active_support/core_ext/uri.rb +0 -22
  183. data/lib/active_support/dependencies.rb +0 -628
  184. data/lib/active_support/dependencies/autoload.rb +0 -50
  185. data/lib/active_support/deprecation.rb +0 -18
  186. data/lib/active_support/deprecation/behaviors.rb +0 -38
  187. data/lib/active_support/deprecation/method_wrappers.rb +0 -29
  188. data/lib/active_support/deprecation/proxy_wrappers.rb +0 -74
  189. data/lib/active_support/deprecation/reporting.rb +0 -56
  190. data/lib/active_support/duration.rb +0 -105
  191. data/lib/active_support/gzip.rb +0 -25
  192. data/lib/active_support/hash_with_indifferent_access.rb +0 -145
  193. data/lib/active_support/i18n.rb +0 -8
  194. data/lib/active_support/inflections.rb +0 -56
  195. data/lib/active_support/inflector.rb +0 -7
  196. data/lib/active_support/inflector/inflections.rb +0 -211
  197. data/lib/active_support/inflector/methods.rb +0 -141
  198. data/lib/active_support/inflector/transliterate.rb +0 -97
  199. data/lib/active_support/json.rb +0 -2
  200. data/lib/active_support/json/backends/jsongem.rb +0 -43
  201. data/lib/active_support/json/backends/yajl.rb +0 -40
  202. data/lib/active_support/json/backends/yaml.rb +0 -90
  203. data/lib/active_support/json/decoding.rb +0 -51
  204. data/lib/active_support/json/encoding.rb +0 -254
  205. data/lib/active_support/json/variable.rb +0 -11
  206. data/lib/active_support/lazy_load_hooks.rb +0 -27
  207. data/lib/active_support/locale/en.yml +0 -36
  208. data/lib/active_support/memoizable.rb +0 -103
  209. data/lib/active_support/message_encryptor.rb +0 -71
  210. data/lib/active_support/message_verifier.rb +0 -62
  211. data/lib/active_support/multibyte.rb +0 -44
  212. data/lib/active_support/multibyte/chars.rb +0 -480
  213. data/lib/active_support/multibyte/exceptions.rb +0 -8
  214. data/lib/active_support/multibyte/unicode.rb +0 -393
  215. data/lib/active_support/multibyte/utils.rb +0 -60
  216. data/lib/active_support/notifications.rb +0 -81
  217. data/lib/active_support/notifications/fanout.rb +0 -93
  218. data/lib/active_support/notifications/instrumenter.rb +0 -56
  219. data/lib/active_support/option_merger.rb +0 -25
  220. data/lib/active_support/ordered_hash.rb +0 -158
  221. data/lib/active_support/ordered_options.rb +0 -27
  222. data/lib/active_support/railtie.rb +0 -100
  223. data/lib/active_support/rescuable.rb +0 -114
  224. data/lib/active_support/ruby/shim.rb +0 -22
  225. data/lib/active_support/secure_random.rb +0 -199
  226. data/lib/active_support/string_inquirer.rb +0 -21
  227. data/lib/active_support/test_case.rb +0 -42
  228. data/lib/active_support/testing/assertions.rb +0 -82
  229. data/lib/active_support/testing/declarative.rb +0 -40
  230. data/lib/active_support/testing/default.rb +0 -9
  231. data/lib/active_support/testing/deprecation.rb +0 -55
  232. data/lib/active_support/testing/isolation.rb +0 -154
  233. data/lib/active_support/testing/pending.rb +0 -48
  234. data/lib/active_support/testing/performance.rb +0 -455
  235. data/lib/active_support/testing/setup_and_teardown.rb +0 -111
  236. data/lib/active_support/time.rb +0 -34
  237. data/lib/active_support/time/autoload.rb +0 -5
  238. data/lib/active_support/time_with_zone.rb +0 -341
  239. data/lib/active_support/values/time_zone.rb +0 -377
  240. data/lib/active_support/values/unicode_tables.dat +0 -0
  241. data/lib/active_support/version.rb +0 -10
  242. data/lib/active_support/whiny_nil.rb +0 -60
  243. data/lib/active_support/xml_mini.rb +0 -158
  244. data/lib/active_support/xml_mini/jdom.rb +0 -168
  245. data/lib/active_support/xml_mini/libxml.rb +0 -80
  246. data/lib/active_support/xml_mini/libxmlsax.rb +0 -85
  247. data/lib/active_support/xml_mini/nokogiri.rb +0 -78
  248. data/lib/active_support/xml_mini/nokogirisax.rb +0 -83
  249. data/lib/active_support/xml_mini/rexml.rb +0 -129
  250. data/lib/csd/extensions/core/file.rb +0 -14
  251. data/lib/csd/global_open_struct.rb +0 -19
  252. data/lib/csd/path.rb +0 -32
  253. data/lib/csd/ui.rb +0 -2
  254. data/lib/csd/ui/cli.rb +0 -8
  255. data/lib/csd/ui/ui.rb +0 -45
  256. data/lib/term/ansicolor.rb +0 -102
  257. data/lib/term/ansicolor/.keep +0 -0
  258. data/lib/term/ansicolor/version.rb +0 -10
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # -*- encoding: UTF-8 -*-
2
2
  require 'tmpdir'
3
3
 
4
4
  module CSD
@@ -1,31 +1,63 @@
1
- # encoding: utf-8
1
+ # -*- encoding: UTF-8 -*-
2
2
  require 'ostruct'
3
- require File.join(File.dirname(__FILE__), 'default')
4
- require File.join(File.dirname(__FILE__), 'minisip', 'error')
5
- require File.join(File.dirname(__FILE__), 'minisip', 'base')
6
- require File.join(File.dirname(__FILE__), 'minisip', 'unix', 'linux', 'debian', 'ubuntu10')
3
+ require 'csd/application/default'
4
+ require 'csd/application/minisip/error'
5
+ require 'csd/application/minisip/base'
6
+ require 'csd/application/minisip/unix'
7
+ require 'csd/application/minisip/unix/darwin'
8
+ require 'csd/application/minisip/unix/linux'
9
+ require 'csd/application/minisip/unix/linux/debian'
10
+ require 'csd/application/minisip/unix/linux/debian/ubuntu10'
7
11
 
8
12
  module CSD
9
13
  module Application
14
+ # This is the Application Module for MiniSIP, an open-source high-definition video conferencing client.
15
+ #
10
16
  module Minisip
11
17
  class << self
12
-
18
+
13
19
  include CSD::Application::Default
14
-
20
+
21
+ # This method will check which operating system we're on and initialize the correct sub-module
22
+ # (see http://github.com/rubygems/rubygems/blob/master/lib/rubygems/platform.rb#L65 for supported
23
+ # platform identifiers).
24
+ #
25
+ # Currently these platforms can generally exist:
26
+ # * +cygwin+ (a Linux-like environment for Windows)
27
+ # * +darwin+ (Mac OS X)
28
+ # * +freebsd+
29
+ # * +hpux+ (Hewlett Packard UniX)
30
+ # * +java+
31
+ # * +dotnet+
32
+ # * +linux+ (Debian, OpenSUSE, Ubuntu, Red Hat, Fedora...)
33
+ # * +mingw32+ (Minimalist GNU for Windows)
34
+ # * +mswin*+ (Microsoft Windows, e.g. +mswin32+, +mswin64+)
35
+ # * +netbsdelf+
36
+ # * +openbsd+
37
+ # * +solaris+
38
+ # * +unknown+
39
+ #
15
40
  def instance
16
41
  @instance ||= case Gem::Platform.local.os
42
+
43
+ when 'darwin'
44
+ Darwin.new
45
+
17
46
  when 'linux'
18
- UI.debug "Analyzing kernel version: #{Gem::Platform.local.kernel_version}"
19
- case Gem::Platform.local.kernel_version
20
- when /(36-Ubuntu)|(37-Ubuntu)/
47
+ UI.debug "Analyzing Linux kernel release: #{Gem::Platform.local.kernel_release}"
48
+ case Gem::Platform.local.kernel_release
49
+
50
+ when '2.6.32-21-generic', '2.6.32-22-generic'
21
51
  UI.debug "Ubuntu 10.04 identified"
22
52
  Ubuntu10.new
53
+
23
54
  else
24
55
  UI.debug "Debian identified"
25
56
  Debian.new
26
57
  end
58
+
27
59
  else
28
- UI.debug "Nothing identified"
60
+ UI.debug "This Operating System is not supported."
29
61
  Base.new
30
62
  end
31
63
  end
@@ -1,14 +1,14 @@
1
1
  human: MiniSIP
2
2
  description: An open-source SIP client for high-definition video conferencing.
3
3
  actions:
4
- :public:
4
+ public:
5
5
  #- show: Shows further information about MiniSIP
6
- - download: Downloads MiniSIP components (e.g. source code, configurations, docs,...)
7
- #- install: Installs an application
8
- #- check: Checks whether the environment dependencies for the application are satisfied
9
- :developer:
6
+ #- download: Downloads MiniSIP components (e.g. source code, configurations, docs,...)
10
7
  - compile: Downloads and compiles MiniSIP from scratch
11
8
  - package: Downloads, compiles and packages MiniSIP from scratch
9
+ #- install: Installs an application
10
+ #- check: Checks whether the environment dependencies for the application are satisfied
11
+ developer:
12
12
  #- publish: Submits a compiled package to the CSD package repository
13
13
  scopes:
14
14
  --- {}
@@ -1,100 +1,112 @@
1
- # encoding: utf-8
2
- require File.join(File.dirname(__FILE__), '..', 'default', 'base')
1
+ # -*- encoding: UTF-8 -*-
2
+ require 'csd/application/default/base'
3
3
 
4
4
  module CSD
5
5
  module Application
6
6
  module Minisip
7
7
  class Base < CSD::Application::Base
8
8
 
9
- LIBRARIES = %w{ libmutil libmnetutil libmcrypto libmikey libmsip libmstun libminisip minisip } unless defined?(LIBRARIES)
10
-
11
- def package
9
+ LIBRARIES = %w{ libmutil libmnetutil libmcrypto libmikey libmsip libmstun libminisip minisip }
10
+
11
+ # MAIN APPLICATION OPERATIONS
12
+
13
+ def compile
12
14
  UI.error 'Currently not supported for this platform. Sorry.'
13
15
  end
14
16
 
15
- def compile
17
+ def package
16
18
  UI.error 'Currently not supported for this platform. Sorry.'
17
19
  end
18
20
 
19
- def define_root_path
20
- if Options.path
21
- if File.directory?(Options.path)
22
- Path.root = File.expand_path(Options.path)
23
- else
24
- raise Error::Options::PathNotFound, "The path `#{Options.path}´ doesn't exist."
25
- end
21
+ # GENERAL USER INFORMATION
22
+
23
+ def introduction
24
+ define_root_path
25
+ define_paths
26
+ UI.separator
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
+ UI.separator
31
+ if Options.help
32
+ UI.info Options.helptext
33
+ abort
26
34
  else
27
- Path.root = Options.temp ? Dir.mktmpdir : Dir.pwd
35
+ raise(Interrupt) unless (Options.yes or UI.ask_yes_no("Continue?".red.bold, true))
28
36
  end
29
37
  end
30
38
 
31
- def define_paths
32
- Path.work = Pathname.new(File.join(Path.root, 'minisip'))
33
- Path.repository = Pathname.new(File.join(Path.work, 'repository'))
34
- Path.plugins = Pathname.new(File.join(Path.work, 'plugins'))
35
- Path.packaging = Pathname.new(File.join(Path.work, 'packaging'))
36
- Path.open_gl_display = Pathname.new(File.join(Path.repository, 'libminisip', 'source', 'subsystem_media', 'video', 'display', 'OpenGLDisplay.cxx'))
37
- Path.hdviper = Pathname.new(File.join(Path.work, 'hdviper'))
38
- Path.hdviper_x264 = Pathname.new(File.join(Path.hdviper, 'x264'))
39
- Path.hdviper_x264_test_x264api = Pathname.new(File.join(Path.hdviper_x264, 'test', 'x264API'))
40
- Path.build = Pathname.new(File.join(Path.work, 'build'))
41
- Path.build_bin = Pathname.new(File.join(Path.build, 'bin'))
42
- Path.build_gtkgui = Pathname.new(File.join(Path.build_bin, 'minisip_gtkgui'))
43
- Path.build_include = Pathname.new(File.join(Path.build, 'include'))
44
- Path.build_lib = Pathname.new(File.join(Path.build, 'lib'))
45
- Path.build_lib_pkg_config = Pathname.new(File.join(Path.build_lib, 'pkgconfig'))
46
- Path.build_share = Pathname.new(File.join(Path.build, 'share'))
47
- Path.build_share_aclocal = Pathname.new(File.join(Path.build_share, 'aclocal'))
48
- Path.giomm_header = Pathname.new(File.join('/', 'usr', 'include', 'giomm-2.4', 'giomm.h'))
49
- end
39
+ # CROSS-PLATFORM TASKS
50
40
 
51
- def checkout_minisip # TODO: Refactor because redudancy with checkout_hdviper
52
- if Path.repository.directory?
53
- UI.warn "Skipping repository download, because the directory already exists: #{Path.repository}"
54
- else
55
- if Path.repository.parent.writable? or Options.dry
56
- UI.info "Downloading minisip repository to: #{Path.repository}".green.bold
57
- Cmd.run("git clone http://github.com/csd/minisip.git #{Path.repository}")
58
- # Fixing hard-coded stuff
59
- Cmd.replace(Path.open_gl_display, '/home/erik', Path.build)
60
- else
61
- UI.error "Could not download minisip repository (no permission): #{Path.repository}"
62
- end
63
- end
41
+ def libraries
42
+ Options.only ? LIBRARIES.map { |lib| lib if Options.only.to_a.include?(lib) }.compact : LIBRARIES
64
43
  end
65
44
 
66
- def checkout_plugins # TODO: Refactor because redudancy with checkout_hdviper
67
- if Path.plugins.directory?
68
- UI.warn "Skipping plugins download, because the directory already exists: #{Path.plugins}"
69
- else
70
- if Path.plugins.parent.writable? or Options.dry
71
- UI.info "Downloading minisip plugins to: #{Path.plugins}".green.bold
72
- Cmd.run("git clone http://github.com/csd/minisip-plugins.git #{Path.plugins}")
73
- else
74
- UI.error "Could not download minisip plugins (no permission): #{Path.plugins}"
75
- end
76
- end
45
+ def checkout_minisip
46
+ Cmd.git_clone('MiniSIP repository', 'http://github.com/csd/minisip.git', Path.repository)
77
47
  end
78
48
 
49
+ def modify_minisip
50
+ Cmd.replace(Path.repository_open_gl_display, '/home/erik', Path.build)
51
+ end
52
+
53
+ def checkout_plugins
54
+ Cmd.git_clone('additional MiniSIP plugins', 'http://github.com/csd/minisip-plugins.git', Path.plugins)
55
+ end
56
+
79
57
  def checkout_hdviper
80
- if Path.hdviper.directory?
81
- UI.warn "Skipping hdviper, because the directory already exists: #{Path.hdviper}"
82
- else
83
- if Path.hdviper.parent.writable? or Options.dry
84
- UI.info "Downloading hdviper to: #{Path.hdviper}".green.bold
85
- Cmd.run("git clone http://github.com/csd/libraries.git #{Path.hdviper}")
86
- #Cmd.run("svn co --quiet svn://hdviper.org/hdviper/wp3/src #{Path.hdviper}")
87
- return true
58
+ Cmd.git_clone('HDVIPER', 'http://github.com/csd/libraries.git', Path.hdviper)
59
+ end
60
+
61
+ # CROSS-PLATFORM INFORMATION
62
+
63
+ def cpp_flags
64
+ "CPPFLAGS=\"-I#{Path.hdviper_x264} -I#{Path.hdviper_x264_test_x264api} -I#{Path.repository_grabber} -I#{Path.repository_decklinksdk}\""
65
+ end
66
+
67
+ def ld_flags
68
+ "LDFLAGS=\"#{Path.hdviper_libx264api} #{Path.hdviper_libtidx264} -lpthread -lrt\""
69
+ end
70
+
71
+ # DEFINING PATHS ETC...
72
+
73
+ def define_root_path
74
+ if Options.path
75
+ if File.directory?(Options.path)
76
+ Path.root = File.expand_path(Options.path)
88
77
  else
89
- UI.error "Could not download hdviper (no permission): #{Path.hdviper}"
78
+ raise Error::Options::PathNotFound, "The path `#{Options.path}´ doesn't exist."
90
79
  end
80
+ else
81
+ Path.root = Options.temp ? Dir.mktmpdir : Dir.pwd
91
82
  end
92
83
  end
93
84
 
94
- def before_compile
95
- end
96
-
97
- def after_compile
85
+ def define_paths
86
+ Path.work = Pathname.new(File.join(Path.root, 'minisip'))
87
+ Path.giomm_header = Pathname.new(File.join('/', 'usr', 'include', 'giomm-2.4', 'giomm.h'))
88
+ Path.giomm_header_backup = Pathname.new(File.join('/', 'usr', 'include', 'giomm-2.4', 'giomm.h.ai-backup'))
89
+ Path.repository = Pathname.new(File.join(Path.work, 'repository'))
90
+ Path.repository_libminisip_rules = Pathname.new(File.join(Path.repository, 'libminisip', 'debian', 'rules'))
91
+ Path.repository_libminisip_rules_backup = Pathname.new(File.join(Path.repository, 'libminisip', 'debian', 'rules.ai-backup'))
92
+ Path.repository_grabber = Pathname.new(File.join(Path.repository, 'libminisip', 'source', 'subsystem_media', 'video', 'grabber'))
93
+ Path.repository_open_gl_display = Pathname.new(File.join(Path.repository, 'libminisip', 'source', 'subsystem_media', 'video', 'display', 'OpenGLDisplay.cxx'))
94
+ Path.repository_decklinksdk = Pathname.new(File.join(Path.repository_grabber, 'decklinksdk'))
95
+ Path.plugins = Pathname.new(File.join(Path.work, 'plugins'))
96
+ Path.packaging = Pathname.new(File.join(Path.work, 'packaging'))
97
+ Path.hdviper = Pathname.new(File.join(Path.work, 'hdviper'))
98
+ Path.hdviper_x264 = Pathname.new(File.join(Path.hdviper, 'x264'))
99
+ Path.hdviper_libtidx264 = Pathname.new(File.join(Path.hdviper_x264, 'libtidx264.a'))
100
+ Path.hdviper_x264_test_x264api = Pathname.new(File.join(Path.hdviper_x264, 'test', 'x264API'))
101
+ Path.hdviper_libx264api = Pathname.new(File.join(Path.hdviper_x264_test_x264api, 'libx264api.a'))
102
+ Path.build = Pathname.new(File.join(Path.work, 'build'))
103
+ Path.build_bin = Pathname.new(File.join(Path.build, 'bin'))
104
+ Path.build_gtkgui = Pathname.new(File.join(Path.build_bin, 'minisip_gtkgui'))
105
+ Path.build_include = Pathname.new(File.join(Path.build, 'include'))
106
+ Path.build_lib = Pathname.new(File.join(Path.build, 'lib'))
107
+ Path.build_lib_pkg_config = Pathname.new(File.join(Path.build_lib, 'pkgconfig'))
108
+ Path.build_share = Pathname.new(File.join(Path.build, 'share'))
109
+ Path.build_share_aclocal = Pathname.new(File.join(Path.build_share, 'aclocal'))
98
110
  end
99
111
 
100
112
  end
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # -*- encoding: UTF-8 -*-
2
2
  require File.join(File.dirname(__FILE__), '..', '..', 'error')
3
3
 
4
4
  module CSD
@@ -1 +1 @@
1
- # encoding: utf-8
1
+ # -*- encoding: UTF-8 -*-
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # -*- encoding: UTF-8 -*-
2
2
  # This file gets eval'ed by the global options parser in lib/csd/rb
3
3
  # TODO: There must be a nicer solution for this.
4
4
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # -*- encoding: UTF-8 -*-
2
2
  # This file gets eval'ed by the global options parser in lib/csd/rb
3
3
  # TODO: There must be a nicer solution for this.
4
4
 
@@ -1,25 +1,25 @@
1
- # encoding: utf-8
2
- require File.join(File.dirname(__FILE__), 'base')
1
+ # -*- encoding: UTF-8 -*-
2
+ require 'csd/application/minisip/base'
3
3
 
4
4
  module CSD
5
5
  module Application
6
6
  module Minisip
7
7
  class Unix < Base
8
8
 
9
+ # OPERATION INTRODUCTION
10
+
9
11
  def introduction
10
- define_root_path
11
- define_paths
12
12
  UI.separator
13
- UI.info " Working directory: ".green + Path.work.to_s.yellow
14
- UI.info " Your Platform: ".green + Gem::Platform.local.humanize.to_s.yellow
15
- UI.info(" Application module: ".green + self.class.name.to_s.yellow) if Options.developer
13
+ UI.info " Libraries to process: ".green + libraries.join(', ').yellow
14
+ super
15
+ end
16
+
17
+ def compile
16
18
  UI.separator
17
- if Options.help
18
- UI.info Options.helptext
19
- exit
20
- else
21
- exit unless (Options.yes or UI.ask_yes_no("Continue?".red.bold, true))
22
- end
19
+ UI.info "This operation will download and compile MiniSIP.".green.bold
20
+ introduction
21
+ compile!
22
+ run_minisip_gtk_gui
23
23
  end
24
24
 
25
25
  def package
@@ -29,11 +29,16 @@ module CSD
29
29
  package!
30
30
  end
31
31
 
32
- def compile
33
- UI.separator
34
- UI.info "This operation will download and compile MiniSIP.".green.bold
35
- introduction
36
- compile!
32
+ # OPERATIONS
33
+
34
+ def compile!
35
+ Cmd.mkdir Path.work
36
+ checkout_hdviper
37
+ make_hdviper
38
+ checkout_minisip
39
+ modify_minisip
40
+ checkout_plugins
41
+ make_minisip
37
42
  end
38
43
 
39
44
  def make_hdviper
@@ -44,12 +49,17 @@ module CSD
44
49
  Cmd.run('make')
45
50
  end
46
51
 
47
- def make_minisip
52
+ def create_build_dir
53
+ UI.info "Creating target build directories".green.bold
48
54
  [Path.build, Path.build_include, Path.build_lib, Path.build_share, Path.build_share_aclocal].each { |target| Cmd.mkdir target }
49
- LIBRARIES.each do |library|
55
+ end
56
+
57
+ def make_minisip
58
+ create_build_dir
59
+ libraries.each do |library|
50
60
  directory = Pathname.new(File.join(Path.repository, library))
51
61
  next if Options.only and !Options.only.include?(library)
52
- if Cmd.cd(directory) or Options.dry or Options.reveal
62
+ if Cmd.cd(directory) or Options.reveal
53
63
  if Options.bootstrap
54
64
  UI.info "Bootstrapping #{library}".green.bold
55
65
  Cmd.run("./bootstrap -I #{Path.build_share_aclocal.enquote}")
@@ -58,14 +68,14 @@ module CSD
58
68
  UI.info "Configuring #{library}".green.bold
59
69
  individual_options = case library
60
70
  when 'libminisip'
61
- %Q{--enable-debug --enable-video --disable-mil --enable-decklink --enable-opengl --disable-sdl CPPFLAGS="-I#{Path.hdviper_x264_test_x264api} -I#{Path.hdviper_x264}" LDFLAGS="#{File.join(Path.hdviper_x264_test_x264api, 'libx264api.a')} #{File.join(Path.hdviper_x264, 'libtidx264.a')} -lpthread -lrt"}
71
+ %Q{--enable-debug --enable-video --disable-mil --enable-decklink --enable-opengl --disable-sdl CPPFLAGS="-I#{Path.hdviper_x264_test_x264api} -I#{Path.hdviper_x264}" #{ld_flags}}
62
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"}
63
73
  when 'minisip'
64
74
  %Q{--enable-debug --enable-video --enable-textui --enable-opengl}
65
75
  else
66
76
  ''
67
77
  end
68
- Cmd.run(%Q{./configure #{individual_options} --prefix=#{Path.build.enquote} PKG_CONFIG_PATH=#{Path.build_lib_pkg_config.enquote} ACLOCAL_FLAGS=#{Path.build_share_aclocal} LD_LIBRARY_PATH=#{Path.build_lib.enquote} --silent})
78
+ Cmd.run(%Q{./configure #{individual_options} --prefix=#{Path.build.enquote} PKG_CONFIG_PATH=#{Path.build_lib_pkg_config.enquote} ACLOCAL_FLAGS=#{Path.build_share_aclocal} LD_LIBRARY_PATH=#{Path.build_lib.enquote}})
69
79
  end
70
80
  if Options.make
71
81
  UI.info "Make #{library}".green.bold
@@ -84,17 +94,17 @@ module CSD
84
94
 
85
95
  def package!
86
96
  Cmd.mkdir(Path.packaging)
87
- LIBRARIES.each do |library|
97
+ libraries.each do |library|
88
98
  directory = Pathname.new(File.join(Path.repository, library))
89
99
  next if Options.only and !Options.only.include?(library)
90
100
  UI.info "Making #{library} with target dist".green.bold
91
- if Cmd.cd(directory) or Options.dry or Options.reveal
101
+ if Cmd.cd(directory) or Options.reveal
92
102
  Cmd.run("make dist")
93
103
 
94
104
  tar_filename = File.basename(Dir[File.join(directory, '*.tar.gz')].first)
95
105
  Cmd.move(File.join(directory, tar_filename.to_s), Path.packaging) if tar_filename or Options.reveal
96
106
 
97
- if Cmd.cd(Path.packaging) or Options.dry or Options.reveal
107
+ if Cmd.cd(Path.packaging) or Options.reveal
98
108
  Cmd.run("tar -xzf #{tar_filename}")
99
109
  tar_dirname = File.basename(tar_filename.to_s, '.tar.gz')
100
110
  if Cmd.cd(File.join(Path.packaging, tar_dirname))
@@ -125,7 +135,10 @@ module CSD
125
135
  end
126
136
  end
127
137
  Cmd.cd Path.root
128
- Cmd.run 'minisip_gtkgui'
138
+ end
139
+
140
+ def run_minisip_gtk_gui
141
+ Cmd.run(Path.build_gtkgui, :die_on_failure => false)
129
142
  end
130
143
 
131
144
  end
@@ -0,0 +1,12 @@
1
+ # -*- encoding: UTF-8 -*-
2
+ require File.join(File.dirname(__FILE__), '..', 'unix')
3
+
4
+ module CSD
5
+ module Application
6
+ module Minisip
7
+ class Darwin < Unix
8
+
9
+ end
10
+ end
11
+ end
12
+ end