File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ The following attributes are platform-specific.
58
58
* ` node['git']['version'] ` - git version to install
59
59
* ` node['git']['url'] ` - URL to git tarball
60
60
* ` node['git']['checksum'] ` - tarball SHA256 checksum
61
+ * ` node['git']['use_pcre'] ` - if true, builds git with PCRE enabled
61
62
62
63
Recipes
63
64
=======
Original file line number Diff line number Diff line change 34
34
default [ 'git' ] [ 'version' ] = '1.9.5'
35
35
default [ 'git' ] [ 'url' ] = "https://nodeload.github.com/git/git/tar.gz/v#{ node [ 'git' ] [ 'version' ] } "
36
36
default [ 'git' ] [ 'checksum' ] = '0f30984828d573da01d9f8e78210d5f4c56da1697fd6d278bad4cfa4c22ba271'
37
+ default [ 'git' ] [ 'use_pcre' ] = false
37
38
end
38
39
39
40
default [ 'git' ] [ 'server' ] [ 'base_path' ] = '/srv/git'
Original file line number Diff line number Diff line change @@ -20,13 +20,17 @@ class Source < Chef::Provider::GitClient
20
20
case node [ 'platform_version' ] . to_i
21
21
when 5
22
22
pkgs = %w( expat-devel gettext-devel curl-devel openssl-devel zlib-devel )
23
+ pkgs += %w{ pcre-devel } if node [ 'git' ] [ 'use_pcre' ]
23
24
when 6 , 7
24
25
pkgs = %w( expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel )
26
+ pkgs += %w{ pcre-devel } if node [ 'git' ] [ 'use_pcre' ]
25
27
else
26
28
pkgs = %w( expat-devel gettext-devel curl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel ) if node [ 'platform' ] == 'amazon'
29
+ pkgs += %w{ pcre-devel } if node [ 'git' ] [ 'use_pcre' ]
27
30
end
28
31
when 'debian'
29
32
pkgs = %w( libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev )
33
+ pkgs += %w{ libpcre3-dev } if node [ 'git' ] [ 'use_pcre' ]
30
34
end
31
35
32
36
pkgs . each do |pkg |
@@ -44,9 +48,11 @@ class Source < Chef::Provider::GitClient
44
48
# reduce line-noise-eyness
45
49
execute "Extracting and Building Git #{ node [ 'git' ] [ 'version' ] } from Source" do
46
50
cwd Chef ::Config [ 'file_cache_path' ]
51
+ additional_make_params = ""
52
+ additional_make_params += "USE_LIBPCRE=1" if node [ 'git' ] [ 'use_pcre' ]
47
53
command <<-COMMAND
48
54
(mkdir git-#{ node [ 'git' ] [ 'version' ] } && tar -zxf git-#{ node [ 'git' ] [ 'version' ] } .tar.gz -C git-#{ node [ 'git' ] [ 'version' ] } --strip-components 1)
49
- (cd git-#{ node [ 'git' ] [ 'version' ] } && make prefix=#{ node [ 'git' ] [ 'prefix' ] } install)
55
+ (cd git-#{ node [ 'git' ] [ 'version' ] } && make prefix=#{ node [ 'git' ] [ 'prefix' ] } #{ additional_make_params } install)
50
56
COMMAND
51
57
not_if "git --version | grep #{ node [ 'git' ] [ 'version' ] } "
52
58
end
You can’t perform that action at this time.
0 commit comments