packtory 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -7
- data/bin/packtory +6 -1
- data/bin/support/after_install_script +5 -5
- data/bin/support/fpm +5 -1
- data/bin/support/gem_build_extensions +3 -3
- data/lib/packtory/brew_package.rb +26 -0
- data/lib/packtory/bundler/setup.rb +21 -0
- data/lib/packtory/command.rb +37 -17
- data/lib/packtory/config.rb +116 -0
- data/lib/packtory/deb_package.rb +5 -1
- data/lib/packtory/fpm_exec.rb +15 -13
- data/lib/packtory/packages.rb +40 -0
- data/lib/packtory/packer.rb +116 -180
- data/lib/packtory/rpm_package.rb +5 -1
- data/lib/packtory/tgz_package.rb +24 -0
- data/lib/packtory/version.rb +1 -1
- data/lib/packtory.rb +28 -2
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89ce5682603992d2f8f3ab91c1cf9f4cbffec6fabb6e8ad8266cad3c5d0d7991
|
4
|
+
data.tar.gz: f3cb9c7d329089a444e72896e1838952e4d824d7e1685ddd5c55eafed25740f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c10ca88570290d7a80a48fa1e888d6685a4b2cd926a98f074bd6bf7cb2108772d561d920165f9739a925465265f3fa05093ed1354ceb7fbe7bf09776b4c4438
|
7
|
+
data.tar.gz: 3f91d64c122e7f08cd622a63e698bccaf45bc752fbae6507396fe6afd14a4974775f73bff528b427856c1c79d866444b4bedda70548f4c3d7781aaf4e90d0b3f
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Overview
|
2
2
|
|
3
3
|
This is packtory, an easy to use system packaging tool for your Ruby
|
4
|
-
gems. Build package for Debian, RPM, and
|
4
|
+
gems. Build package for Debian, RPM, and Homebrew, directly
|
5
5
|
from your gem repo.
|
6
6
|
|
7
7
|
Support for building native extensions is available, using a post-install step of the target package.
|
@@ -41,7 +41,7 @@ env PACKAGE_DEPENDENCIES="mysql,mysql-dev,libxml++>=2.6" packtory <root_path_to_
|
|
41
41
|
|
42
42
|
# Requirements
|
43
43
|
|
44
|
-
This gem depends on `fpm` to build the final system package. You
|
44
|
+
This gem depends on `fpm` to build the final system package. You may install it manually:
|
45
45
|
|
46
46
|
```
|
47
47
|
gem install fpm
|
@@ -62,23 +62,35 @@ brew install rpm
|
|
62
62
|
|
63
63
|
# Compatibility
|
64
64
|
|
65
|
-
If not specified, this buildpack will detect for a gemspec (\*.gemspec) file at the root
|
65
|
+
If not specified, this buildpack will detect for a gemspec (\*.gemspec) file at the root
|
66
|
+
path of your repo, then use that to gather the files of your gem and gem dependencies. After which,
|
67
|
+
it vendorized all files to build the target package.
|
66
68
|
|
67
|
-
If a gem has native extensions, the extensions are not built at the time of building the
|
69
|
+
If a gem has native extensions, the extensions are not built at the time of building the
|
70
|
+
package, but rather, a post-install script is included, that builds them right after the
|
71
|
+
target package is installed in the system. If any native extensions requires other system
|
72
|
+
libraries, you may specify additional package dependencies to be installed prior to
|
73
|
+
installing the target package.
|
68
74
|
|
69
75
|
As of this version, this buildpack do not support packaging gems without a specific gemspec file.
|
70
76
|
|
71
77
|
# Limitations
|
72
78
|
|
73
|
-
Note, the build process will not load the code of your gem or the other dependencies.
|
79
|
+
Note, the build process will not load the code of your gem or the other dependencies.
|
80
|
+
Only the code in the gemspec is loaded using the ruby version of the build environment.
|
81
|
+
Please make sure the gemspec may be loaded properly, and additional code requirements
|
82
|
+
are compatible.
|
74
83
|
|
75
84
|
# Contribution and Improvements
|
76
85
|
|
77
|
-
Please fork the code, make the changes, and submit a pull request for us to review
|
86
|
+
Please fork the code, make the changes, and submit a pull request for us to review
|
87
|
+
your contributions.
|
78
88
|
|
79
89
|
## Feature requests
|
80
90
|
|
81
|
-
If you think it would be nice to have a particular feature that is presently not
|
91
|
+
If you think it would be nice to have a particular feature that is presently not
|
92
|
+
implemented, we would love to hear that and consider working on it. Just open an
|
93
|
+
issue in Github.
|
82
94
|
|
83
95
|
# Questions
|
84
96
|
|
data/bin/packtory
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
this_file = __FILE__
|
4
|
+
while File.symlink?(this_file)
|
5
|
+
this_file = File.readlink(this_file)
|
6
|
+
end
|
7
|
+
|
8
|
+
$:.unshift File.expand_path('../../lib', this_file)
|
4
9
|
require 'packtory'
|
5
10
|
|
6
11
|
Packtory::Command.run(ARGV)
|
@@ -1,14 +1,14 @@
|
|
1
|
-
#!/
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
this_dir=$(cd $(dirname $0); pwd)
|
2
4
|
|
3
5
|
PACKAGE_PATH="<%= pg_PACKAGE_PATH %>"
|
4
6
|
|
5
7
|
# this is a special trap, in case the fpm templating did not its job
|
6
8
|
if [[ $PACKAGE_PATH == \<* ]]; then
|
7
|
-
PACKAGE_PATH=""
|
9
|
+
PACKAGE_PATH="$(dirname $(dirname "$this_dir"))"
|
8
10
|
fi
|
9
11
|
|
10
|
-
this_dir=$(cd $(dirname $0); pwd)
|
11
|
-
|
12
12
|
if [ -n "$PACKAGE_PATH" ]; then
|
13
13
|
eval "export PACKAGE_PATH=$PACKAGE_PATH"
|
14
14
|
else
|
@@ -28,6 +28,6 @@ extensions_path=$PACKAGE_PATH/extensions
|
|
28
28
|
if [ -d $extensions_path ]; then
|
29
29
|
for gemspec in $extensions_path/*.gemspec; do
|
30
30
|
echo "== Processing $(basename $gemspec) =="
|
31
|
-
$gem_build_extensions_path $PACKAGE_PATH/bundle $gemspec
|
31
|
+
/usr/bin/ruby $gem_build_extensions_path $PACKAGE_PATH/bundle $gemspec
|
32
32
|
done
|
33
33
|
fi
|
data/bin/support/fpm
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/
|
1
|
+
#!/usr/bin/ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rubygems/installer'
|
@@ -21,8 +21,8 @@ end
|
|
21
21
|
puts 'Bundle path : %s' % bundle_path
|
22
22
|
puts 'Gemspec path : %s' % gemspec_path
|
23
23
|
|
24
|
-
spec = eval(File.read(gemspec_path)).tap do |
|
25
|
-
|
24
|
+
spec = eval(File.read(gemspec_path)).tap do |s|
|
25
|
+
s.loaded_from = gemspec_path
|
26
26
|
end
|
27
27
|
|
28
28
|
gem_path = File.join(bundle_path, spec.name)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
|
3
|
+
module Packtory
|
4
|
+
class BrewPackage
|
5
|
+
INSTALL_PREFIX = '/usr/local/opt'
|
6
|
+
PACKAGE_PATH = '.'
|
7
|
+
|
8
|
+
def self.build_package(opts = { })
|
9
|
+
packager = Packer.new({ :bin_path => './bin',
|
10
|
+
:install_as_subpath => true }.merge(opts))
|
11
|
+
fpm_exec = FpmExec.new(packager, INSTALL_PREFIX)
|
12
|
+
|
13
|
+
sfiles_map = packager.prepare_files(INSTALL_PREFIX, PACKAGE_PATH)
|
14
|
+
package_filename = '%s-%s.tar.gz' % [ packager.package_name, packager.version ]
|
15
|
+
pkg_file_path = fpm_exec.build(sfiles_map, package_filename, type: :tgz)
|
16
|
+
|
17
|
+
if File.exist?(pkg_file_path)
|
18
|
+
Bundler.ui.info 'Created package: %s (%s bytes)' % [ pkg_file_path, File.size(pkg_file_path) ]
|
19
|
+
else
|
20
|
+
Bundler.ui.error '[ERROR] Package not found: %s' % [ pkg_file_path ]
|
21
|
+
end
|
22
|
+
|
23
|
+
[ packager, pkg_file_path ]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Adding require paths to load path (empty if no gems is needed)
|
2
|
+
|
3
|
+
<% if Packtory.config[:setup_reset_gem_paths] -%>
|
4
|
+
require 'rubygems'
|
5
|
+
|
6
|
+
ENV['GEM_HOME'] = ''
|
7
|
+
ENV['GEM_PATH'] = ''
|
8
|
+
Gem.clear_paths
|
9
|
+
<% end -%>
|
10
|
+
|
11
|
+
<%
|
12
|
+
packer.for_each_bundle_gems do |gem_name, bhash, rpaths|
|
13
|
+
concat("# == Gem: %s, version: %s\n" % [ bhash[:spec].name, bhash[:spec].version ])
|
14
|
+
|
15
|
+
rpaths.each do |rpath|
|
16
|
+
concat("$:.unshift File.expand_path('../../%s%s', __FILE__)\n" % [ gem_name, rpath ])
|
17
|
+
end
|
18
|
+
|
19
|
+
concat("\n")
|
20
|
+
end
|
21
|
+
%>
|
data/lib/packtory/command.rb
CHANGED
@@ -13,6 +13,12 @@ module Packtory
|
|
13
13
|
@fpm_exec_path = Packtory.bin_support_fpm_path
|
14
14
|
end
|
15
15
|
|
16
|
+
if !ENV['FPM_USE_RUBY_PATH'].nil? && !ENV['FPM_USE_RUBY_PATH'].empty?
|
17
|
+
Packtory.config[:fpm_use_ruby_path] = ENV['FPM_USE_RUBY_PATH']
|
18
|
+
elsif !ENV['RUBY_PATH'].nil? && !ENV['RUBY_PATH'].empty?
|
19
|
+
Packtory.config[:fpm_use_ruby_path] = ENV['RUBY_PATH']
|
20
|
+
end
|
21
|
+
|
16
22
|
if @fpm_exec_path.nil? || @fpm_exec_path.empty?
|
17
23
|
say 'ERROR: `fpm` executable is not in path. Perhaps, install fpm first?'
|
18
24
|
exit 1
|
@@ -30,25 +36,36 @@ module Packtory
|
|
30
36
|
end
|
31
37
|
|
32
38
|
say 'Using fpm path : %s' % @fpm_exec_path
|
33
|
-
|
39
|
+
unless Packtory.config[:fpm_use_ruby_path].nil?
|
40
|
+
say 'Fpm using ruby : %s' % Packtory.config[:fpm_use_ruby_path]
|
41
|
+
end
|
34
42
|
|
43
|
+
say 'Using fpm : %s' % `#{exec_fpm} -v`.strip
|
35
44
|
say 'Using build path : %s' % @build_path
|
36
45
|
|
37
|
-
|
38
|
-
|
46
|
+
Packtory.config[:fpm_exec_path] = @fpm_exec_path
|
47
|
+
Packtory.config[:path] = @build_path
|
39
48
|
|
40
49
|
if ENV['FPM_EXEC_VERBOSE'] && ENV['FPM_EXEC_VERBOSE'] == '1'
|
41
|
-
|
50
|
+
Packtory.config[:fpm_exec_verbose] = true
|
42
51
|
end
|
43
52
|
|
44
53
|
if !ENV['FPM_EXEC_LOG'].nil? && !ENV['FPM_EXEC_LOG'].empty?
|
45
|
-
|
46
|
-
|
54
|
+
Packtory.config[:fpm_exec_verbose] = true
|
55
|
+
Packtory.config[:fpm_exec_log] = ENV['FPM_EXEC_LOG']
|
47
56
|
end
|
48
57
|
|
49
58
|
self
|
50
59
|
end
|
51
60
|
|
61
|
+
def exec_fpm
|
62
|
+
if Packtory.config[:fpm_use_ruby_path].nil?
|
63
|
+
@fpm_exec_path
|
64
|
+
else
|
65
|
+
'env FPM_USE_RUBY_PATH=%s %s' % [ Packtory.config[:fpm_use_ruby_path], @fpm_exec_path ]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
52
69
|
def detect_specfile(argv)
|
53
70
|
if ENV['GEM_SPECFILE']
|
54
71
|
@gemspec_file = ENV['GEM_SPECFILE']
|
@@ -74,7 +91,7 @@ module Packtory
|
|
74
91
|
end
|
75
92
|
|
76
93
|
say 'Using spec file : %s' % @gemspec_file
|
77
|
-
|
94
|
+
Packtory.config[:gemspec] = @gemspec_file
|
78
95
|
|
79
96
|
self
|
80
97
|
end
|
@@ -95,11 +112,11 @@ module Packtory
|
|
95
112
|
end
|
96
113
|
|
97
114
|
say 'Using Gemfile : %s' % @bundle_gemfile
|
98
|
-
|
115
|
+
Packtory.config[:gemfile] = @bundle_gemfile
|
99
116
|
end
|
100
117
|
|
101
118
|
if ENV['BUNDLER_INCLUDE']
|
102
|
-
|
119
|
+
Packtory.config[:bundler_include] = true
|
103
120
|
end
|
104
121
|
|
105
122
|
self
|
@@ -116,7 +133,7 @@ module Packtory
|
|
116
133
|
say 'Using ruby deps : latest'
|
117
134
|
end
|
118
135
|
|
119
|
-
|
136
|
+
Packtory.config[:dependencies]['ruby'] = @ruby_version
|
120
137
|
@deps['ruby'] = @ruby_version
|
121
138
|
|
122
139
|
if ENV['PACKAGE_DEPENDENCIES']
|
@@ -126,7 +143,7 @@ module Packtory
|
|
126
143
|
pname = $~[1]
|
127
144
|
pver = $~[2]
|
128
145
|
|
129
|
-
|
146
|
+
Packtory.config[:dependencies][pname] = pver
|
130
147
|
@deps[pname] = pver
|
131
148
|
end
|
132
149
|
end
|
@@ -142,19 +159,22 @@ module Packtory
|
|
142
159
|
packages << :rpm
|
143
160
|
elsif ENV['PACKAGE_OUTPUT'] == 'deb'
|
144
161
|
packages << :deb
|
162
|
+
elsif ENV['PACKAGE_OUTPUT'] == 'tgz'
|
163
|
+
packages << :tgz
|
164
|
+
elsif ENV['PACKAGE_OUTPUT'] == 'brew'
|
165
|
+
packages << :brew
|
145
166
|
else
|
146
|
-
# Debian is the default output
|
147
167
|
packages << :deb
|
148
168
|
end
|
149
169
|
|
150
170
|
say 'Package output : %s' % packages.join(', ')
|
151
|
-
|
171
|
+
Packtory.config[:packages] = packages
|
152
172
|
|
153
173
|
if ENV['PACKAGE_PATH']
|
154
174
|
pkg_path = File.expand_path(ENV['PACKAGE_PATH'])
|
155
175
|
|
156
176
|
say 'Package path : %s' % pkg_path
|
157
|
-
|
177
|
+
Packtory.config[:pkg_path] = pkg_path
|
158
178
|
end
|
159
179
|
|
160
180
|
self
|
@@ -166,7 +186,7 @@ module Packtory
|
|
166
186
|
info_h = {
|
167
187
|
:version => ::Packtory::VERSION,
|
168
188
|
:fpm_version => `#{@fpm_exec_path} -v`.strip
|
169
|
-
}.merge(
|
189
|
+
}.merge(Packtory.config)
|
170
190
|
|
171
191
|
File.open(dump_file, 'w') do |f|
|
172
192
|
f.write(YAML.dump(info_h))
|
@@ -191,14 +211,14 @@ module Packtory
|
|
191
211
|
|
192
212
|
say '=================='
|
193
213
|
|
194
|
-
|
214
|
+
Packtory.setup
|
195
215
|
|
196
216
|
if ENV['TEST_DUMPINFO']
|
197
217
|
test_dumpinfo(argv)
|
198
218
|
elsif ENV['TEST_NOBUILD']
|
199
219
|
# do nothing
|
200
220
|
else
|
201
|
-
|
221
|
+
Packtory.build_package
|
202
222
|
end
|
203
223
|
end
|
204
224
|
|
@@ -0,0 +1,116 @@
|
|
1
|
+
module Packtory
|
2
|
+
class Config
|
3
|
+
DEFAULT_CONFIG = {
|
4
|
+
:path => nil,
|
5
|
+
:pkg_path => nil,
|
6
|
+
:gemspec => nil,
|
7
|
+
:gemfile => nil,
|
8
|
+
:binstub => nil,
|
9
|
+
:bin_path => nil,
|
10
|
+
:install_as_subpath => false,
|
11
|
+
:setup_reset_gem_paths => true,
|
12
|
+
:packages => nil,
|
13
|
+
:architecture => 'all',
|
14
|
+
|
15
|
+
# maybe specified, if wanting to override as set in gemspec file
|
16
|
+
:package_name => nil,
|
17
|
+
:working_path => nil,
|
18
|
+
|
19
|
+
:dependencies => { },
|
20
|
+
:bundle_working_path => nil,
|
21
|
+
|
22
|
+
:fpm_use_ruby_path => nil,
|
23
|
+
:fpm_exec_path => nil,
|
24
|
+
:fpm_exec_verbose => false,
|
25
|
+
:fpm_exec_log => nil,
|
26
|
+
|
27
|
+
:bundler_silent => false,
|
28
|
+
:bundler_local => false,
|
29
|
+
:bundler_include => false
|
30
|
+
}
|
31
|
+
|
32
|
+
DEFAULT_PACKAGES = [ :deb ]
|
33
|
+
PACKTORY_PACKFILE = 'Packfile'
|
34
|
+
|
35
|
+
def self.config
|
36
|
+
if defined?(@@global_config)
|
37
|
+
@@global_config
|
38
|
+
else
|
39
|
+
reset_config!
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.configure
|
44
|
+
yield config
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.reset_config!
|
48
|
+
@@global_config = DEFAULT_CONFIG.merge({ })
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.setup_defaults
|
52
|
+
if ENV.include?('PACKTORY_PACKAGES') && !ENV['PACKTORY_PACKAGES'].empty?
|
53
|
+
config[:packages] = ENV['PACKTORY_PACKAGES'].split(',').collect { |p| p.to_sym }
|
54
|
+
elsif config[:packages].nil?
|
55
|
+
config[:packages] = DEFAULT_PACKAGES
|
56
|
+
end
|
57
|
+
|
58
|
+
if ENV.include?('PACKTORY_BUNDLE_WORKING_PATH')
|
59
|
+
config[:bundle_working_path] = File.expand_path(ENV['PACKTORY_BUNDLE_WORKING_PATH'])
|
60
|
+
end
|
61
|
+
|
62
|
+
unless config[:dependencies].include?('ruby')
|
63
|
+
config[:dependencies]['ruby'] = nil
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.search_up(*names)
|
68
|
+
previous = nil
|
69
|
+
current = File.expand_path(config[:path] || Dir.pwd).untaint
|
70
|
+
found_path = nil
|
71
|
+
|
72
|
+
until !File.directory?(current) || current == previous || !found_path.nil?
|
73
|
+
names.each do |name|
|
74
|
+
path = File.join(current, name)
|
75
|
+
if File.exists?(path)
|
76
|
+
found_path = path
|
77
|
+
break
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
if found_path.nil?
|
82
|
+
previous = current
|
83
|
+
current = File.expand_path("..", current)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
found_path
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.load_packfile
|
91
|
+
packfile_path = nil
|
92
|
+
|
93
|
+
if ENV.include?('PACKTORY_PACKFILE')
|
94
|
+
packfile_path = File.expand_path(ENV['PACKTORY_PACKFILE'])
|
95
|
+
else
|
96
|
+
packfile_path = search_up(PACKTORY_PACKFILE)
|
97
|
+
end
|
98
|
+
|
99
|
+
unless packfile_path.nil?
|
100
|
+
load packfile_path
|
101
|
+
end
|
102
|
+
|
103
|
+
packfile_path
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.load_patch
|
107
|
+
PatchBundlerNoMetadataDeps.patch!
|
108
|
+
end
|
109
|
+
|
110
|
+
def self.setup
|
111
|
+
load_patch
|
112
|
+
load_packfile
|
113
|
+
setup_defaults
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
data/lib/packtory/deb_package.rb
CHANGED
@@ -12,7 +12,11 @@ module Packtory
|
|
12
12
|
package_filename = '%s_%s_%s.deb' % [ packager.package_name, packager.version, packager.architecture ]
|
13
13
|
pkg_file_path = fpm_exec.build(sfiles_map, package_filename, type: :deb)
|
14
14
|
|
15
|
-
|
15
|
+
if File.exist?(pkg_file_path)
|
16
|
+
Bundler.ui.info 'Created package: %s (%s bytes)' % [ pkg_file_path, File.size(pkg_file_path) ]
|
17
|
+
else
|
18
|
+
Bundler.ui.error '[ERROR] Package not found: %s' % [ pkg_file_path ]
|
19
|
+
end
|
16
20
|
|
17
21
|
[ packager, pkg_file_path ]
|
18
22
|
end
|
data/lib/packtory/fpm_exec.rb
CHANGED
@@ -3,14 +3,14 @@ require 'bundler'
|
|
3
3
|
module Packtory
|
4
4
|
class FpmExec
|
5
5
|
def self.fpm_exec_path
|
6
|
-
if !
|
7
|
-
|
6
|
+
if !Packtory.config[:fpm_exec_path].nil? && !Packtory.config[:fpm_exec_path].empty?
|
7
|
+
Packtory.config[:fpm_exec_path]
|
8
8
|
else
|
9
9
|
Packtory.bin_support_fpm_path
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
def initialize(packager, prefix_path)
|
13
|
+
def initialize(packager, prefix_path = nil)
|
14
14
|
@packager = packager
|
15
15
|
@prefix_path = prefix_path
|
16
16
|
end
|
@@ -23,23 +23,29 @@ module Packtory
|
|
23
23
|
|
24
24
|
Bundler.ui.info 'CMD: %s' % cmd
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
else
|
29
|
-
Bundler.clean_system('%s >/dev/null 2>&1' % cmd)
|
26
|
+
unless Packtory.config[:fpm_exec_verbose]
|
27
|
+
cmd = '%s >/dev/null 2>&1' % cmd
|
30
28
|
end
|
31
29
|
|
30
|
+
Bundler.clean_system(cmd)
|
31
|
+
|
32
32
|
pkg_file
|
33
33
|
end
|
34
34
|
|
35
35
|
def build_cmd(sfiles_map, pkg_file, opts = { })
|
36
|
-
cmd = '%s --log %s -f -s dir' % [ self.class.fpm_exec_path,
|
36
|
+
cmd = '%s --log %s -f -s dir' % [ self.class.fpm_exec_path, Packtory.config[:fpm_exec_log] || 'warn' ]
|
37
|
+
|
38
|
+
unless Packtory.config[:fpm_use_ruby_path].nil?
|
39
|
+
cmd = 'env FPM_USE_RUBY_PATH=%s %s' % [ Packtory.config[:fpm_use_ruby_path], cmd ]
|
40
|
+
end
|
37
41
|
|
38
42
|
case opts[:type]
|
39
43
|
when :rpm
|
40
44
|
cmd << ' -t rpm --rpm-os linux'
|
41
45
|
when :deb
|
42
46
|
cmd << ' -t deb'
|
47
|
+
when :tgz
|
48
|
+
cmd << ' -t tar'
|
43
49
|
else
|
44
50
|
raise 'Unsupported type: %s' % opts[:type]
|
45
51
|
end
|
@@ -56,7 +62,7 @@ module Packtory
|
|
56
62
|
|
57
63
|
cmd << ' -p %s --after-install %s --template-scripts %s %s %s' %
|
58
64
|
[ pkg_file,
|
59
|
-
|
65
|
+
Packtory.after_install_script_path,
|
60
66
|
package_dependencies,
|
61
67
|
template_values,
|
62
68
|
source_files_map(sfiles_map) ]
|
@@ -87,9 +93,5 @@ module Packtory
|
|
87
93
|
end
|
88
94
|
end.join(' ')
|
89
95
|
end
|
90
|
-
|
91
|
-
def after_install_script
|
92
|
-
File.expand_path('../../../bin/support/after_install_script', __FILE__)
|
93
|
-
end
|
94
96
|
end
|
95
97
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Packtory
|
2
|
+
module Packages
|
3
|
+
PACKAGE_METHOD_MAP = {
|
4
|
+
:deb => :build_deb,
|
5
|
+
:rpm => :build_rpm,
|
6
|
+
:tgz => :build_tgz,
|
7
|
+
:brew => :build_brew
|
8
|
+
}
|
9
|
+
|
10
|
+
def self.build_package(opts = { })
|
11
|
+
packages = Packtory.config[:packages]
|
12
|
+
built = [ ]
|
13
|
+
|
14
|
+
packages.each do |pack|
|
15
|
+
build_method = PACKAGE_METHOD_MAP[pack]
|
16
|
+
unless build_method.nil?
|
17
|
+
built << send(build_method, opts)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
built
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.build_deb(opts = { })
|
25
|
+
DebPackage.build_package(opts)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.build_rpm(opts = { })
|
29
|
+
RpmPackage.build_package(opts)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.build_tgz(opts = { })
|
33
|
+
TgzPackage.build_package(opts)
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.build_brew(opts = { })
|
37
|
+
BrewPackage.build_package(opts)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/packtory/packer.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'bundler'
|
3
|
+
require 'erb'
|
3
4
|
|
4
5
|
module Packtory
|
5
6
|
class Packer
|
@@ -8,135 +9,7 @@ module Packtory
|
|
8
9
|
BUNDLE_PACKTORY_TOOLS_PATH = 'packtory_tools'
|
9
10
|
BUNDLE_BUNDLER_SETUP_FILE = 'bundler/setup.rb'
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
DEFAULT_CONFIG = {
|
14
|
-
:path => nil,
|
15
|
-
:pkg_path => nil,
|
16
|
-
:gemspec => nil,
|
17
|
-
:gemfile => nil,
|
18
|
-
:binstub => nil,
|
19
|
-
:packages => nil,
|
20
|
-
:architecture => 'all',
|
21
|
-
|
22
|
-
# maybe specified, if wanting to override as set in gemspec file
|
23
|
-
:package_name => nil,
|
24
|
-
:working_path => nil,
|
25
|
-
|
26
|
-
:dependencies => { },
|
27
|
-
:bundle_working_path => nil,
|
28
|
-
|
29
|
-
:fpm_exec_path => nil,
|
30
|
-
:fpm_exec_verbose => false,
|
31
|
-
:fpm_exec_log => nil,
|
32
|
-
|
33
|
-
:bundler_silent => false,
|
34
|
-
:bundler_local => false,
|
35
|
-
:bundler_include => false
|
36
|
-
}
|
37
|
-
|
38
|
-
DEFAULT_PACKAGES = [ :deb, :rpm ]
|
39
|
-
DEFAULT_LOCAL_BIN_PATH = '/usr/local/bin'
|
40
|
-
|
41
|
-
PACKAGE_METHOD_MAP = {
|
42
|
-
:deb => :build_deb,
|
43
|
-
:rpm => :build_rpm
|
44
|
-
}
|
45
|
-
|
46
|
-
def self.load_patch
|
47
|
-
PatchBundlerNoMetadataDeps.patch!
|
48
|
-
end
|
49
|
-
|
50
|
-
def self.setup
|
51
|
-
load_patch
|
52
|
-
load_packfile
|
53
|
-
setup_defaults
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.setup_defaults
|
57
|
-
if ENV.include?('PACKTORY_PACKAGES') && !ENV['PACKTORY_PACKAGES'].empty?
|
58
|
-
config[:packages] = ENV['PACKTORY_PACKAGES'].split(',').collect { |p| p.to_sym }
|
59
|
-
elsif config[:packages].nil?
|
60
|
-
config[:packages] = DEFAULT_PACKAGES
|
61
|
-
end
|
62
|
-
|
63
|
-
if ENV.include?('PACKTORY_BUNDLE_WORKING_PATH')
|
64
|
-
config[:bundle_working_path] = File.expand_path(ENV['PACKTORY_BUNDLE_WORKING_PATH'])
|
65
|
-
end
|
66
|
-
|
67
|
-
unless config[:dependencies].include?('ruby')
|
68
|
-
config[:dependencies]['ruby'] = nil
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def self.load_packfile
|
73
|
-
packfile_path = nil
|
74
|
-
|
75
|
-
if ENV.include?('PACKTORY_PACKFILE')
|
76
|
-
packfile_path = File.expand_path(ENV['PACKTORY_PACKFILE'])
|
77
|
-
else
|
78
|
-
packfile_path = search_up(PACKTORY_PACKFILE)
|
79
|
-
end
|
80
|
-
|
81
|
-
unless packfile_path.nil?
|
82
|
-
load packfile_path
|
83
|
-
end
|
84
|
-
|
85
|
-
packfile_path
|
86
|
-
end
|
87
|
-
|
88
|
-
def self.search_up(*names)
|
89
|
-
previous = nil
|
90
|
-
current = File.expand_path(config[:path] || Dir.pwd).untaint
|
91
|
-
found_path = nil
|
92
|
-
|
93
|
-
until !File.directory?(current) || current == previous || !found_path.nil?
|
94
|
-
names.each do |name|
|
95
|
-
path = File.join(current, name)
|
96
|
-
if File.exists?(path)
|
97
|
-
found_path = path
|
98
|
-
break
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
if found_path.nil?
|
103
|
-
previous = current
|
104
|
-
current = File.expand_path("..", current)
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
found_path
|
109
|
-
end
|
110
|
-
|
111
|
-
def self.configure
|
112
|
-
yield config
|
113
|
-
end
|
114
|
-
|
115
|
-
def self.config
|
116
|
-
if defined?(@@global_config)
|
117
|
-
@@global_config
|
118
|
-
else
|
119
|
-
@@global_config = DEFAULT_CONFIG.merge({ })
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
def self.build_package(opts = { })
|
124
|
-
packages = config[:packages]
|
125
|
-
packages.each do |pack|
|
126
|
-
build_method = PACKAGE_METHOD_MAP[pack]
|
127
|
-
unless build_method.nil?
|
128
|
-
send(build_method, opts)
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
def self.build_deb(opts = { })
|
134
|
-
DebPackage.build_package(opts)
|
135
|
-
end
|
136
|
-
|
137
|
-
def self.build_rpm(opts = { })
|
138
|
-
RpmPackage.build_package(opts)
|
139
|
-
end
|
12
|
+
DEFAULT_BIN_PATH = '/usr/local/bin'
|
140
13
|
|
141
14
|
def self.silence_warnings
|
142
15
|
original_verbosity = $VERBOSE
|
@@ -151,7 +24,7 @@ module Packtory
|
|
151
24
|
attr_reader :gemspec_file
|
152
25
|
|
153
26
|
def initialize(opts = { })
|
154
|
-
@opts =
|
27
|
+
@opts = Packtory.config.merge(opts)
|
155
28
|
|
156
29
|
unless @opts[:gemfile].nil?
|
157
30
|
@gemfile = Pathname.new(@opts[:gemfile])
|
@@ -241,11 +114,13 @@ module Packtory
|
|
241
114
|
cached_gems[spec.name] = spec.source.send(:cached_gem, spec)
|
242
115
|
end
|
243
116
|
|
244
|
-
if
|
117
|
+
if detect_bundler_include
|
245
118
|
bundler_source = Bundler::Source::Rubygems.new('remotes' => 'https://rubygems.org')
|
246
|
-
|
247
|
-
|
248
|
-
|
119
|
+
|
120
|
+
@bundler_spec =
|
121
|
+
Bundler::RemoteSpecification.new('bundler', Bundler::VERSION,
|
122
|
+
Gem::Platform::RUBY, bundler_source.fetchers.first)
|
123
|
+
|
249
124
|
@bundler_spec.remote = Bundler::Source::Rubygems::Remote.new(bundler_source.remotes.first)
|
250
125
|
|
251
126
|
bundler_source.send(:fetch_gem, @bundler_spec)
|
@@ -365,15 +240,25 @@ GEMFILE
|
|
365
240
|
@opts[:architecture]
|
366
241
|
end
|
367
242
|
|
243
|
+
def detect_bundler_include
|
244
|
+
if @opts[:bundler_include]
|
245
|
+
true
|
246
|
+
elsif !gemspec.dependencies.detect { |d| d.name == 'bundler' }.nil?
|
247
|
+
true
|
248
|
+
else
|
249
|
+
false
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
368
253
|
def bundle_gems
|
369
254
|
bgems = { }
|
370
|
-
specs = bundler_definition.specs_for([ :default ])
|
371
255
|
|
256
|
+
specs = bundler_definition.specs_for([ :default ])
|
372
257
|
specs.each do |spec|
|
373
258
|
next if gemspec.nil? || spec.name == gemspec.name
|
374
259
|
|
375
260
|
if spec.name == 'bundler'
|
376
|
-
if
|
261
|
+
if detect_bundler_include
|
377
262
|
spec = @bundler_spec
|
378
263
|
else
|
379
264
|
next
|
@@ -459,48 +344,37 @@ GEMFILE
|
|
459
344
|
files = gather_packtory_tools_for_package(files)
|
460
345
|
end
|
461
346
|
|
347
|
+
files[Packtory.bundler_setup_path] = { :target_path => File.join(BUNDLE_TARGET_PATH, BUNDLE_BUNDLER_SETUP_FILE) }
|
348
|
+
|
462
349
|
files
|
463
350
|
end
|
464
351
|
|
465
352
|
def gather_packtory_tools_for_package(files)
|
466
|
-
gem_build_extensions_path = Packtory.gem_build_extensions_path
|
467
353
|
target_tools_path = File.join(BUNDLE_PACKTORY_TOOLS_PATH)
|
468
354
|
|
355
|
+
gem_build_extensions_path = Packtory.gem_build_extensions_path
|
469
356
|
files[gem_build_extensions_path] = File.join(target_tools_path, File.basename(gem_build_extensions_path))
|
470
357
|
|
358
|
+
after_install_script_path = Packtory.after_install_script_path
|
359
|
+
files[after_install_script_path] = { :target_path => File.join(target_tools_path,
|
360
|
+
File.basename(after_install_script_path)),
|
361
|
+
:values => { 'pg_PACKAGE_PATH' => '$(dirname "$this_dir")' } }
|
362
|
+
|
471
363
|
files
|
472
364
|
end
|
473
365
|
|
474
|
-
def
|
475
|
-
bundle_setup_file = File.join(BUNDLE_TARGET_PATH, BUNDLE_BUNDLER_SETUP_FILE)
|
476
|
-
bundle_setup_path = File.join(package_working_path, package_name, bundle_setup_file)
|
477
|
-
|
478
|
-
FileUtils.mkpath(File.dirname(bundle_setup_path))
|
479
|
-
|
366
|
+
def for_each_bundle_gems(&block)
|
480
367
|
bgems = bundle_gems
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
f.puts '# == Gem: %s, version: %s' % [ spec.name, spec.version ]
|
488
|
-
|
489
|
-
src_paths = bhash[:require_paths]
|
490
|
-
if src_paths.count > 0
|
491
|
-
rpaths = src_paths.dup
|
492
|
-
else
|
493
|
-
rpaths = [ '/lib' ]
|
494
|
-
end
|
495
|
-
|
496
|
-
rpaths.each do |rpath|
|
497
|
-
load_path_line = "$:.unshift File.expand_path('../../%s%s', __FILE__)" % [ gem_name, rpath ]
|
498
|
-
f.puts(load_path_line)
|
499
|
-
end
|
368
|
+
bgems.each do |gem_name, bhash|
|
369
|
+
src_paths = bhash[:require_paths]
|
370
|
+
if src_paths.count > 0
|
371
|
+
rpaths = src_paths.dup
|
372
|
+
else
|
373
|
+
rpaths = [ '/lib' ]
|
500
374
|
end
|
501
|
-
end
|
502
375
|
|
503
|
-
|
376
|
+
yield(gem_name, bhash, rpaths)
|
377
|
+
end
|
504
378
|
end
|
505
379
|
|
506
380
|
def gather_files
|
@@ -514,27 +388,76 @@ GEMFILE
|
|
514
388
|
|
515
389
|
files = gather_files_for_package
|
516
390
|
files.each do |fsrc, ftarget|
|
391
|
+
tvalues = nil
|
392
|
+
|
517
393
|
if fsrc =~ /^\//
|
518
394
|
fsrc_path = fsrc
|
519
|
-
|
520
|
-
|
395
|
+
else
|
396
|
+
fsrc_path = File.join(root_path, fsrc)
|
521
397
|
end
|
522
398
|
|
523
|
-
|
399
|
+
case ftarget
|
400
|
+
when String
|
401
|
+
ftarget_path = File.join(prefix_path, ftarget)
|
402
|
+
when Hash
|
403
|
+
ftarget_path = File.join(prefix_path, ftarget[:target_path])
|
404
|
+
tvalues = ftarget[:values]
|
405
|
+
end
|
524
406
|
|
525
407
|
FileUtils.mkpath(File.dirname(ftarget_path))
|
526
408
|
FileUtils.cp_r(fsrc_path, ftarget_path)
|
527
|
-
end
|
528
409
|
|
529
|
-
|
530
|
-
|
410
|
+
if ftarget.is_a?(Hash)
|
411
|
+
tf = TemplateFile.new(self, ftarget_path, tvalues)
|
412
|
+
tf.evaluate!
|
413
|
+
end
|
414
|
+
|
415
|
+
ftarget_path
|
416
|
+
end
|
531
417
|
|
532
418
|
files
|
533
419
|
end
|
534
420
|
|
421
|
+
class TemplateFile
|
422
|
+
def initialize(packer, file_path, tvalues)
|
423
|
+
@packer = packer
|
424
|
+
@file_path = file_path
|
425
|
+
@tvalues = tvalues
|
426
|
+
end
|
427
|
+
|
428
|
+
def evaluate!
|
429
|
+
erb = ERB.new(File.read(@file_path), nil, '-', '@output_buffer')
|
430
|
+
File.write(@file_path, erb.result(binding))
|
431
|
+
|
432
|
+
@file_path
|
433
|
+
end
|
434
|
+
|
435
|
+
def packer; @packer; end
|
436
|
+
|
437
|
+
def concat(str)
|
438
|
+
@output_buffer << str
|
439
|
+
end
|
440
|
+
|
441
|
+
private
|
442
|
+
|
443
|
+
def method_missing(k, *args)
|
444
|
+
if @tvalues.nil?
|
445
|
+
super
|
446
|
+
elsif @tvalues.include?(k.to_s)
|
447
|
+
@tvalues[k.to_s]
|
448
|
+
elsif @tvalues.include?(k)
|
449
|
+
@tvalues[k]
|
450
|
+
else
|
451
|
+
super
|
452
|
+
end
|
453
|
+
end
|
454
|
+
end
|
455
|
+
|
535
456
|
def create_binstub(binstub_fname, prefix_path)
|
536
457
|
binstub_code = <<CODE
|
537
|
-
#!/usr/bin/
|
458
|
+
#!/usr/bin/ruby
|
459
|
+
|
460
|
+
ENV['RUBY_PATH'] = '/usr/bin/ruby'
|
538
461
|
|
539
462
|
require "%s"
|
540
463
|
load "%s"
|
@@ -543,10 +466,16 @@ CODE
|
|
543
466
|
src_bin_path = File.join(package_working_path, 'bin', binstub_fname)
|
544
467
|
FileUtils.mkpath(File.dirname(src_bin_path))
|
545
468
|
|
546
|
-
|
469
|
+
if @opts[:install_as_subpath]
|
470
|
+
target_path = File.join(prefix_path, package_name, package_name)
|
471
|
+
else
|
472
|
+
target_path = File.join(prefix_path, package_name)
|
473
|
+
end
|
474
|
+
|
475
|
+
bundler_setup_path = File.join(target_path, BUNDLE_TARGET_PATH, BUNDLE_BUNDLER_SETUP_FILE)
|
547
476
|
|
548
477
|
bindir_name = gemspec.nil? ? 'bin' : gemspec.bindir
|
549
|
-
actual_bin_path = File.join(
|
478
|
+
actual_bin_path = File.join(target_path, bindir_name, binstub_fname)
|
550
479
|
|
551
480
|
File.open(src_bin_path, 'w') { |f| f.write(binstub_code % [ bundler_setup_path, actual_bin_path ]) }
|
552
481
|
FileUtils.chmod(0755, src_bin_path)
|
@@ -554,27 +483,25 @@ CODE
|
|
554
483
|
src_bin_path
|
555
484
|
end
|
556
485
|
|
557
|
-
def
|
486
|
+
def build_file_map(prefix_path, package_path = nil)
|
558
487
|
files = { }
|
559
488
|
|
560
489
|
source_path = File.join(package_working_path, package_name, '/')
|
561
|
-
target_path = File.join(prefix_path, package_name)
|
490
|
+
target_path = File.join(package_path || prefix_path, package_name)
|
562
491
|
files[source_path] = target_path
|
563
492
|
|
564
493
|
files
|
565
494
|
end
|
566
495
|
|
567
|
-
def
|
568
|
-
|
569
|
-
|
570
|
-
files = build_source_files(prefix_path)
|
496
|
+
def add_bin_files(files, prefix_path, package_path = nil)
|
497
|
+
bin_path = @opts[:bin_path] || DEFAULT_BIN_PATH
|
571
498
|
|
572
499
|
if @opts[:binstub].nil?
|
573
500
|
unless gemspec.nil? || gemspec.executables.nil? || gemspec.executables.empty?
|
574
501
|
@opts[:binstub] = { }
|
575
502
|
|
576
503
|
gemspec.executables.each do |exec_fname|
|
577
|
-
@opts[:binstub][exec_fname] = File.join(
|
504
|
+
@opts[:binstub][exec_fname] = File.join(bin_path, exec_fname)
|
578
505
|
end
|
579
506
|
end
|
580
507
|
end
|
@@ -586,5 +513,14 @@ CODE
|
|
586
513
|
|
587
514
|
files
|
588
515
|
end
|
516
|
+
|
517
|
+
def prepare_files(prefix_path, package_path = nil)
|
518
|
+
gather_files
|
519
|
+
|
520
|
+
files = build_file_map(prefix_path, package_path)
|
521
|
+
files = add_bin_files(files, prefix_path, package_path)
|
522
|
+
|
523
|
+
files
|
524
|
+
end
|
589
525
|
end
|
590
526
|
end
|
data/lib/packtory/rpm_package.rb
CHANGED
@@ -12,7 +12,11 @@ module Packtory
|
|
12
12
|
package_filename = '%s_%s_%s.rpm' % [ packager.package_name, packager.version, packager.architecture ]
|
13
13
|
pkg_file_path = fpm_exec.build(sfiles_map, package_filename, type: :rpm)
|
14
14
|
|
15
|
-
|
15
|
+
if File.exist?(pkg_file_path)
|
16
|
+
Bundler.ui.info 'Created package: %s (%s bytes)' % [ pkg_file_path, File.size(pkg_file_path) ]
|
17
|
+
else
|
18
|
+
Bundler.ui.error '[ERROR] Package not found: %s' % [ pkg_file_path ]
|
19
|
+
end
|
16
20
|
|
17
21
|
[ packager, pkg_file_path ]
|
18
22
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
|
3
|
+
module Packtory
|
4
|
+
class TgzPackage
|
5
|
+
INSTALL_PREFIX = '.'
|
6
|
+
|
7
|
+
def self.build_package(opts = { })
|
8
|
+
packager = Packer.new({ :binstub => { } }.merge(opts))
|
9
|
+
fpm_exec = FpmExec.new(packager, INSTALL_PREFIX)
|
10
|
+
|
11
|
+
sfiles_map = packager.prepare_files(INSTALL_PREFIX)
|
12
|
+
package_filename = '%s_%s_%s.tar.gz' % [ packager.package_name, packager.version, packager.architecture ]
|
13
|
+
pkg_file_path = fpm_exec.build(sfiles_map, package_filename, type: :tgz)
|
14
|
+
|
15
|
+
if File.exist?(pkg_file_path)
|
16
|
+
Bundler.ui.info 'Created package: %s (%s bytes)' % [ pkg_file_path, File.size(pkg_file_path) ]
|
17
|
+
else
|
18
|
+
Bundler.ui.error '[ERROR] Package not found: %s' % [ pkg_file_path ]
|
19
|
+
end
|
20
|
+
|
21
|
+
[ packager, pkg_file_path ]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/packtory/version.rb
CHANGED
data/lib/packtory.rb
CHANGED
@@ -4,15 +4,37 @@ module Packtory
|
|
4
4
|
autoload :VERSION, File.expand_path('../packtory/version', __FILE__)
|
5
5
|
autoload :Command, File.expand_path('../packtory/command', __FILE__)
|
6
6
|
|
7
|
+
autoload :Config, File.expand_path('../packtory/config', __FILE__)
|
8
|
+
|
7
9
|
autoload :PatchBundlerNoMetadataDeps, File.expand_path('../packtory/patch_bundler_no_metadata_deps', __FILE__)
|
8
|
-
autoload :DebPackage, File.expand_path('../packtory/deb_package', __FILE__)
|
9
|
-
autoload :RpmPackage, File.expand_path('../packtory/rpm_package', __FILE__)
|
10
10
|
autoload :FpmExec, File.expand_path('../packtory/fpm_exec', __FILE__)
|
11
11
|
autoload :Packer, File.expand_path('../packtory/packer', __FILE__)
|
12
12
|
|
13
|
+
autoload :Packages, File.expand_path('../packtory/packages', __FILE__)
|
14
|
+
autoload :DebPackage, File.expand_path('../packtory/deb_package', __FILE__)
|
15
|
+
autoload :RpmPackage, File.expand_path('../packtory/rpm_package', __FILE__)
|
16
|
+
autoload :TgzPackage, File.expand_path('../packtory/tgz_package', __FILE__)
|
17
|
+
autoload :BrewPackage, File.expand_path('../packtory/brew_package', __FILE__)
|
18
|
+
|
13
19
|
# TODO: Evaluate and refactor
|
14
20
|
autoload :RakeTask, File.expand_path('../packtory/rake_task', __FILE__)
|
15
21
|
|
22
|
+
def self.config
|
23
|
+
Config.config
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.setup
|
27
|
+
Config.setup
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.build_package
|
31
|
+
Packages.build_package
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.after_install_script_path
|
35
|
+
File.expand_path('../../bin/support/after_install_script', __FILE__)
|
36
|
+
end
|
37
|
+
|
16
38
|
def self.gem_build_extensions_path
|
17
39
|
File.expand_path('../../bin/support/gem_build_extensions', __FILE__)
|
18
40
|
end
|
@@ -20,4 +42,8 @@ module Packtory
|
|
20
42
|
def self.bin_support_fpm_path
|
21
43
|
File.expand_path('../../bin/support/fpm', __FILE__)
|
22
44
|
end
|
45
|
+
|
46
|
+
def self.bundler_setup_path
|
47
|
+
File.expand_path('../packtory/bundler/setup.rb', __FILE__)
|
48
|
+
end
|
23
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packtory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark John Buenconsejo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,10 +38,8 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description:
|
42
|
-
|
43
|
-
gems. Build package for Debian, RPM, and _soon_ Homebrew, directly
|
44
|
-
from your gem repo.
|
41
|
+
description: An easy to use system packaging tool for your Ruby gems. Build package
|
42
|
+
for Debian, RPM, and _soon_ Homebrew, directly from your gem repo.
|
45
43
|
email: hello@gemfury.com
|
46
44
|
executables:
|
47
45
|
- packtory
|
@@ -55,13 +53,18 @@ files:
|
|
55
53
|
- bin/support/fpm_vendor_ruby
|
56
54
|
- bin/support/gem_build_extensions
|
57
55
|
- lib/packtory.rb
|
56
|
+
- lib/packtory/brew_package.rb
|
57
|
+
- lib/packtory/bundler/setup.rb
|
58
58
|
- lib/packtory/command.rb
|
59
|
+
- lib/packtory/config.rb
|
59
60
|
- lib/packtory/deb_package.rb
|
60
61
|
- lib/packtory/fpm_exec.rb
|
62
|
+
- lib/packtory/packages.rb
|
61
63
|
- lib/packtory/packer.rb
|
62
64
|
- lib/packtory/patch_bundler_no_metadata_deps.rb
|
63
65
|
- lib/packtory/rake_task.rb
|
64
66
|
- lib/packtory/rpm_package.rb
|
67
|
+
- lib/packtory/tgz_package.rb
|
65
68
|
- lib/packtory/version.rb
|
66
69
|
homepage: https://gemfury.com
|
67
70
|
licenses:
|