csd 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/.gitignore +5 -1
  2. data/Rakefile +7 -7
  3. data/VERSION +1 -1
  4. data/bin/ai +1 -1
  5. data/csd.gemspec +21 -9
  6. data/lib/csd.rb +15 -8
  7. data/lib/csd/application/decklink.rb +27 -0
  8. data/lib/csd/application/decklink/about.yml +7 -0
  9. data/lib/csd/application/decklink/base.rb +62 -0
  10. data/lib/csd/application/default.rb +5 -1
  11. data/lib/csd/application/default/base.rb +10 -0
  12. data/lib/csd/application/minisip.rb +8 -5
  13. data/lib/csd/application/minisip/about.yml +1 -1
  14. data/lib/csd/application/minisip/base.rb +29 -90
  15. data/lib/csd/application/minisip/component.rb +8 -0
  16. data/lib/csd/application/minisip/component/core.rb +288 -0
  17. data/lib/csd/application/minisip/component/ffmpeg.rb +78 -0
  18. data/lib/csd/application/minisip/component/gnome.rb +48 -0
  19. data/lib/csd/application/minisip/component/hdviper.rb +49 -0
  20. data/lib/csd/application/minisip/component/plugins.rb +53 -0
  21. data/lib/csd/application/minisip/component/x264.rb +42 -0
  22. data/lib/csd/application/minisip/error.rb +11 -5
  23. data/lib/csd/application/minisip/options/common.rb +4 -4
  24. data/lib/csd/application/minisip/options/compile.rb +10 -16
  25. data/lib/csd/application/minisip/unix.rb +19 -159
  26. data/lib/csd/application/minisip/unix/darwin.rb +1 -11
  27. data/lib/csd/application/minisip/unix/linux.rb +1 -1
  28. data/lib/csd/application/minisip/unix/linux/debian.rb +6 -14
  29. data/lib/csd/application/minisip/unix/linux/debian/ubuntu10.rb +6 -4
  30. data/lib/csd/applications.rb +16 -21
  31. data/lib/csd/commands.rb +34 -7
  32. data/lib/csd/error.rb +27 -11
  33. data/lib/csd/extensions/core/kernel.rb +9 -19
  34. data/lib/csd/extensions/core/object.rb +1 -0
  35. data/lib/csd/extensions/core/string.rb +1 -1
  36. data/lib/csd/extensions/gem/platform.rb +9 -3
  37. data/lib/csd/options_parser.rb +3 -3
  38. data/lib/csd/user_interface/base.rb +8 -5
  39. data/lib/csd/user_interface/cli.rb +9 -1
  40. data/lib/csd/user_interface/silent.rb +7 -4
  41. data/lib/csd/vendor/zentest/zentest_assertions.rb +39 -35
  42. data/test/application/test_minisip.rb +65 -26
  43. data/test/functional/test_applications.rb +4 -4
  44. data/test/functional/test_commands.rb +26 -2
  45. data/test/helper.rb +9 -5
  46. data/test/unit/test_pathname.rb +1 -1
  47. data/test/unit/test_platform.rb +30 -0
  48. metadata +18 -6
data/.gitignore CHANGED
@@ -13,10 +13,14 @@ tmtags
13
13
  ## VIM
14
14
  *.swp
15
15
 
16
+ ## ECLIPSE
17
+ .loadpath
18
+ .project
19
+
16
20
  ## PROJECT::GENERAL
17
21
  coverage
18
22
  rdoc
19
23
  pkg
20
24
 
21
25
  ## PROJECT::SPECIFIC
22
- drop
26
+ drop
data/Rakefile CHANGED
@@ -29,18 +29,18 @@ Jeweler::Tasks.new do |gemspec|
29
29
  gemspec.post_install_message = %q{
30
30
  ============================================================
31
31
 
32
- Thank you for installing the TTA Automated Installer!
32
+ Thank you for installing the TTA Automated Installer!
33
33
 
34
- You can run it by typing `tta´ in your command line.
34
+ You can run it by typing `ai´ in your command line.
35
35
 
36
- NOTE: On DEBIAN and UBUNTU the executable `tta´ is *maybe*
37
- not in your PATH by default. If that is the case,
38
- you can fix it by running this command:
36
+ NOTE: On DEBIAN and UBUNTU the executable `ai´ is *maybe*
37
+ not in your PATH by default. If that is the case,
38
+ you can fix it by running this command:
39
39
 
40
- echo "export PATH=\$PATH:$(gem env | grep "E D" | sed "s/[^\w]* //")" >> ~/.bashrc;. ~/.bashrc
40
+ echo "export PATH=\$PATH:$(gem env | grep "E D" | sed "s/[^\w]* //")" >> ~/.bashrc;. ~/.bashrc
41
41
 
42
42
  ============================================================
43
- }
43
+ }
44
44
  end
45
45
 
46
46
  # Here we define the default task when no task was specified by the user
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.9
1
+ 0.1.10
data/bin/ai CHANGED
@@ -22,5 +22,5 @@ rescue Interrupt
22
22
  # Lastly, close the AI gracefully on abnormal termination
23
23
  CSD.ui.separator
24
24
  CSD.ui.info "Quitting the AI...".red
25
- exit
25
+ exit 1
26
26
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{csd}
8
- s.version = "0.1.9"
8
+ s.version = "0.1.10"
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-29}
12
+ s.date = %q{2010-08-03}
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}
@@ -28,11 +28,21 @@ Gem::Specification.new do |s|
28
28
  "csd.gemspec",
29
29
  "lib/csd.rb",
30
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",
31
34
  "lib/csd/application/default.rb",
32
35
  "lib/csd/application/default/base.rb",
33
36
  "lib/csd/application/minisip.rb",
34
37
  "lib/csd/application/minisip/about.yml",
35
38
  "lib/csd/application/minisip/base.rb",
39
+ "lib/csd/application/minisip/component.rb",
40
+ "lib/csd/application/minisip/component/core.rb",
41
+ "lib/csd/application/minisip/component/ffmpeg.rb",
42
+ "lib/csd/application/minisip/component/gnome.rb",
43
+ "lib/csd/application/minisip/component/hdviper.rb",
44
+ "lib/csd/application/minisip/component/plugins.rb",
45
+ "lib/csd/application/minisip/component/x264.rb",
36
46
  "lib/csd/application/minisip/error.rb",
37
47
  "lib/csd/application/minisip/options/common.rb",
38
48
  "lib/csd/application/minisip/options/compile.rb",
@@ -83,24 +93,25 @@ Gem::Specification.new do |s|
83
93
  "test/unit/test_dir.rb",
84
94
  "test/unit/test_open_struct.rb",
85
95
  "test/unit/test_pathname.rb",
96
+ "test/unit/test_platform.rb",
86
97
  "test/unit/test_string.rb"
87
98
  ]
88
99
  s.homepage = %q{http://github.com/csd/csd}
89
100
  s.post_install_message = %q{
90
101
  ============================================================
91
102
 
92
- Thank you for installing the TTA Automated Installer!
103
+ Thank you for installing the TTA Automated Installer!
93
104
 
94
- You can run it by typing `tta´ in your command line.
105
+ You can run it by typing `ai´ in your command line.
95
106
 
96
- NOTE: On DEBIAN and UBUNTU the executable `tta´ is *maybe*
97
- not in your PATH by default. If that is the case,
98
- you can fix it by running this command:
107
+ NOTE: On DEBIAN and UBUNTU the executable `ai´ is *maybe*
108
+ not in your PATH by default. If that is the case,
109
+ you can fix it by running this command:
99
110
 
100
- echo "export PATH=\$PATH:$(gem env | grep "E D" | sed "s/[^\w]* //")" >> ~/.bashrc;. ~/.bashrc
111
+ echo "export PATH=\$PATH:$(gem env | grep "E D" | sed "s/[^\w]* //")" >> ~/.bashrc;. ~/.bashrc
101
112
 
102
113
  ============================================================
103
- }
114
+ }
104
115
  s.rdoc_options = ["--charset=UTF-8"]
105
116
  s.require_paths = ["lib"]
106
117
  s.rubygems_version = %q{1.3.7}
@@ -119,6 +130,7 @@ Gem::Specification.new do |s|
119
130
  "test/unit/test_dir.rb",
120
131
  "test/unit/test_open_struct.rb",
121
132
  "test/unit/test_pathname.rb",
133
+ "test/unit/test_platform.rb",
122
134
  "test/unit/test_string.rb"
123
135
  ]
124
136
 
data/lib/csd.rb CHANGED
@@ -8,29 +8,37 @@ Dir[File.join(File.dirname(__FILE__), 'csd', '*.rb')].sort.each { |path| require
8
8
  #
9
9
  module CSD
10
10
  class << self
11
-
11
+
12
12
  # This String holds the name of the executable the user used to bootstrap this gem
13
13
  attr_reader :executable
14
-
14
+
15
15
  # This method "runs" the whole CSD gem, so to speak.
16
16
  #
17
17
  def bootstrap(options={})
18
18
  @executable = options[:executable]
19
19
  Options.parse!
20
20
  respond_to_incomplete_arguments
21
+ UI.debug "#{self}.bootstrap initializes the task #{Options.action.enquote} of the application #{Applications.current.name.to_s.enquote} now"
21
22
  Applications.current.instance.send("#{Options.action}".to_sym)
22
23
  end
23
-
24
+
24
25
  private
25
-
26
+
26
27
  # This method check the arguments the user has provided and terminates the AI with
27
28
  # some helpful message if the arguments are invalid.
28
29
  #
29
30
  def respond_to_incomplete_arguments
30
- choose_application unless Applications.current
31
- choose_action unless Options.valid_action?
31
+ if !Applications.current and ARGV.include?('update')
32
+ # Updating the AI
33
+ UI.info "Updating the AI to the newest version".green.bold
34
+ Cmd.run "sudo gem update csd", :announce_pwd => false, :verbose => true
35
+ exit # The only smooth status code 0 exit in this whole application :)
36
+ else
37
+ choose_application unless Applications.current
38
+ choose_action unless Options.valid_action?
39
+ end
32
40
  end
33
-
41
+
34
42
  # This methods lists all available applications
35
43
  #
36
44
  def choose_application
@@ -74,5 +82,4 @@ module CSD
74
82
  end
75
83
 
76
84
  end
77
-
78
85
  end
@@ -0,0 +1,27 @@
1
+ # -*- encoding: UTF-8 -*-
2
+ require 'csd/application/default/base'
3
+ require 'csd/application/decklink/base'
4
+
5
+ module CSD
6
+ module Application
7
+ # This is the Application Module for Decklink, a capture card device used in MiniSIP.
8
+ #
9
+ module Decklink
10
+ class << self
11
+
12
+ include CSD::Application::Default
13
+
14
+ # This method will check which system we're on and initialize the correct sub-module
15
+ #
16
+ def instance
17
+ if Gem::Platform.local.debian?
18
+ Base.new
19
+ else
20
+ raise 'Operating system not supported'
21
+ end
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,7 @@
1
+ human: DeckLink
2
+ description: Capture card drivers for the Blackmagic Design DeckLink device used by MiniSIP.
3
+ actions:
4
+ public:
5
+ - install: Download and install the DeckLink drivers.
6
+ scopes:
7
+ --- {}
@@ -0,0 +1,62 @@
1
+ # -*- encoding: UTF-8 -*-
2
+ require 'csd/application/default/base'
3
+
4
+ module CSD
5
+ module Application
6
+ module Decklink
7
+ class Base < CSD::Application::Base
8
+
9
+ def install
10
+ create_working_directory
11
+ define_relative_paths
12
+ download
13
+ extract
14
+ apply
15
+ end
16
+
17
+ def download
18
+ if Path.tar.file?
19
+ UI.warn "The driver will not be downloaded, because it already exists: #{Path.tar.enquote}"
20
+ else
21
+ UI.info "Downloading DeckLink drivers from Blackmagic Design".green.bold
22
+ Cmd.cd Path.work, :internal => true
23
+ Cmd.run "wget #{Path.decklink_url}", :verbose => false
24
+ end
25
+ end
26
+
27
+ def extract
28
+ if Path.packages.directory?
29
+ UI.warn "The tar file will not be extracted, because package repositot already exist: #{Path.packages.enquote}"
30
+ else
31
+ UI.info "Extracting DeckLink drivers".green.bold
32
+ Cmd.mkdir Path.packages
33
+ Cmd.cd Path.packages, :internal => true
34
+ Cmd.run "tar -xzf #{Path.tar}"
35
+ end
36
+ end
37
+
38
+ def apply
39
+ Cmd.cd Path.packages, :internal => true
40
+ archflag = Gem::Platform.local.cpu =~ /64/ ? 'amd64' : 'i386'
41
+ file = Dir[File.join(Path.packages, "Deck*#{archflag}*.deb")]
42
+ UI.debug "#{self.class} identified these applicable packages: #{file.join(', ')}"
43
+ UI.info "Installing Debian packages".green.bold
44
+ Cmd.run "sudo apt-get install libmng1", :announce_pwd => false
45
+ Cmd.run "sudo dpkg -i #{file.first}", :announce_pwd => false
46
+ end
47
+
48
+ def define_relative_paths
49
+ blacklink_repository = 'http://www.blackmagic-design.com/downloads/software/'
50
+ decklink_basename = 'DeckLink_Linux_7.7.3'
51
+ decklink_extension = '.tar.gz'
52
+ Path.decklink_url = blacklink_repository + decklink_basename + decklink_extension
53
+ Path.tar = Pathname.new(File.join(Path.work, "#{decklink_basename + decklink_extension}"))
54
+ Path.packages = Pathname.new(File.join(Path.work, decklink_basename))
55
+ end
56
+
57
+
58
+
59
+ end
60
+ end
61
+ end
62
+ end
@@ -38,7 +38,11 @@ module CSD
38
38
  # TODO: about.scopes[:action]
39
39
  []
40
40
  end
41
-
41
+
42
+ # This method will look for application and task specific optionsfiles of the current application module.
43
+ # It returns the Ruby code in a +String+ to be eval'd by the OptionsParser.
44
+ # If there are no files in myapplication/options, an empty +String+ is returned instead.
45
+ #
42
46
  def options(action='')
43
47
  options_dir = File.join(Path.applications, name, 'options')
44
48
  common_file = File.join(options_dir, "common.rb")
@@ -9,6 +9,9 @@ module CSD
9
9
  #
10
10
  class Base
11
11
 
12
+ # Running recommended actions for all Applications on initialization.
13
+ # Simple applications might not have to call this via +super+.
14
+ #
12
15
  def initialize
13
16
  define_working_directory
14
17
  end
@@ -33,6 +36,13 @@ module CSD
33
36
  Path.work = path.pathnamify.expand_path
34
37
  end
35
38
 
39
+ def create_working_directory
40
+ unless Path.work.directory?
41
+ UI.info "Creating working directory".green.bold
42
+ Cmd.mkdir Path.work
43
+ end
44
+ end
45
+
36
46
  end
37
47
  end
38
48
  end
@@ -38,32 +38,35 @@ module CSD
38
38
  # * +unknown+
39
39
  #
40
40
  def instance
41
+ UI.debug "#{self}.instance checks whether MiniSIP is supported for the OS #{Gem::Platform.local.os.enquote}"
41
42
  @instance ||= case Gem::Platform.local.os
42
43
 
43
44
  when 'darwin'
44
45
  # Mac OS X
45
- UI.debug "Mac OS X identified"
46
+ UI.debug "#{self}.instance supports Mac OS X"
46
47
  Darwin.new
47
48
 
48
49
  when 'linux'
49
50
  # Linux
50
- UI.debug "Analyzing Linux kernel release: #{Gem::Platform.local.kernel_release}"
51
+ UI.debug "#{self}.instance supports Linux"
52
+ UI.debug "#{self}.instance analyzes the Linux kernel release #{Gem::Platform.local.kernel_release.to_s.enquote}"
51
53
  case Gem::Platform.local.kernel_release
52
54
 
53
55
  when '2.6.32-21-generic', '2.6.32-22-generic'
54
56
  # Ubuntu 10.04
55
- UI.debug "Ubuntu 10.04 identified"
57
+ UI.debug "#{self}.instance supports Ubuntu 10.04"
56
58
  Ubuntu10.new
57
59
 
58
60
  else
59
61
  # Any other Linux (currently only Debian is supported)
60
- UI.debug "Debian identified"
62
+ UI.debug "#{self}.instance supports Debian"
61
63
  Debian.new
62
64
  end
63
65
 
64
66
  else
65
67
  # Microsoft Windows, Java, Solaris, etc...
66
- UI.debug "This Operating System is not supported."
68
+ UI.debug "#{self}.instance does not support #{Gem::Platform.local.os.enquote}"
69
+ # NOTE: The AI should actually abort here as long as there is no MiniSIP for these platforms at all...
67
70
  Base.new
68
71
  end
69
72
  end
@@ -5,7 +5,7 @@ actions:
5
5
  #- show: Shows further information about MiniSIP
6
6
  #- download: Downloads MiniSIP components (e.g. source code, configurations, docs,...)
7
7
  - compile: Downloads and compiles MiniSIP from scratch
8
- - package: Downloads, compiles and packages MiniSIP from scratch
8
+ #- package: Downloads, compiles and packages MiniSIP from scratch
9
9
  #- install: Installs an application
10
10
  #- check: Checks whether the environment dependencies for the application are satisfied
11
11
  developer:
@@ -1,133 +1,69 @@
1
1
  # -*- encoding: UTF-8 -*-
2
2
  require 'csd/application/default/base'
3
+ require 'csd/application/minisip/component'
3
4
 
4
5
  module CSD
5
6
  module Application
6
7
  module Minisip
7
8
  class Base < CSD::Application::Base
8
9
 
9
- # This is an +Array+ containing the names of the internal MiniSIP libraries. Note that they
10
- # are sorted according to the sequence in which they need to be compiled.
11
- #
12
- LIBRARIES = %w{ libmutil libmnetutil libmcrypto libmikey libmsip libmstun libminisip minisip }
10
+ include Component
13
11
 
14
- # Tasks to be done before the introduction is evoked.
12
+ # Tasks to be done before the introduction is evoked by the AI.
15
13
  #
16
14
  def initialize
17
15
  super
18
16
  define_relative_paths
19
17
  end
20
-
21
- # MAIN APPLICATION OPERATIONS
22
-
18
+
19
+ # Running the compile task.
20
+ #
23
21
  def compile
24
22
  UI.error 'Currently not supported for this platform. Sorry.'
25
23
  end
26
24
 
25
+ # Running the package task.
26
+ #
27
27
  def package
28
28
  UI.error 'Currently not supported for this platform. Sorry.'
29
29
  end
30
30
 
31
- # GENERAL USER INFORMATION
32
-
31
+ # This methods prints general information about this application module.
32
+ #
33
33
  def introduction
34
34
  UI.separator
35
- UI.info " Working directory: ".green + Path.work.to_s.yellow
36
- UI.info " Your Platform: ".green + Gem::Platform.local.humanize.to_s.yellow
37
- UI.info(" Application module: ".green + self.class.name.to_s.yellow)
35
+ UI.info " Working directory: ".green.bold + Path.work.to_s.yellow
36
+ if Options.debug
37
+ UI.info " Your Platform: ".green + Gem::Platform.local.humanize.to_s.yellow
38
+ UI.info(" Application module: ".green + self.class.name.to_s.yellow)
39
+ end
38
40
  UI.separator
39
41
  if Options.help
40
42
  UI.info Options.helptext
41
43
  # Cleanup in case the working directory was temporary and is empty
42
44
  Path.work.rmdir if Options.temp and Path.work.directory? and Path.work.children.empty?
43
- exit
45
+ raise CSD::Error::Argument::HelpWasRequested
44
46
  else
45
- raise Interrupt unless (Options.yes or Options.reveal or UI.ask_yes_no("Continue?".red.bold, true))
47
+ raise Interrupt unless Options.yes or Options.reveal or UI.continue?
46
48
  end
47
49
  end
48
50
 
49
- # OTHER CROSS-PLATFORM TASKS
50
-
51
- # Determines which libraries of MiniSIP should be processed, because the --only parameter might be set.
51
+ # Defines all paths ever needed for the MiniSIP module based on the working directory.
52
52
  #
53
- def libraries
54
- Options.only ? LIBRARIES.map { |lib| lib if Options.only.to_a.include?(lib) }.compact : LIBRARIES
55
- end
56
-
57
- # CHECKOUTS
58
-
59
- def checkout_minisip
60
- Cmd.git_clone('MiniSIP repository', 'http://github.com/csd/minisip.git', Path.repository)
61
- end
62
-
63
- def checkout_plugins
64
- Cmd.git_clone('additional MiniSIP plugins', 'http://github.com/csd/minisip-plugins.git', Path.plugins)
65
- end
66
-
67
- def checkout_hdviper
68
- Cmd.git_clone('HDVIPER', 'http://github.com/csd/libraries.git', Path.hdviper)
69
- end
70
-
71
- def checkout_ffmpeg
72
- Cmd.git_clone('ffmpeg repository', 'http://github.com/csd/ffmpeg.git', Path.ffmpeg_repository)
73
- end
74
-
75
- def checkout_libswscale
76
- Cmd.git_clone('ffmpeg libswscale sub-repository', 'http://github.com/csd/libswscale.git', Path.ffmpeg_libswscale)
77
- end
78
-
79
- def checkout_x264
80
- Cmd.git_clone('x264 repository', 'http://github.com/csd/x264.git', Path.x264_repository)
81
- end
82
-
83
- # MODIFYING FILES
84
-
85
- def modify_minisip
86
- Cmd.replace(Path.repository_open_gl_display, '/home/erik', Path.build)
87
- if Options.ffmpeg_first
88
- # See http://www.howgeek.com/2010/03/01/ffmpeg-php-error-‘pix_fmt_rgba32’-undeclared-first-use-in-this-function/
89
- # and http://ffmpeg.org/doxygen/0.5/pixfmt_8h.html#33d341c4f443d24492a95fb7641d0986
90
- Cmd.replace(Path.repository_avcoder_cxx, 'PIX_FMT_RGBA32', 'PIX_FMT_RGB32')
91
- Cmd.replace(Path.repository_avdecoder_cxx, 'PIX_FMT_RGBA32', 'PIX_FMT_RGB32')
92
- end
93
- end
94
-
95
- def modify_libavutil
96
- if Path.ffmpeg_libavutil_common_backup.file?
97
- 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."
98
- else
99
- Cmd.copy Path.ffmpeg_libavutil_common, Path.ffmpeg_libavutil_common_backup
100
- 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;"
101
- end
102
- end
103
-
104
- # FLAGS
105
-
106
- # See http://code.google.com/p/ffmpegsource/issues/detail?id=11
107
- # But for some reason it did not fix tue issue for us :|
108
- #
109
- def libminisip_c_flags
110
- %{CFLAGS="-D__STDC_CONSTANT_MACROS"}
111
- end
112
-
113
- def libminisip_cpp_flags
114
- if Options.ffmpeg_first
115
- %{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}"}
53
+ def define_relative_paths
54
+ if Options.this_user
55
+ Path.build = Pathname.new(File.join(Path.work, 'build'))
116
56
  else
117
- %{CPPFLAGS="-I#{Path.hdviper_x264} -I#{Path.hdviper_x264_test_x264api} -I#{Path.repository_grabber} -I#{Path.repository_decklinksdk}"}
57
+ Path.build = Pathname.new(File.join('/', 'usr', 'local'))
58
+ # This is tricky, but should work for most linux distributions
59
+ # On Windows it will just crash here, unless we determine where the heck sudo make install is targetting at :)
60
+ raise Error::Minisip::BuildDirNotFound, "Sorry, `/usr/local´ could not be found but was requested as MiniSIP target. Use `#{CSD.executable}´ with the option `--this-user´ instead." unless Path.build.directory?
118
61
  end
119
- end
120
-
121
- def libminisip_ld_flags
122
- %{LDFLAGS="#{Path.hdviper_libx264api} #{Path.hdviper_libtidx264} -lpthread -lrt"}
123
- end
124
-
125
- def define_relative_paths
126
- Path.build = Pathname.new(File.join(Path.work, 'build'))
127
62
  Path.build_bin = Pathname.new(File.join(Path.build, 'bin'))
128
63
  Path.build_gtkgui = Pathname.new(File.join(Path.build_bin, 'minisip_gtkgui'))
129
64
  Path.build_include = Pathname.new(File.join(Path.build, 'include'))
130
65
  Path.build_lib = Pathname.new(File.join(Path.build, 'lib'))
66
+ Path.build_lib_libminisip_so = Pathname.new(File.join(Path.build_lib, 'libminisip.so.0'))
131
67
  Path.build_lib_pkg_config = Pathname.new(File.join(Path.build_lib, 'pkgconfig'))
132
68
  Path.build_share = Pathname.new(File.join(Path.build, 'share'))
133
69
  Path.build_share_aclocal = Pathname.new(File.join(Path.build_share, 'aclocal'))
@@ -156,6 +92,9 @@ module CSD
156
92
  Path.hdviper_libx264api = Pathname.new(File.join(Path.hdviper_x264_test_x264api, 'libx264api.a'))
157
93
  Path.plugins = Pathname.new(File.join(Path.work, 'plugins'))
158
94
  Path.plugins_destination = Pathname.new(File.join(Path.build_lib, 'libminisip', 'plugins'))
95
+ Path.minisip_gnome_png = Pathname.new(File.join(Path.repository, 'minisip', 'share', 'icon_gnome.png'))
96
+ Path.minisip_gnome_pixmap = Pathname.new(File.join('/', 'usr', 'share', 'pixmaps', 'minisip_gnome.png'))
97
+ Path.minisip_desktop_entry = Pathname.new(File.join('/', 'usr', 'share', 'applications', 'minisip.desktop'))
159
98
  end
160
99
 
161
100
  end