luban 0.12.12 → 0.12.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3816179cd320d9eb87ffe5d9e3a29d8515ff1cc
4
- data.tar.gz: 4f33f9199c8feb67c88b3a7c80af6995146f14a0
3
+ metadata.gz: f5f0a64c0cd90e48eebf70a7c706705b22214a55
4
+ data.tar.gz: cd0036d33277566d293feb38fc6bf5ae2d9df710
5
5
  SHA512:
6
- metadata.gz: 615cedf6860798c0e537886e712f64148fa62b4c6722f60e7aafe213adcf67b7150b563b5211b07d33a260444408b6995bbda6923630ea5ee5042866d3d09231
7
- data.tar.gz: 87bafdb3fd139a8319e023c591b7720fb39ff5486193c037b056cd402c74d7031103f2981e875ebf79a5fa1b55562ae11338701f5bc3f9fd60384bc59ca44de5
6
+ metadata.gz: 585a1e54eaea118dc65dfdeaf4ca6140be0cee54c19f816bc54186adc1968a09852a9614c494a6ef9a326c9426a22b495ee87b3fc92c08678407975cdfb62a13
7
+ data.tar.gz: 560a626d2db90a296ae1d55cdb61bd2966216ece025f5dc72c657dbcdc8d21c7ef06db548c027d9197f965a59aab3f693f4d9c37ce13d1720f5d9355705e1f9d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.12.13 (Jul 10, 2017)
4
+
5
+ Minor enahancements:
6
+ * Added optional package dependency of Jemalloc for Ruby installer
7
+ * Made custom uncompress format of tar in package installer
8
+
3
9
  ## Version 0.12.12 (Mar 30, 2017)
4
10
 
5
11
  Minor enhancements:
@@ -4,6 +4,16 @@ module Luban
4
4
  class Installer
5
5
  class InstallFailure < Luban::Deployment::Error; end
6
6
 
7
+ UncompressOptions = {
8
+ ".gz" => "-z", ".tgz" => "-z", ".taz" => "-z", # gzip
9
+ ".Z" => "-Z", ".taZ" => "-Z", # compress
10
+ ".bz2" => "-j", ".tz2" => "-j", ".tbz2" => "-j", ".tbz" => "-j", # bzip2
11
+ ".lz" => "--lzip", # lzip
12
+ ".lzma" => "--lzma", ".tlz" => "--lzma", # lzma
13
+ ".lzo" => "--lzop", # lzop
14
+ ".xz" => "J" # xz
15
+ }
16
+
7
17
  def src_file_md5
8
18
  @src_file_md5 ||= File.file?(src_md5_file_path) ? File.read(src_md5_file_path).chomp : ''
9
19
  end
@@ -347,8 +357,12 @@ module Luban
347
357
  uncompress_package!
348
358
  end
349
359
 
360
+ def uncompress_option
361
+ @uncompress_option ||= UncompressOptions[File.extname(src_file_name)]
362
+ end
363
+
350
364
  def uncompress_package!
351
- unless test("tar -xzf #{src_cache_path} -C #{package_tmp_path} >> #{install_log_file_path} 2>&1")
365
+ unless test("tar #{uncompress_option} -xf #{src_cache_path} -C #{package_tmp_path} >> #{install_log_file_path} 2>&1")
352
366
  abort_action('uncompress')
353
367
  end
354
368
  end
@@ -0,0 +1,56 @@
1
+ module Luban
2
+ module Deployment
3
+ module Packages
4
+ class Jemalloc < Luban::Deployment::Package::Base
5
+ protected
6
+
7
+ def setup_provision_tasks
8
+ super
9
+ provision_tasks[:install].switch :enable_debug, "Build debugging code"
10
+ provision_tasks[:install].switch :jemalloc_prefix, "Prefix to prepend to all public APIs"
11
+ end
12
+
13
+ class Installer < Luban::Deployment::Package::Installer
14
+ define_executable 'jemalloc-config'
15
+
16
+ def source_repo
17
+ @source_repo ||= "https://github.com"
18
+ end
19
+
20
+ def source_url_root
21
+ @source_url_root ||= "jemalloc/jemalloc/releases/download/#{package_version}"
22
+ end
23
+
24
+ def src_file_extname
25
+ @src_file_extname ||= 'tar.bz2'
26
+ end
27
+
28
+ def installed?
29
+ return false unless file?(jemalloc_config_executable)
30
+ match?("#{jemalloc_config_executable} --version", package_version)
31
+ end
32
+
33
+ def enable_debug?
34
+ task.opts.enable_debug
35
+ end
36
+
37
+ def jemalloc_prefix
38
+ task.opts.jemalloc_prefix
39
+ end
40
+
41
+ protected
42
+
43
+ def configure_build_options
44
+ super
45
+ @configure_opts.push("--disable-debug") unless enable_debug?
46
+ @configure_opts.push("--with-jemalloc-prefix=#{jemalloc_prefix}")
47
+ end
48
+
49
+ def uncompress_option
50
+ @uncompress_option ||= 'j'
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -62,6 +62,14 @@ module Luban
62
62
  end
63
63
  end
64
64
 
65
+ apply_to '>= 2.2.0' do
66
+ before_install do
67
+ unless ENV['NO_JEMALLOC']
68
+ depend_on 'jemalloc', version: '5.0.1'
69
+ end
70
+ end
71
+ end
72
+
65
73
  apply_to :all do
66
74
  after_install do
67
75
  depend_on 'bundler', version: '1.14.4'
@@ -79,7 +87,6 @@ module Luban
79
87
 
80
88
  def setup_provision_tasks
81
89
  super
82
-
83
90
  provision_tasks[:install].switch :install_static, "Install static Ruby library"
84
91
  provision_tasks[:install].switch :install_doc, "Install Ruby document"
85
92
  provision_tasks[:install].switch :install_tcl, "Install with Tcl"
@@ -87,6 +94,7 @@ module Luban
87
94
  provision_tasks[:install].option :rubygems, "Rubygems version"
88
95
  provision_tasks[:install].option :bundler, "Bundler version"
89
96
  provision_tasks[:install].option :openssl, "OpenSSL version (effective for v1.9.3 or above)"
97
+ provision_tasks[:install].option :jemalloc, "Jemalloc version (effective for v2.2.0 or above)"
90
98
  end
91
99
 
92
100
  class Installer < Luban::Deployment::Package::Installer
@@ -137,6 +145,12 @@ module Luban
137
145
  alias_method :with_openssl_dir, :with_opt_dir
138
146
  alias_method :with_yaml_dir, :with_opt_dir
139
147
 
148
+ def with_jemalloc_dir(dir)
149
+ with_opt_dir(dir)
150
+ @configure_opts << "--with-jemalloc"
151
+ @configure_opts << "LDFLAGS=\"-Wl,-rpath -Wl,#{dir.join('lib')}\""
152
+ end
153
+
140
154
  protected
141
155
 
142
156
  def configure_build_options
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.12.12"
3
+ VERSION = "0.12.13"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.12
4
+ version: 0.12.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Lei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2017-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban-cli
@@ -152,6 +152,7 @@ files:
152
152
  - lib/luban/deployment/packages/curl.rb
153
153
  - lib/luban/deployment/packages/gem.rb
154
154
  - lib/luban/deployment/packages/git.rb
155
+ - lib/luban/deployment/packages/jemalloc.rb
155
156
  - lib/luban/deployment/packages/logrotate.rb
156
157
  - lib/luban/deployment/packages/openssl.rb
157
158
  - lib/luban/deployment/packages/popt.rb