RubyPackager 1.2.0.20120302 → 1.2.1.20131211
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -0
- data/ChangeLog +12 -0
- data/ReleaseInfo +1 -1
- data/bin/Release.rb +19 -8
- data/lib/RubyPackager/Distributors/RubyGems.rb +2 -7
- data/lib/RubyPackager/Distributors/SourceForge.rb +2 -7
- data/lib/RubyPackager/Installers/Gem.rb +2 -7
- data/lib/RubyPackager/ReleaseInfo.rb +1 -5
- data/lib/RubyPackager/Releaser.rb +0 -4
- data/lib/RubyPackager/Tools.rb +1 -6
- data/lib/RubyPackager/{i386-cygwin → cygwin}/PlatformReleaser.rb +109 -113
- data/lib/RubyPackager/{i386-linux → linux}/PlatformReleaser.rb +110 -113
- data/lib/RubyPackager/{i386-mingw32 → windows}/Installers/NSIS.rb +3 -7
- data/lib/RubyPackager/{i386-mswin32 → windows}/PlatformReleaser.rb +166 -171
- data/lib/RubyPackager/{i386-mingw32 → windows}/edicon/edicon.exe +0 -0
- metadata +115 -78
- data/lib/RubyPackager/i386-mingw32/PlatformReleaser.rb +0 -171
- data/lib/RubyPackager/i386-mswin32/Installers/NSIS.rb +0 -59
- data/lib/RubyPackager/i386-mswin32/edicon/edicon.exe +0 -0
data/AUTHORS
CHANGED
data/ChangeLog
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
= RubyPackager Release History
|
2
2
|
|
3
|
+
== 1.2.1.20131211 (Beta)
|
4
|
+
|
5
|
+
* Changed the way to test for exerb.
|
6
|
+
* Removed useless copyrights
|
7
|
+
* Sorted file names in test stubs for determinism
|
8
|
+
* Sort installers to avoid problems with testing
|
9
|
+
* Setup unique repository names for parallel execution on Travis
|
10
|
+
* Made tests pass on Windows, Cygwin and Linux
|
11
|
+
* Adapted code and tests for all platforms
|
12
|
+
* Added support for Travis
|
13
|
+
* Added missing comment
|
14
|
+
|
3
15
|
== 1.2.0.20120302 (Beta)
|
4
16
|
|
5
17
|
* Adapted release information to last version of RubyPackager
|
data/ReleaseInfo
CHANGED
data/bin/Release.rb
CHANGED
@@ -1,8 +1,4 @@
|
|
1
1
|
#!env ruby
|
2
|
-
#--
|
3
|
-
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
4
|
-
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
5
|
-
#++
|
6
2
|
|
7
3
|
# Release a distribution of a Ruby program or library.
|
8
4
|
# Here is the behaviour:
|
@@ -15,9 +11,24 @@ require 'rUtilAnts/Logging'
|
|
15
11
|
RUtilAnts::Logging::install_logger_on_object(:lib_root_dir => "#{File.dirname(__FILE__)}/..", :bug_tracker_url => 'http://sourceforge.net/tracker/?group_id=274236&atid=1165400')
|
16
12
|
require 'rUtilAnts/Misc'
|
17
13
|
RUtilAnts::Misc.install_misc_on_object
|
14
|
+
require 'rUtilAnts/Platform'
|
15
|
+
RUtilAnts::Platform.install_platform_on_object
|
18
16
|
|
19
17
|
module RubyPackager
|
20
18
|
|
19
|
+
PLATFORM_ID = (
|
20
|
+
case os
|
21
|
+
when RUtilAnts::Platform::OS_WINDOWS
|
22
|
+
'windows'
|
23
|
+
when RUtilAnts::Platform::OS_LINUX, RUtilAnts::Platform::OS_MACOSX
|
24
|
+
'linux'
|
25
|
+
when RUtilAnts::Platform::OS_CYGWIN
|
26
|
+
'cygwin'
|
27
|
+
else
|
28
|
+
raise RuntimeError, "Non supported OS code: #{os}"
|
29
|
+
end
|
30
|
+
)
|
31
|
+
|
21
32
|
# Class giving command line options for the releaser
|
22
33
|
class Launcher
|
23
34
|
|
@@ -49,9 +60,9 @@ module RubyPackager
|
|
49
60
|
require 'rUtilAnts/Plugins'
|
50
61
|
lPluginsManager = RUtilAnts::Plugins::PluginsManager.new
|
51
62
|
lPluginsManager.parse_plugins_from_dir('Installers', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/Installers", 'RubyPackager::Installers')
|
52
|
-
lPluginsManager.parse_plugins_from_dir('Installers', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/#{
|
63
|
+
lPluginsManager.parse_plugins_from_dir('Installers', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/#{PLATFORM_ID}/Installers", 'RubyPackager::Installers')
|
53
64
|
lPluginsManager.parse_plugins_from_dir('Distributors', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/Distributors", 'RubyPackager::Distributors')
|
54
|
-
lPluginsManager.parse_plugins_from_dir('Distributors', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/#{
|
65
|
+
lPluginsManager.parse_plugins_from_dir('Distributors', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/#{PLATFORM_ID}/Distributors", 'RubyPackager::Distributors')
|
55
66
|
|
56
67
|
# Parse command line arguments
|
57
68
|
# Variables set by the parser
|
@@ -166,7 +177,7 @@ module RubyPackager
|
|
166
177
|
# All is ok, call the library with parameters
|
167
178
|
require 'RubyPackager/Releaser'
|
168
179
|
# Require the platform specific distribution file
|
169
|
-
require "RubyPackager/#{
|
180
|
+
require "RubyPackager/#{PLATFORM_ID}/PlatformReleaser"
|
170
181
|
rSuccess = Releaser.new(
|
171
182
|
lPluginsManager,
|
172
183
|
lReleaseInfo,
|
@@ -179,7 +190,7 @@ module RubyPackager
|
|
179
190
|
lIncludeRuby,
|
180
191
|
lIncludeTest,
|
181
192
|
lIncludeRDoc,
|
182
|
-
lInstallers,
|
193
|
+
lInstallers.sort,
|
183
194
|
lDistributors
|
184
195
|
).execute
|
185
196
|
if (rSuccess)
|
@@ -1,8 +1,3 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
|
-
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
-
#++
|
5
|
-
|
6
1
|
require 'RubyPackager/Tools'
|
7
2
|
|
8
3
|
module RubyPackager
|
@@ -10,7 +5,7 @@ module RubyPackager
|
|
10
5
|
module Distributors
|
11
6
|
|
12
7
|
class RubyGems
|
13
|
-
|
8
|
+
|
14
9
|
include RubyPackager::Tools
|
15
10
|
|
16
11
|
# Check that we can use this distributor
|
@@ -64,4 +59,4 @@ module RubyPackager
|
|
64
59
|
|
65
60
|
end
|
66
61
|
|
67
|
-
end
|
62
|
+
end
|
@@ -1,8 +1,3 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
|
-
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
-
#++
|
5
|
-
|
6
1
|
require 'RubyPackager/Tools'
|
7
2
|
|
8
3
|
module RubyPackager
|
@@ -10,7 +5,7 @@ module RubyPackager
|
|
10
5
|
module Distributors
|
11
6
|
|
12
7
|
class SourceForge
|
13
|
-
|
8
|
+
|
14
9
|
include RubyPackager::Tools
|
15
10
|
|
16
11
|
# Check that we can use this distributor
|
@@ -105,4 +100,4 @@ module RubyPackager
|
|
105
100
|
|
106
101
|
end
|
107
102
|
|
108
|
-
end
|
103
|
+
end
|
@@ -1,8 +1,3 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
|
-
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
-
#++
|
5
|
-
|
6
1
|
module RubyPackager
|
7
2
|
|
8
3
|
module Installers
|
@@ -95,7 +90,7 @@ module RubyPackager
|
|
95
90
|
lRequirePaths.concat(iReleaseInfo.gem_info[:require_paths])
|
96
91
|
end
|
97
92
|
lStrRequirePaths = (lRequirePaths.empty?) ? 'iSpec.require_path = \'\'' : "iSpec.require_paths = #{lRequirePaths.inspect}"
|
98
|
-
|
93
|
+
|
99
94
|
# extensions
|
100
95
|
lStrExtensions = ''
|
101
96
|
if ((iReleaseInfo.gem_info[:extensions] != nil) and
|
@@ -167,4 +162,4 @@ end
|
|
167
162
|
|
168
163
|
end
|
169
164
|
|
170
|
-
end
|
165
|
+
end
|
@@ -1,8 +1,3 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
|
-
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
-
#++
|
5
|
-
|
6
1
|
module RubyPackager
|
7
2
|
|
8
3
|
# This class is the base class of all releases info to be provided by packages.
|
@@ -172,6 +167,7 @@ module RubyPackager
|
|
172
167
|
# * *:extra_rdoc_files* (<em>list<String></em>): List of file patterns to be included in the RDoc but not in the Gem
|
173
168
|
# * *:test_file* (_String_): Name of the test file to execute
|
174
169
|
# * *:gem_dependencies* (<em>list< [String,String] ></em>): List of [ Gem, Version criteria ] this Gem depends on
|
170
|
+
# * *:extensions* (<em>list<String></em>): List of paths to extconf.rb files to include as native C extensions
|
175
171
|
# Return::
|
176
172
|
# * _ReleaseInfo_: self
|
177
173
|
def gem(iParams)
|
@@ -1,8 +1,4 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
#--
|
3
|
-
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
4
|
-
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
5
|
-
#++
|
6
2
|
|
7
3
|
# Release a distribution of a Ruby program.
|
8
4
|
# This produces an installable executable that will install a set of files and directories:
|
data/lib/RubyPackager/Tools.rb
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
|
-
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
-
#++
|
5
|
-
|
6
1
|
module RubyPackager
|
7
2
|
|
8
3
|
module Tools
|
@@ -98,4 +93,4 @@ module RubyPackager
|
|
98
93
|
|
99
94
|
end
|
100
95
|
|
101
|
-
end
|
96
|
+
end
|
@@ -1,113 +1,109 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
# *
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
\#
|
75
|
-
|
76
|
-
|
77
|
-
\#
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
112
|
-
|
113
|
-
end
|
1
|
+
# This file prepares a cygwin distribution
|
2
|
+
|
3
|
+
# Require needed to generate the temporary ruby file that produces the executable
|
4
|
+
require 'tmpdir'
|
5
|
+
|
6
|
+
module RubyPackager
|
7
|
+
|
8
|
+
class PlatformReleaser
|
9
|
+
|
10
|
+
PLATFORM_DIR = File.dirname(__FILE__)
|
11
|
+
|
12
|
+
# Check if the tools we will use to generate an executable are present
|
13
|
+
#
|
14
|
+
# Parameters::
|
15
|
+
# * *iRootDir* (_String_): Root directory
|
16
|
+
# * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
|
17
|
+
# * *iNeedBinaryCompilation* (_Boolean_): Do we need to compile RB files into a binary executable ?
|
18
|
+
# Return::
|
19
|
+
# * _Boolean_: Are tools correctly useable ?
|
20
|
+
def check_exe_tools(iRootDir, iIncludeRuby, iNeedBinaryCompilation)
|
21
|
+
rSuccess = true
|
22
|
+
|
23
|
+
if (iIncludeRuby)
|
24
|
+
# We need allinoneruby
|
25
|
+
if (Gem.find_files('allinoneruby').empty?)
|
26
|
+
log_err "Need to have allinoneruby gem to release including Ruby.\nPlease install allinoneruby gem (gem install allinoneruby)."
|
27
|
+
rSuccess = false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
return rSuccess
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create the binary.
|
35
|
+
# This is called when the core library has been copied in the release directory.
|
36
|
+
#
|
37
|
+
# Parameters::
|
38
|
+
# * *iRootDir* (_String_): Root directory
|
39
|
+
# * *iReleaseDir* (_String_): Release directory
|
40
|
+
# * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
|
41
|
+
# * *iExecutableInfo* (<em>map<Symbol,Object></em>): The executable information
|
42
|
+
# Return::
|
43
|
+
# * _Boolean_: Success ?
|
44
|
+
def create_binary(iRootDir, iReleaseDir, iIncludeRuby, iExecutableInfo)
|
45
|
+
rSuccess = true
|
46
|
+
|
47
|
+
lBinSubDir = "Launch/#{PLATFORM_ID}/bin"
|
48
|
+
lRubyBaseBinName = 'ruby'
|
49
|
+
lBinName = "#{lRubyBaseBinName}-#{RUBY_VERSION}.bin"
|
50
|
+
if (iIncludeRuby)
|
51
|
+
# First create the binary containing all ruby
|
52
|
+
lBinDir = "#{iReleaseDir}/#{lBinSubDir}"
|
53
|
+
FileUtils::mkdir_p(lBinDir)
|
54
|
+
change_dir(lBinDir) do
|
55
|
+
lCmd = "allinoneruby #{lBinName}"
|
56
|
+
rSuccess = system(lCmd)
|
57
|
+
if (!rSuccess)
|
58
|
+
log_err "Error while executing \"#{lCmd}\""
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
if (rSuccess)
|
63
|
+
# Then create the real executable
|
64
|
+
# Generate the Shell file that launches everything for Linux
|
65
|
+
File.open("#{iReleaseDir}/#{iExecutableInfo[:exe_name]}", 'w') do |oFile|
|
66
|
+
oFile << "\#!/bin/sh
|
67
|
+
\#--
|
68
|
+
\# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
69
|
+
\# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
70
|
+
\#++
|
71
|
+
|
72
|
+
\# This file is generated by RubyPackager for Cygwin.
|
73
|
+
|
74
|
+
\# This file has to launch the correct binary. There can be several binaries dependending on the configuration.
|
75
|
+
\# This is the file that will be created as the executable to launch.
|
76
|
+
|
77
|
+
\# Test Ruby's existence
|
78
|
+
which ruby >/dev/null 2>/dev/null
|
79
|
+
OUT=$?
|
80
|
+
if [ $OUT -eq 1 ]
|
81
|
+
then
|
82
|
+
echo 'Ruby not found on current platform. Use embedded one.'
|
83
|
+
if [ ! -d tempruby ]
|
84
|
+
then
|
85
|
+
echo 'Extracting Ruby distribution...'
|
86
|
+
mkdir tempruby
|
87
|
+
cd tempruby
|
88
|
+
../#{lBinSubDir}/#{lBinName} --eee-justextract
|
89
|
+
cd ..
|
90
|
+
fi
|
91
|
+
\# Set the environment correctly to execute Ruby from the extracted dir
|
92
|
+
export LD_LIBRARY_PATH=`pwd`/tempruby/bin:`pwd`/tempruby/lib:`pwd`/tempruby/lib/lib1:`pwd`/tempruby/lib/lib2:`pwd`/tempruby/lib/lib3:`pwd`/tempruby/lib/lib4:${LD_LIRARY_PATH}
|
93
|
+
export RUBYOPT=
|
94
|
+
./tempruby/bin/ruby -w #{iExecutableInfo[:startup_rb_file]}
|
95
|
+
else
|
96
|
+
echo 'Ruby found on current platform. Use it directly.'
|
97
|
+
ruby -w #{iExecutableInfo[:startup_rb_file]}
|
98
|
+
fi
|
99
|
+
"
|
100
|
+
end
|
101
|
+
File.chmod(0755, "#{iReleaseDir}/#{iExecutableInfo[:exe_name]}")
|
102
|
+
end
|
103
|
+
|
104
|
+
return rSuccess
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
@@ -1,113 +1,110 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
# *
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
\#
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
if [
|
85
|
-
then
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
112
|
-
|
113
|
-
end
|
1
|
+
# This file prepares a win32 distribution
|
2
|
+
|
3
|
+
# Require needed to generate the temporary ruby file that produces the executable
|
4
|
+
require 'tmpdir'
|
5
|
+
|
6
|
+
module RubyPackager
|
7
|
+
|
8
|
+
class PlatformReleaser
|
9
|
+
|
10
|
+
PLATFORM_DIR = File.dirname(__FILE__)
|
11
|
+
|
12
|
+
# Check if the tools we will use to generate an executable are present
|
13
|
+
#
|
14
|
+
# Parameters::
|
15
|
+
# * *iRootDir* (_String_): Root directory
|
16
|
+
# * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
|
17
|
+
# * *iNeedBinaryCompilation* (_Boolean_): Do we need to compile RB files into a binary executable ?
|
18
|
+
# Return::
|
19
|
+
# * _Boolean_: Are tools correctly useable ?
|
20
|
+
def check_exe_tools(iRootDir, iIncludeRuby, iNeedBinaryCompilation)
|
21
|
+
rSuccess = true
|
22
|
+
|
23
|
+
if (iIncludeRuby)
|
24
|
+
# We need allinoneruby
|
25
|
+
if (Gem.find_files('allinoneruby').empty?)
|
26
|
+
log_err "Need to have allinoneruby gem to release including Ruby.\nPlease install allinoneruby gem (gem install allinoneruby)."
|
27
|
+
rSuccess = false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
return rSuccess
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create the binary.
|
35
|
+
# This is called when the core library has been copied in the release directory.
|
36
|
+
#
|
37
|
+
# Parameters::
|
38
|
+
# * *iRootDir* (_String_): Root directory
|
39
|
+
# * *iReleaseDir* (_String_): Release directory
|
40
|
+
# * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
|
41
|
+
# * *iExecutableInfo* (<em>map<Symbol,Object></em>): The executable information
|
42
|
+
# Return::
|
43
|
+
# * _Boolean_: Success ?
|
44
|
+
def create_binary(iRootDir, iReleaseDir, iIncludeRuby, iExecutableInfo)
|
45
|
+
rSuccess = true
|
46
|
+
|
47
|
+
lBinSubDir = "Launch/#{PLATFORM_ID}/bin"
|
48
|
+
lRubyBaseBinName = 'ruby'
|
49
|
+
lBinName = "#{lRubyBaseBinName}-#{RUBY_VERSION}.bin"
|
50
|
+
if (iIncludeRuby)
|
51
|
+
# First create the binary containing all ruby
|
52
|
+
lBinDir = "#{iReleaseDir}/#{lBinSubDir}"
|
53
|
+
FileUtils::mkdir_p(lBinDir)
|
54
|
+
change_dir(lBinDir) do
|
55
|
+
lCmd = "allinoneruby #{lBinName}"
|
56
|
+
rSuccess = system(lCmd)
|
57
|
+
if (!rSuccess)
|
58
|
+
log_err "Error while executing \"#{lCmd}\""
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
if (rSuccess)
|
63
|
+
# Then create the real executable
|
64
|
+
# Generate the Shell file that launches everything for Linux
|
65
|
+
lShellFileName = "#{iReleaseDir}/#{iExecutableInfo[:exe_name]}"
|
66
|
+
File.open(lShellFileName, 'w') do |oFile|
|
67
|
+
oFile << "\#!/bin/sh
|
68
|
+
\#--
|
69
|
+
\# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
70
|
+
\# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
71
|
+
\#++
|
72
|
+
|
73
|
+
\# This file is generated by RubyPackager for Linux.
|
74
|
+
|
75
|
+
\# This file has to launch the correct binary. There can be several binaries dependending on the configuration.
|
76
|
+
\# This is the file that will be created as the executable to launch.
|
77
|
+
|
78
|
+
\# Test Ruby's existence
|
79
|
+
which ruby >/dev/null 2>/dev/null
|
80
|
+
OUT=$?
|
81
|
+
if [ $OUT -eq 1 ]
|
82
|
+
then
|
83
|
+
echo 'Ruby not found on current platform. Use embedded one.'
|
84
|
+
if [ ! -d tempruby ]
|
85
|
+
then
|
86
|
+
echo 'Extracting Ruby distribution...'
|
87
|
+
mkdir tempruby
|
88
|
+
cd tempruby
|
89
|
+
../#{lBinSubDir}/#{lBinName} --eee-justextract
|
90
|
+
cd ..
|
91
|
+
fi
|
92
|
+
\# Set the environment correctly to execute Ruby from the extracted dir
|
93
|
+
export LD_LIBRARY_PATH=`pwd`/tempruby/bin:`pwd`/tempruby/lib:`pwd`/tempruby/lib/lib1:`pwd`/tempruby/lib/lib2:`pwd`/tempruby/lib/lib3:`pwd`/tempruby/lib/lib4:${LD_LIRARY_PATH}
|
94
|
+
export RUBYOPT=
|
95
|
+
./tempruby/bin/ruby -w #{iExecutableInfo[:startup_rb_file]}
|
96
|
+
else
|
97
|
+
echo 'Ruby found on current platform. Use it directly.'
|
98
|
+
ruby -w #{iExecutableInfo[:startup_rb_file]}
|
99
|
+
fi
|
100
|
+
"
|
101
|
+
end
|
102
|
+
File.chmod(0755, lShellFileName)
|
103
|
+
end
|
104
|
+
|
105
|
+
return rSuccess
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|