vault-tree 0.3.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. data/.gitignore +3 -0
  2. data/.rspec +1 -0
  3. data/CHANGE_LOG.md +27 -0
  4. data/README.md +15 -73
  5. data/features/contracts/asymmetric_vault.feature +69 -2
  6. data/features/contracts/block_chain_key_transfer.feature +59 -0
  7. data/features/contracts/one_two_three.feature +109 -1
  8. data/features/contracts/readme.md +5 -6
  9. data/features/contracts_and_vaults.md +19 -24
  10. data/features/decision_tree.md +1 -1
  11. data/features/exceptions.feature +54 -43
  12. data/features/install_and_usage.md +38 -33
  13. data/features/keywords/assembled_shamir_key.feature +17 -17
  14. data/features/keywords/dh_key.feature +5 -5
  15. data/features/keywords/external_input.feature +35 -0
  16. data/features/keywords/external_key.feature +24 -0
  17. data/features/keywords/key.feature +3 -3
  18. data/features/keywords/random_number.feature +3 -3
  19. data/features/keywords/shamir_key_shares.feature +29 -0
  20. data/features/keywords/shamir_share.feature +40 -0
  21. data/features/keywords/split_key.feature +10 -9
  22. data/features/keywords/unlocked.feature +3 -3
  23. data/features/readme.md +1 -1
  24. data/features/steps/asymmetric_vault.steps.rb +14 -21
  25. data/features/steps/block_chain_key_transfer.steps.rb +17 -22
  26. data/features/steps/core.steps.rb +60 -71
  27. data/features/steps/exceptions.steps.rb +27 -64
  28. data/features/steps/external_input.steps.rb +17 -0
  29. data/features/steps/one_two_three.steps.rb +21 -27
  30. data/features/steps/secret_sharing.steps.rb +36 -19
  31. data/lib/vault-tree.rb +1 -1
  32. data/lib/vault-tree/contract/content_ciphertext.rb +33 -0
  33. data/lib/vault-tree/contract/content_plaintext.rb +33 -0
  34. data/lib/vault-tree/contract/contract.rb +15 -72
  35. data/lib/vault-tree/contract/contract_header.rb +11 -0
  36. data/lib/vault-tree/contract/vault.rb +24 -74
  37. data/lib/vault-tree/contract/vault_key.rb +21 -0
  38. data/lib/vault-tree/contract/vault_list.rb +56 -0
  39. data/lib/vault-tree/exceptions/empty_vault.rb +18 -3
  40. data/lib/vault-tree/exceptions/failed_lock_attempt.rb +18 -0
  41. data/lib/vault-tree/exceptions/failed_unlock_attempt.rb +23 -1
  42. data/lib/vault-tree/exceptions/invalid_external_input.rb +16 -0
  43. data/lib/vault-tree/exceptions/{missing_passphrase.rb → invalid_shamir_split.rb} +2 -1
  44. data/lib/vault-tree/exceptions/library_exception.rb +64 -0
  45. data/lib/vault-tree/exceptions/missing_partner_decryption_key.rb +11 -1
  46. data/lib/vault-tree/exceptions/unsupported_keyword.rb +17 -1
  47. data/lib/vault-tree/exceptions/vault_does_not_exist.rb +8 -1
  48. data/lib/vault-tree/keywords/assembled_shamir_key.rb +1 -1
  49. data/lib/vault-tree/keywords/contents.rb +1 -1
  50. data/lib/vault-tree/keywords/dh_key.rb +2 -2
  51. data/lib/vault-tree/keywords/external_input.rb +58 -0
  52. data/lib/vault-tree/keywords/external_key.rb +20 -0
  53. data/lib/vault-tree/keywords/key.rb +7 -1
  54. data/lib/vault-tree/keywords/keyword_interpreter.rb +5 -3
  55. data/lib/vault-tree/keywords/public_encryption_key.rb +1 -5
  56. data/lib/vault-tree/keywords/shamir_key_shares.rb +18 -0
  57. data/lib/vault-tree/keywords/shamir_share.rb +18 -0
  58. data/lib/vault-tree/keywords/split_key.rb +1 -1
  59. data/lib/vault-tree/lock_smith.rb +7 -8
  60. data/lib/vault-tree/lock_smith/{generated_shamir_key.rb → shamir_key_shares.rb} +22 -21
  61. data/lib/vault-tree/lock_smith/{split_key.rb → split_key_crypto.rb} +0 -0
  62. data/lib/vault-tree/version.rb +1 -1
  63. data/spec/assembled_shamir_key_spec.rb +0 -1
  64. data/spec/custom_exception_spec.rb +81 -0
  65. data/spec/lock_smith_spec.rb +0 -48
  66. data/spec/secret_sharing_spec.rb +0 -1
  67. data/spec/shamir_key_shares_spec.rb +27 -0
  68. data/vault-tree.gemspec +1 -1
  69. metadata +33 -139
  70. data/Gemfile.lock +0 -53
  71. data/VagrantFile +0 -30
  72. data/features/keywords/external_data.feature +0 -11
  73. data/features/keywords/generated_shamir_key.feature +0 -55
  74. data/features/keywords/master_passphrase.feature +0 -68
  75. data/features/manipulating_contracts.md +0 -84
  76. data/features/support/contract_fixtures/asymmetric_vault.0.1.0.json +0 -69
  77. data/features/support/contract_fixtures/blank_simple_test_contract.json +0 -14
  78. data/features/support/contract_fixtures/block_chain_key_transfer.0.1.0.json +0 -59
  79. data/features/support/contract_fixtures/broken_contract.json +0 -55
  80. data/features/support/contract_fixtures/one_two_three.0.7.0.json +0 -108
  81. data/features/support/contract_fixtures/simple_test_contract.json +0 -14
  82. data/features/support/contract_fixtures/template.json +0 -33
  83. data/lib/vault-tree/contract/close_validator.rb +0 -28
  84. data/lib/vault-tree/contract/doorman.rb +0 -113
  85. data/lib/vault-tree/contract/open_validator.rb +0 -20
  86. data/lib/vault-tree/exceptions/exception_template.erb +0 -0
  87. data/lib/vault-tree/exceptions/fill_attempt_master_password.rb +0 -6
  88. data/lib/vault-tree/exceptions/missing_external_data.rb +0 -6
  89. data/lib/vault-tree/exceptions/vault_tree_exception.rb +0 -25
  90. data/lib/vault-tree/keywords/external_data.rb +0 -32
  91. data/lib/vault-tree/keywords/generated_shamir_key.rb +0 -57
  92. data/lib/vault-tree/keywords/master_passphrase.rb +0 -9
  93. data/spec/generated_shamir_key_spec.rb +0 -52
  94. data/support/cookbooks/ark/.gitignore +0 -12
  95. data/support/cookbooks/ark/.kitchen.yml +0 -34
  96. data/support/cookbooks/ark/.travis.yml +0 -6
  97. data/support/cookbooks/ark/Berksfile +0 -9
  98. data/support/cookbooks/ark/CHANGELOG.md +0 -87
  99. data/support/cookbooks/ark/CONTRIBUTING.md +0 -257
  100. data/support/cookbooks/ark/README.md +0 -301
  101. data/support/cookbooks/ark/Rakefile +0 -36
  102. data/support/cookbooks/ark/TESTING.md +0 -25
  103. data/support/cookbooks/ark/Toftfile +0 -15
  104. data/support/cookbooks/ark/attributes/default.rb +0 -6
  105. data/support/cookbooks/ark/chefignore +0 -96
  106. data/support/cookbooks/ark/files/default/foo.tar.gz +0 -0
  107. data/support/cookbooks/ark/files/default/foo.tbz +0 -0
  108. data/support/cookbooks/ark/files/default/foo.tgz +0 -0
  109. data/support/cookbooks/ark/files/default/foo.zip +0 -0
  110. data/support/cookbooks/ark/files/default/tests/minitest/default_test.rb +0 -0
  111. data/support/cookbooks/ark/files/default/tests/minitest/support/helpers.rb +0 -0
  112. data/support/cookbooks/ark/files/default/tests/minitest/test_test.rb +0 -94
  113. data/support/cookbooks/ark/libraries/default.rb +0 -167
  114. data/support/cookbooks/ark/metadata.rb +0 -13
  115. data/support/cookbooks/ark/providers/default.rb +0 -370
  116. data/support/cookbooks/ark/recipes/default.rb +0 -31
  117. data/support/cookbooks/ark/recipes/test.rb +0 -138
  118. data/support/cookbooks/ark/resources/default.rb +0 -54
  119. data/support/cookbooks/ark/templates/default/add_to_path.sh.erb +0 -1
  120. data/support/cookbooks/ark/test/support/Gemfile +0 -4
  121. data/support/cookbooks/build-essential/README.md +0 -24
  122. data/support/cookbooks/build-essential/metadata.rb +0 -10
  123. data/support/cookbooks/build-essential/recipes/default.rb +0 -45
  124. data/support/cookbooks/chruby/.gitignore +0 -15
  125. data/support/cookbooks/chruby/.kitchen.yml +0 -26
  126. data/support/cookbooks/chruby/.ruby_version +0 -1
  127. data/support/cookbooks/chruby/Berksfile +0 -3
  128. data/support/cookbooks/chruby/Gemfile +0 -7
  129. data/support/cookbooks/chruby/LICENSE +0 -14
  130. data/support/cookbooks/chruby/README.md +0 -92
  131. data/support/cookbooks/chruby/Rakefile +0 -7
  132. data/support/cookbooks/chruby/Thorfile +0 -6
  133. data/support/cookbooks/chruby/Vagrantfile +0 -86
  134. data/support/cookbooks/chruby/attributes/default.rb +0 -10
  135. data/support/cookbooks/chruby/chefignore +0 -96
  136. data/support/cookbooks/chruby/metadata.rb +0 -11
  137. data/support/cookbooks/chruby/recipes/default.rb +0 -43
  138. data/support/cookbooks/chruby/recipes/system.rb +0 -25
  139. data/support/cookbooks/chruby/templates/default/chruby.sh.erb +0 -22
  140. data/support/cookbooks/chruby/test/integration/default/bash/embedded_test.sh +0 -1
  141. data/support/cookbooks/git/.gitignore +0 -14
  142. data/support/cookbooks/git/.kitchen.yml +0 -46
  143. data/support/cookbooks/git/Berksfile +0 -8
  144. data/support/cookbooks/git/CHANGELOG.md +0 -87
  145. data/support/cookbooks/git/CONTRIBUTING +0 -29
  146. data/support/cookbooks/git/Gemfile +0 -3
  147. data/support/cookbooks/git/LICENSE +0 -201
  148. data/support/cookbooks/git/README.md +0 -115
  149. data/support/cookbooks/git/TESTING.md +0 -25
  150. data/support/cookbooks/git/attributes/default.rb +0 -40
  151. data/support/cookbooks/git/metadata.rb +0 -35
  152. data/support/cookbooks/git/recipes/default.rb +0 -53
  153. data/support/cookbooks/git/recipes/server.rb +0 -58
  154. data/support/cookbooks/git/recipes/source.rb +0 -49
  155. data/support/cookbooks/git/recipes/windows.rb +0 -37
  156. data/support/cookbooks/git/templates/default/git-xinetd.d.erb +0 -10
  157. data/support/cookbooks/git/templates/default/sv-git-daemon-log-run.erb +0 -2
  158. data/support/cookbooks/git/templates/default/sv-git-daemon-run.erb +0 -3
  159. data/support/cookbooks/install_ruby/README.md +0 -3
  160. data/support/cookbooks/install_ruby/metadata.rb +0 -10
  161. data/support/cookbooks/install_ruby/recipes/default.rb +0 -14
  162. data/support/cookbooks/ruby_build/.gitignore +0 -6
  163. data/support/cookbooks/ruby_build/.kitchen.yml +0 -31
  164. data/support/cookbooks/ruby_build/.travis.yml +0 -4
  165. data/support/cookbooks/ruby_build/Berksfile +0 -10
  166. data/support/cookbooks/ruby_build/CHANGELOG.md +0 -72
  167. data/support/cookbooks/ruby_build/Gemfile +0 -14
  168. data/support/cookbooks/ruby_build/README.md +0 -338
  169. data/support/cookbooks/ruby_build/Rakefile +0 -21
  170. data/support/cookbooks/ruby_build/attributes/default.rb +0 -67
  171. data/support/cookbooks/ruby_build/chefignore +0 -53
  172. data/support/cookbooks/ruby_build/libraries/ruby_build_recipe_helpers.rb +0 -40
  173. data/support/cookbooks/ruby_build/metadata.rb +0 -18
  174. data/support/cookbooks/ruby_build/providers/ruby.rb +0 -88
  175. data/support/cookbooks/ruby_build/recipes/default.rb +0 -69
  176. data/support/cookbooks/ruby_build/resources/ruby.rb +0 -33
  177. data/support/cookbooks/ruby_build/test/cookbooks/alltherubies/metadata.rb +0 -10
  178. data/support/cookbooks/ruby_build/test/cookbooks/alltherubies/recipes/default.rb +0 -59
  179. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/_verify_tests.bash +0 -33
  180. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.8.7.bats +0 -29
  181. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.9.2.bats +0 -18
  182. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.9.3.bats +0 -18
  183. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_2.0.0.bats +0 -18
  184. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_jruby.bats +0 -20
  185. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_rbx.bats +0 -18
  186. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_ree.bats +0 -19
  187. data/support/cookbooks/ruby_build/test/integration/installation/bats/installation.bats +0 -6
  188. data/support/scripts/libsodium_ubuntu.sh +0 -80
  189. data/support/tasks/.gitkeep +0 -0
  190. data/support/tasks/libsodium_install.rb +0 -57
@@ -1,13 +0,0 @@
1
- name "ark"
2
- maintainer "Bryan W. Berry"
3
- maintainer_email "bryan.berry@gmail.com"
4
- license "Apache 2.0"
5
- description "Installs/Configures ark"
6
- long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
- version "0.4.1"
8
-
9
- %w{ debian ubuntu centos redhat fedora }.each do |os|
10
- supports os
11
- end
12
-
13
- recipe "ark::default", "Installs and configures ark"
@@ -1,370 +0,0 @@
1
- #
2
- # Cookbook Name:: ark
3
- # Provider:: Ark
4
- #
5
- # Author:: Bryan W. Berry <bryan.berry@gmail.com>
6
- # Author:: Sean OMeara <someara@opscode.com
7
- # Copyright 2012, Bryan W. Berry
8
- # Copyright 2013, Opscode, Inc.
9
- #
10
- # Licensed under the Apache License, Version 2.0 (the "License");
11
- # you may not use this file except in compliance with the License.
12
- # You may obtain a copy of the License at
13
- #
14
- # http://www.apache.org/licenses/LICENSE-2.0
15
- #
16
- # Unless required by applicable law or agreed to in writing, software
17
- # distributed under the License is distributed on an "AS IS" BASIS,
18
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- # See the License for the specific language governing permissions and
20
- # limitations under the License.
21
- #
22
-
23
- use_inline_resources if defined?(use_inline_resources)
24
- include ::Opscode::Ark::ProviderHelpers
25
-
26
- # From resources/default.rb
27
- # :install, :put, :dump, :cherry_pick, :install_with_make, :configure, :setup_py_build, :setup_py_install, :setup_py
28
-
29
- # Used in test.rb
30
- # :install, :put, :dump, :cherry_pick, :install_with_make, :configure
31
-
32
- #################
33
- # action :install
34
- #################
35
- action :install do
36
- set_paths
37
-
38
- directory new_resource.path do
39
- recursive true
40
- action :create
41
- notifies :run, "execute[unpack #{new_resource.release_file}]"
42
- end
43
-
44
- remote_file new_resource.release_file do
45
- Chef::Log.debug("DEBUG: new_resource.release_file")
46
- source new_resource.url
47
- if new_resource.checksum then checksum new_resource.checksum end
48
- action :create
49
- notifies :run, "execute[unpack #{new_resource.release_file}]"
50
- end
51
-
52
- # unpack based on file extension
53
- _unpack_command = unpack_command
54
- execute "unpack #{new_resource.release_file}" do
55
- command _unpack_command
56
- cwd new_resource.path
57
- environment new_resource.environment
58
- notifies :run, "execute[set owner on #{new_resource.path}]"
59
- action :nothing
60
- end
61
-
62
- # set_owner
63
- execute "set owner on #{new_resource.path}" do
64
- command "/bin/chown -R #{new_resource.owner}:#{new_resource.group} #{new_resource.path}"
65
- action :nothing
66
- end
67
-
68
- # symlink binaries
69
- new_resource.has_binaries.each do |bin|
70
- link ::File.join(new_resource.prefix_bin, ::File.basename(bin)) do
71
- to ::File.join(new_resource.path, bin)
72
- end
73
- end
74
-
75
- # action_link_paths
76
- link new_resource.home_dir do
77
- to new_resource.path
78
- end
79
-
80
- # Add to path for interactive bash sessions
81
- template "/etc/profile.d/#{new_resource.name}.sh" do
82
- cookbook "ark"
83
- source "add_to_path.sh.erb"
84
- owner "root"
85
- group "root"
86
- mode "0755"
87
- cookbook "ark"
88
- variables( :directory => "#{new_resource.path}/bin" )
89
- only_if { new_resource.append_env_path }
90
- end
91
-
92
- # Add to path for the current chef-client converge.
93
- bin_path = ::File.join(new_resource.path, 'bin')
94
- ruby_block "adding '#{bin_path}' to chef-client ENV['PATH']" do
95
- block do
96
- ENV['PATH'] = bin_path + ':' + ENV['PATH']
97
- end
98
- only_if{ new_resource.append_env_path and ENV['PATH'].scan(bin_path).empty? }
99
- end
100
- end
101
-
102
-
103
- ##############
104
- # action :put
105
- ##############
106
- action :put do
107
- set_put_paths
108
-
109
- directory new_resource.path do
110
- recursive true
111
- action :create
112
- notifies :run, "execute[unpack #{new_resource.release_file}]"
113
- end
114
-
115
- # download
116
- remote_file new_resource.release_file do
117
- source new_resource.url
118
- if new_resource.checksum then checksum new_resource.checksum end
119
- action :create
120
- notifies :run, "execute[unpack #{new_resource.release_file}]"
121
- end
122
-
123
- # unpack based on file extension
124
- _unpack_command = unpack_command
125
- execute "unpack #{new_resource.release_file}" do
126
- command _unpack_command
127
- cwd new_resource.path
128
- environment new_resource.environment
129
- notifies :run, "execute[set owner on #{new_resource.path}]"
130
- action :nothing
131
- end
132
-
133
- # set_owner
134
- execute "set owner on #{new_resource.path}" do
135
- command "/bin/chown -R #{new_resource.owner}:#{new_resource.group} #{new_resource.path}"
136
- action :nothing
137
- end
138
- end
139
-
140
- ###########################
141
- # action :dump
142
- ###########################
143
- action :dump do
144
- set_dump_paths
145
-
146
- directory new_resource.path do
147
- recursive true
148
- action :create
149
- notifies :run, "execute[unpack #{new_resource.release_file}]"
150
- end
151
-
152
- # download
153
- remote_file new_resource.release_file do
154
- Chef::Log.debug("DEBUG: new_resource.release_file #{new_resource.release_file}")
155
- source new_resource.url
156
- if new_resource.checksum then checksum new_resource.checksum end
157
- action :create
158
- notifies :run, "execute[unpack #{new_resource.release_file}]"
159
- end
160
-
161
- # unpack based on file extension
162
- _dump_command = dump_command
163
- execute "unpack #{new_resource.release_file}" do
164
- command _dump_command
165
- cwd new_resource.path
166
- environment new_resource.environment
167
- notifies :run, "execute[set owner on #{new_resource.path}]"
168
- action :nothing
169
- end
170
-
171
- # set_owner
172
- execute "set owner on #{new_resource.path}" do
173
- command "/bin/chown -R #{new_resource.owner}:#{new_resource.group} #{new_resource.path}"
174
- action :nothing
175
- end
176
- end
177
-
178
- ###########################
179
- # action :unzip
180
- ###########################
181
- action :unzip do
182
- set_dump_paths
183
-
184
- directory new_resource.path do
185
- recursive true
186
- action :create
187
- notifies :run, "execute[unpack #{new_resource.release_file}]"
188
- end
189
-
190
- # download
191
- remote_file new_resource.release_file do
192
- Chef::Log.debug("DEBUG: new_resource.release_file #{new_resource.release_file}")
193
- source new_resource.url
194
- if new_resource.checksum then checksum new_resource.checksum end
195
- action :create
196
- notifies :run, "execute[unpack #{new_resource.release_file}]"
197
- end
198
-
199
- # unpack based on file extension
200
- _unzip_command = unzip_command
201
- execute "unpack #{new_resource.release_file}" do
202
- command _unzip_command
203
- cwd new_resource.path
204
- environment new_resource.environment
205
- notifies :run, "execute[set owner on #{new_resource.path}]"
206
- action :nothing
207
- end
208
-
209
- # set_owner
210
- execute "set owner on #{new_resource.path}" do
211
- command "/bin/chown -R #{new_resource.owner}:#{new_resource.group} #{new_resource.path}"
212
- action :nothing
213
- end
214
- end
215
-
216
- #####################
217
- # action :cherry_pick
218
- #####################
219
- action :cherry_pick do
220
- set_dump_paths
221
- Chef::Log.debug("DEBUG: new_resource.creates #{new_resource.creates}")
222
-
223
- directory new_resource.path do
224
- recursive true
225
- action :create
226
- notifies :run, "execute[cherry_pick #{new_resource.creates} from #{new_resource.release_file}]"
227
- end
228
-
229
- # download
230
- remote_file new_resource.release_file do
231
- source new_resource.url
232
- if new_resource.checksum then checksum new_resource.checksum end
233
- action :create
234
- notifies :run, "execute[cherry_pick #{new_resource.creates} from #{new_resource.release_file}]"
235
- end
236
-
237
- _unpack_type = unpack_type
238
- _cherry_pick_command = cherry_pick_command
239
- execute "cherry_pick #{new_resource.creates} from #{new_resource.release_file}" do
240
- Chef::Log.debug("DEBUG: unpack_type: #{_unpack_type}")
241
- command _cherry_pick_command
242
- creates "#{new_resource.path}/#{new_resource.creates}"
243
- notifies :run, "execute[set owner on #{new_resource.path}]"
244
- action :nothing
245
- end
246
-
247
- # set_owner
248
- execute "set owner on #{new_resource.path}" do
249
- command "/bin/chown -R #{new_resource.owner}:#{new_resource.group} #{new_resource.path}"
250
- action :nothing
251
- end
252
- end
253
-
254
-
255
- ###########################
256
- # action :install_with_make
257
- ###########################
258
- action :install_with_make do
259
- set_paths
260
-
261
- directory new_resource.path do
262
- recursive true
263
- action :create
264
- notifies :run, "execute[unpack #{new_resource.release_file}]"
265
- end
266
-
267
- remote_file new_resource.release_file do
268
- Chef::Log.debug("DEBUG: new_resource.release_file")
269
- source new_resource.url
270
- if new_resource.checksum then checksum new_resource.checksum end
271
- action :create
272
- notifies :run, "execute[unpack #{new_resource.release_file}]"
273
- end
274
-
275
- # unpack based on file extension
276
- _unpack_command = unpack_command
277
- execute "unpack #{new_resource.release_file}" do
278
- command _unpack_command
279
- cwd new_resource.path
280
- environment new_resource.environment
281
- notifies :run, "execute[autogen #{new_resource.path}]"
282
- notifies :run, "execute[configure #{new_resource.path}]"
283
- notifies :run, "execute[make #{new_resource.path}]"
284
- notifies :run, "execute[make install #{new_resource.path}]"
285
- action :nothing
286
- end
287
-
288
- execute "autogen #{new_resource.path}" do
289
- command "./autogen.sh"
290
- only_if { ::File.exist? "#{new_resource.path}/autogen.sh" }
291
- cwd new_resource.path
292
- environment new_resource.environment
293
- action :nothing
294
- ignore_failure true
295
- end
296
-
297
- execute "configure #{new_resource.path}" do
298
- command "./configure #{new_resource.autoconf_opts.join(' ')}"
299
- only_if { ::File.exist? "#{new_resource.path}/configure" }
300
- cwd new_resource.path
301
- environment new_resource.environment
302
- action :nothing
303
- end
304
-
305
- execute "make #{new_resource.path}" do
306
- command "make #{new_resource.make_opts.join(' ')}"
307
- cwd new_resource.path
308
- environment new_resource.environment
309
- action :nothing
310
- end
311
-
312
- execute "make install #{new_resource.path}" do
313
- command "make install #{new_resource.make_opts.join(' ')}"
314
- cwd new_resource.path
315
- environment new_resource.environment
316
- action :nothing
317
- end
318
-
319
- # unless new_resource.creates and ::File.exists? new_resource.creates
320
- # end
321
- end
322
-
323
-
324
-
325
-
326
- action :configure do
327
- set_paths
328
-
329
- directory new_resource.path do
330
- recursive true
331
- action :create
332
- notifies :run, "execute[unpack #{new_resource.release_file}]"
333
- end
334
-
335
- remote_file new_resource.release_file do
336
- Chef::Log.debug("DEBUG: new_resource.release_file")
337
- source new_resource.url
338
- if new_resource.checksum then checksum new_resource.checksum end
339
- action :create
340
- notifies :run, "execute[unpack #{new_resource.release_file}]"
341
- end
342
-
343
- # unpack based on file extension
344
- _unpack_command = unpack_command
345
- execute "unpack #{new_resource.release_file}" do
346
- command _unpack_command
347
- cwd new_resource.path
348
- environment new_resource.environment
349
- notifies :run, "execute[autogen #{new_resource.path}]"
350
- notifies :run, "execute[configure #{new_resource.path}]"
351
- action :nothing
352
- end
353
-
354
- execute "autogen #{new_resource.path}" do
355
- command "./autogen.sh"
356
- only_if { ::File.exist? "#{new_resource.path}/autogen.sh" }
357
- cwd new_resource.path
358
- environment new_resource.environment
359
- action :nothing
360
- ignore_failure true
361
- end
362
-
363
- execute "configure #{new_resource.path}" do
364
- command "./configure #{new_resource.autoconf_opts.join(' ')}"
365
- only_if { ::File.exist? "#{new_resource.path}/configure" }
366
- cwd new_resource.path
367
- environment new_resource.environment
368
- action :nothing
369
- end
370
- end
@@ -1,31 +0,0 @@
1
- #
2
- # Cookbook Name:: ark
3
- # Recipe:: default
4
- #
5
- # Author:: Bryan W. Berry <bryan.berry@gmail.com>
6
- # Copyright 2012, Bryan W. Berry
7
- #
8
- # Licensed under the Apache License, Version 2.0 (the "License");
9
- # you may not use this file except in compliance with the License.
10
- # You may obtain a copy of the License at
11
- #
12
- # http://www.apache.org/licenses/LICENSE-2.0
13
- #
14
- # Unless required by applicable law or agreed to in writing, software
15
- # distributed under the License is distributed on an "AS IS" BASIS,
16
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- # See the License for the specific language governing permissions and
18
- # limitations under the License.
19
- #
20
-
21
-
22
- package "unzip"
23
- package "libtool"
24
- package "rsync"
25
- package "autoconf"
26
- package "make"
27
- package "autogen" unless platform_family?("rhel", "fedora")
28
-
29
- if platform?("freebsd")
30
- package "gtar"
31
- end
@@ -1,138 +0,0 @@
1
- # require 'fileutils'
2
-
3
- # remove file so we can test sending notification on its creation
4
- if ::File.exist? "/tmp/foobarbaz/foo1.txt"
5
- FileUtils.rm_f "/tmp/foobarbaz/foo1.txt"
6
- end
7
-
8
- ruby_block "test_notification" do
9
- block do
10
- if ::File.exist? "/tmp/foobarbaz/foo1.txt"
11
- FileUtils.touch "/tmp/foobarbaz/notification_successful.txt"
12
- end
13
- end
14
- action :nothing
15
- end
16
-
17
- user 'foobarbaz'
18
-
19
- directory "/opt/bin" do
20
- recursive true
21
- end
22
-
23
- ark "foo" do
24
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
25
- checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
26
- version '2'
27
- prefix_root "/usr/local"
28
- owner "foobarbaz"
29
- group 'foobarbaz'
30
- has_binaries [ 'bin/do_foo', 'bin/do_more_foo' ]
31
- action :install
32
- end
33
-
34
- ark 'test_put' do
35
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
36
- checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
37
- owner 'foobarbaz'
38
- group 'foobarbaz'
39
- action :put
40
- end
41
-
42
- ark "test_dump" do
43
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.zip'
44
- checksum 'deea3a324115c9ca0f3078362f807250080bf1b27516f7eca9d34aad863a11e0'
45
- path '/usr/local/foo_dump'
46
- creates 'foo1.txt'
47
- owner 'foobarbaz'
48
- group 'foobarbaz'
49
- action :dump
50
- end
51
-
52
- ark 'cherry_pick_test' do
53
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
54
- checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
55
- path '/usr/local/foo_cherry_pick'
56
- owner 'foobarbaz'
57
- group 'foobarbaz'
58
- creates "foo_sub/foo1.txt"
59
- action :cherry_pick
60
- end
61
-
62
- ark 'cherry_pick_with_zip' do
63
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.zip'
64
- checksum 'deea3a324115c9ca0f3078362f807250080bf1b27516f7eca9d34aad863a11e0'
65
- path '/usr/local/foo_cherry_pick_from_zip'
66
- creates "foo_sub/foo1.txt"
67
- action :cherry_pick
68
- end
69
-
70
- ark "foo_append_env" do
71
- version "7.0.26"
72
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
73
- checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
74
- append_env_path true
75
- action :install
76
- end
77
-
78
- ark "foo_dont_strip" do
79
- version "2"
80
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
81
- checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
82
- strip_leading_dir false
83
- action :install
84
- end
85
-
86
- ark "foo_zip_strip" do
87
- version "2"
88
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.zip'
89
- checksum 'deea3a324115c9ca0f3078362f807250080bf1b27516f7eca9d34aad863a11e0'
90
- action :install
91
- end
92
-
93
- ark "haproxy" do
94
- url "http://haproxy.1wt.eu/download/1.5/src/snapshot/haproxy-ss-20120403.tar.gz"
95
- version "1.5"
96
- checksum 'ba0424bf7d23b3a607ee24bbb855bb0ea347d7ffde0bec0cb12a89623cbaf911'
97
- make_opts [ 'TARGET=linux26' ]
98
- action :install_with_make
99
- end unless platform?("freebsd")
100
-
101
- ark "foo_alt_bin" do
102
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
103
- checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
104
- version '3'
105
- prefix_root "/opt"
106
- prefix_home "/opt"
107
- prefix_bin "/opt/bin"
108
- owner "foobarbaz"
109
- group 'foobarbaz'
110
- has_binaries [ 'bin/do_foo' ]
111
- action :install
112
- end
113
-
114
- ark "foo_tbz" do
115
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tbz'
116
- version '3'
117
- end
118
-
119
- ark "foo_tgz" do
120
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tgz'
121
- version '3'
122
- end
123
-
124
- ark "test notification" do
125
- url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.zip'
126
- path "/tmp/foobarbaz"
127
- creates "foo1.txt"
128
- action :dump
129
- notifies :create, "ruby_block[test_notification]", :immediately
130
- end
131
-
132
- ark "test_autogen" do
133
- url 'https://github.com/zeromq/libzmq/tarball/master'
134
- extension "tar.gz"
135
- action :configure
136
- # autoconf in RHEL < 6 is too old
137
- not_if { platform_family?('rhel') && node['platform_version'].to_f < 6.0 }
138
- end