omnibus 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +17 -1
  3. data/.travis.yml +11 -3
  4. data/CHANGELOG.md +39 -1
  5. data/Gemfile +0 -4
  6. data/README.md +10 -8
  7. data/Rakefile +18 -7
  8. data/bin/omnibus +3 -3
  9. data/docs/Building on Windows.md +98 -0
  10. data/features/commands/_deprecated.feature +46 -0
  11. data/features/commands/build.feature +9 -0
  12. data/features/commands/clean.feature +21 -0
  13. data/features/commands/list.feature +16 -0
  14. data/features/commands/new.feature +8 -0
  15. data/features/commands/version.feature +12 -0
  16. data/features/step_definitions/generator_steps.rb +28 -0
  17. data/features/support/env.rb +13 -0
  18. data/lib/omnibus.rb +319 -240
  19. data/lib/omnibus/artifact.rb +16 -0
  20. data/lib/omnibus/build_version.rb +39 -20
  21. data/lib/omnibus/build_version_dsl.rb +136 -0
  22. data/lib/omnibus/builder.rb +28 -23
  23. data/lib/omnibus/cleaner.rb +72 -0
  24. data/lib/omnibus/cli.rb +115 -11
  25. data/lib/omnibus/cli/base.rb +82 -81
  26. data/lib/omnibus/cli/cache.rb +80 -32
  27. data/lib/omnibus/cli/deprecated.rb +79 -0
  28. data/lib/omnibus/cli/release.rb +17 -21
  29. data/lib/omnibus/config.rb +38 -13
  30. data/lib/omnibus/exceptions.rb +70 -18
  31. data/lib/omnibus/fetcher.rb +18 -11
  32. data/lib/omnibus/fetchers/git_fetcher.rb +48 -53
  33. data/lib/omnibus/fetchers/net_fetcher.rb +29 -27
  34. data/lib/omnibus/fetchers/path_fetcher.rb +9 -12
  35. data/lib/omnibus/fetchers/s3_cache_fetcher.rb +5 -8
  36. data/lib/omnibus/generator.rb +131 -0
  37. data/lib/omnibus/{templates → generator_files}/.kitchen.local.yml.erb +0 -0
  38. data/lib/omnibus/{templates → generator_files}/.kitchen.yml.erb +0 -0
  39. data/lib/omnibus/{templates → generator_files}/Berksfile.erb +0 -0
  40. data/lib/omnibus/{templates → generator_files}/Gemfile.erb +2 -2
  41. data/lib/omnibus/{templates → generator_files}/README.md.erb +6 -7
  42. data/lib/omnibus/{templates → generator_files}/Vagrantfile.erb +0 -0
  43. data/lib/omnibus/{templates → generator_files}/gitignore.erb +0 -0
  44. data/lib/omnibus/{templates → generator_files}/mac_dmg/background.png +0 -0
  45. data/lib/omnibus/{templates → generator_files}/mac_dmg/icon.png +0 -0
  46. data/lib/omnibus/{templates → generator_files}/mac_pkg/background.png +0 -0
  47. data/lib/omnibus/{templates → generator_files}/mac_pkg/license.html.erb +0 -0
  48. data/lib/omnibus/{templates → generator_files}/mac_pkg/welcome.html.erb +0 -0
  49. data/lib/omnibus/{templates → generator_files}/omnibus.rb.example.erb +0 -0
  50. data/lib/omnibus/{templates → generator_files}/package_scripts/makeselfinst.erb +0 -0
  51. data/lib/omnibus/{templates → generator_files}/package_scripts/postinst.erb +0 -0
  52. data/lib/omnibus/{templates → generator_files}/package_scripts/postrm.erb +0 -0
  53. data/lib/omnibus/{templates → generator_files}/package_scripts/preinst.erb +0 -0
  54. data/lib/omnibus/{templates → generator_files}/package_scripts/prerm.erb +0 -0
  55. data/lib/omnibus/{templates → generator_files}/project.rb.erb +0 -1
  56. data/lib/omnibus/{templates → generator_files}/software/c-example.rb.erb +0 -0
  57. data/lib/omnibus/{templates → generator_files}/software/erlang-example.rb.erb +0 -0
  58. data/lib/omnibus/{templates → generator_files}/software/ruby-example.rb.erb +0 -0
  59. data/lib/omnibus/generator_files/windows_msi/assets/LICENSE.rtf +8 -0
  60. data/lib/omnibus/generator_files/windows_msi/assets/banner_background.bmp +0 -0
  61. data/lib/omnibus/generator_files/windows_msi/assets/dialog_background.bmp +0 -0
  62. data/lib/omnibus/generator_files/windows_msi/assets/project.ico +0 -0
  63. data/lib/omnibus/generator_files/windows_msi/assets/project_16x16.ico +0 -0
  64. data/lib/omnibus/generator_files/windows_msi/assets/project_32x32.ico +0 -0
  65. data/lib/omnibus/generator_files/windows_msi/localization-en-us.wxl.erb +20 -0
  66. data/lib/omnibus/generator_files/windows_msi/parameters.wxi.erb +9 -0
  67. data/lib/omnibus/generator_files/windows_msi/source.wxs.erb +74 -0
  68. data/lib/omnibus/health_check.rb +80 -40
  69. data/lib/omnibus/install_path_cache.rb +11 -12
  70. data/lib/omnibus/library.rb +30 -3
  71. data/lib/omnibus/logger.rb +47 -0
  72. data/lib/omnibus/logging.rb +60 -0
  73. data/lib/omnibus/null_builder.rb +23 -0
  74. data/lib/omnibus/ohai.rb +70 -0
  75. data/lib/omnibus/overrides.rb +69 -48
  76. data/lib/omnibus/package_release.rb +7 -14
  77. data/lib/omnibus/packagers/base.rb +66 -13
  78. data/lib/omnibus/packagers/mac_dmg.rb +23 -3
  79. data/lib/omnibus/packagers/mac_pkg.rb +20 -10
  80. data/lib/omnibus/packagers/windows_msi.rb +109 -0
  81. data/lib/omnibus/project.rb +136 -79
  82. data/lib/omnibus/reports.rb +1 -2
  83. data/lib/omnibus/{s3_cacher.rb → s3_cache.rb} +15 -37
  84. data/lib/omnibus/software.rb +77 -27
  85. data/lib/omnibus/software_s3_urls.rb +50 -0
  86. data/lib/omnibus/sugar.rb +1 -3
  87. data/lib/omnibus/util.rb +45 -18
  88. data/lib/omnibus/version.rb +2 -3
  89. data/omnibus.gemspec +5 -3
  90. data/spec/data/complicated/config/patches/bzip2/makefile_take_env_vars.patch +15 -0
  91. data/spec/data/complicated/config/patches/couchdb/patch_for_couchjs_stack.patch +19 -0
  92. data/spec/data/complicated/config/patches/gd/gd-2.0.33-configure-libpng.patch +100 -0
  93. data/spec/data/complicated/config/patches/keepalived/keepalived-1.2.9_opscode_centos_5.patch +15 -0
  94. data/spec/data/complicated/config/patches/libedit/freebsd-vi-fix.patch +24 -0
  95. data/spec/data/complicated/config/patches/libiconv/libiconv-1.14_srclib_stdio.in.h-remove-gets-declarations.patch +29 -0
  96. data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-makefile-dest-fix.patch +35 -0
  97. data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-malloc-fix.patch +13 -0
  98. data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch +1035 -0
  99. data/spec/data/complicated/config/patches/logrotate/logrotate_basedir_override.patch +12 -0
  100. data/spec/data/complicated/config/patches/ncurses/ncurses-5.9-solaris-xopen_source_extended-detection.patch +11 -0
  101. data/spec/data/complicated/config/patches/ncurses/ncurses-clang.patch +42 -0
  102. data/spec/data/complicated/config/patches/ncurses/patch-aa +23 -0
  103. data/spec/data/complicated/config/patches/ncurses/patch-ab +44 -0
  104. data/spec/data/complicated/config/patches/ncurses/patch-ac +40 -0
  105. data/spec/data/complicated/config/patches/ncurses/patch-ad +12 -0
  106. data/spec/data/complicated/config/patches/ncurses/patch-aix-configure +23 -0
  107. data/spec/data/complicated/config/patches/ncurses/patch-cxx_cursesf.h +22 -0
  108. data/spec/data/complicated/config/patches/ncurses/patch-cxx_cursesm.h +22 -0
  109. data/spec/data/complicated/config/patches/nrpe/fix_for_runit.patch +64 -0
  110. data/spec/data/complicated/config/patches/openssl/openssl-1.0.1f-do-not-build-docs.patch +101 -0
  111. data/spec/data/complicated/config/patches/postgresql/postgresql-9.1.2-configure-ncurses-fix.patch +12 -0
  112. data/spec/data/complicated/config/patches/ruby/patch-configure +103 -0
  113. data/spec/data/complicated/config/patches/ruby/ruby-aix-configure.patch +10 -0
  114. data/spec/data/complicated/config/patches/ruby/ruby-openssl-1.0.1c.patch +42 -0
  115. data/spec/data/complicated/config/patches/ruby/ruby_aix_1_9_3_448_ssl_EAGAIN.patch +57 -0
  116. data/spec/data/complicated/config/patches/ruby/rvm-cflags.patch +27 -0
  117. data/spec/data/complicated/config/projects/angrychef.rb +32 -0
  118. data/spec/data/complicated/config/projects/chef-windows.rb +32 -0
  119. data/spec/data/complicated/config/projects/chef.rb +32 -0
  120. data/spec/data/complicated/config/projects/chefdk-windows.rb +41 -0
  121. data/spec/data/complicated/config/projects/chefdk.rb +44 -0
  122. data/spec/data/complicated/config/software/appbundler.rb +25 -0
  123. data/spec/data/complicated/config/software/autoconf.rb +35 -0
  124. data/spec/data/complicated/config/software/automake.rb +39 -0
  125. data/spec/data/complicated/config/software/berkshelf.rb +44 -0
  126. data/{lib/omnibus/fetchers.rb → spec/data/complicated/config/software/bundler.rb} +8 -5
  127. data/spec/data/complicated/config/software/bzip2.rb +46 -0
  128. data/spec/data/complicated/config/software/cacerts.rb +44 -0
  129. data/spec/data/complicated/config/software/chef-client-msi.rb +88 -0
  130. data/spec/data/complicated/config/software/chef-gem.rb +26 -0
  131. data/spec/data/complicated/config/software/chef-vault.rb +43 -0
  132. data/spec/data/complicated/config/software/chef-windows.rb +158 -0
  133. data/spec/data/complicated/config/software/chef.rb +170 -0
  134. data/spec/data/complicated/config/software/chefdk.rb +103 -0
  135. data/spec/data/complicated/config/software/couchdb.rb +53 -0
  136. data/spec/data/complicated/config/software/curl.rb +48 -0
  137. data/spec/data/complicated/config/software/erlang.rb +65 -0
  138. data/spec/data/complicated/config/software/expat.rb +21 -0
  139. data/spec/data/complicated/config/software/fcgi.rb +56 -0
  140. data/spec/data/complicated/config/software/fcgiwrap.rb +41 -0
  141. data/spec/data/complicated/config/software/gd.rb +56 -0
  142. data/spec/data/complicated/config/software/gdbm.rb +40 -0
  143. data/spec/data/complicated/config/software/gecode.rb +48 -0
  144. data/spec/data/complicated/config/software/git.rb +40 -0
  145. data/spec/data/complicated/config/software/help2man.rb +30 -0
  146. data/spec/data/complicated/config/software/icu.rb +40 -0
  147. data/spec/data/complicated/config/software/jre.rb +48 -0
  148. data/spec/data/complicated/config/software/keepalived.rb +43 -0
  149. data/spec/data/complicated/config/software/libarchive.rb +50 -0
  150. data/spec/data/complicated/config/software/libedit.rb +69 -0
  151. data/spec/data/complicated/config/software/libffi.rb +71 -0
  152. data/spec/data/complicated/config/software/libgcc.rb +39 -0
  153. data/spec/data/complicated/config/software/libiconv.rb +66 -0
  154. data/spec/data/complicated/config/software/libjpeg.rb +39 -0
  155. data/spec/data/complicated/config/software/libpng.rb +38 -0
  156. data/spec/data/complicated/config/software/libtool.rb +52 -0
  157. data/spec/data/complicated/config/software/libwrap.rb +50 -0
  158. data/spec/data/complicated/config/software/libxml2.rb +51 -0
  159. data/spec/data/complicated/config/software/libxslt.rb +52 -0
  160. data/spec/data/complicated/config/software/libyaml-windows.rb +43 -0
  161. data/spec/data/complicated/config/software/libyaml.rb +62 -0
  162. data/spec/data/complicated/config/software/logrotate.rb +41 -0
  163. data/spec/data/complicated/config/software/makedepend.rb +73 -0
  164. data/spec/data/complicated/config/software/mysql2.rb +42 -0
  165. data/spec/data/complicated/config/software/nagios-plugins.rb +53 -0
  166. data/spec/data/complicated/config/software/nagios.rb +66 -0
  167. data/spec/data/complicated/config/software/ncurses.rb +149 -0
  168. data/spec/data/complicated/config/software/nginx.rb +40 -0
  169. data/spec/data/complicated/config/software/nodejs.rb +44 -0
  170. data/spec/data/complicated/config/software/nokogiri.rb +55 -0
  171. data/spec/data/complicated/config/software/nrpe.rb +61 -0
  172. data/spec/data/complicated/config/software/ohai.rb +64 -0
  173. data/spec/data/complicated/config/software/omnibus-ctl.rb +34 -0
  174. data/spec/data/complicated/config/software/openresty.rb +67 -0
  175. data/spec/data/complicated/config/software/openssl.rb +158 -0
  176. data/spec/data/complicated/config/software/pcre.rb +42 -0
  177. data/spec/data/complicated/config/software/perl-extutils-embed.rb +15 -0
  178. data/spec/data/complicated/config/software/perl-extutils-makemaker.rb +15 -0
  179. data/spec/data/complicated/config/software/perl.rb +48 -0
  180. data/spec/data/complicated/config/software/perl_pg_driver.rb +12 -0
  181. data/spec/data/complicated/config/software/php.rb +41 -0
  182. data/spec/data/complicated/config/software/pip.rb +30 -0
  183. data/spec/data/complicated/config/software/pkg-config.rb +66 -0
  184. data/spec/data/complicated/config/software/popt.rb +47 -0
  185. data/spec/data/complicated/config/software/postgresql.rb +51 -0
  186. data/spec/data/complicated/config/software/preparation.rb +30 -0
  187. data/spec/data/complicated/config/software/pygments.rb +25 -0
  188. data/spec/data/complicated/config/software/python.rb +49 -0
  189. data/spec/data/complicated/config/software/rabbitmq.rb +36 -0
  190. data/spec/data/complicated/config/software/rebar.rb +36 -0
  191. data/spec/data/complicated/config/software/redis.rb +33 -0
  192. data/spec/data/complicated/config/software/rsync.rb +48 -0
  193. data/spec/data/complicated/config/software/ruby-windows-devkit.rb +30 -0
  194. data/spec/data/complicated/config/software/ruby-windows.rb +30 -0
  195. data/spec/data/complicated/config/software/ruby.rb +162 -0
  196. data/spec/data/complicated/config/software/rubygems-customization.rb +57 -0
  197. data/spec/data/complicated/config/software/rubygems.rb +37 -0
  198. data/spec/data/complicated/config/software/runit.rb +118 -0
  199. data/spec/data/complicated/config/software/server-jre.rb +46 -0
  200. data/spec/data/complicated/config/software/setuptools.rb +30 -0
  201. data/spec/data/complicated/config/software/spawn-fcgi.rb +40 -0
  202. data/spec/data/complicated/config/software/sphinx.rb +26 -0
  203. data/spec/data/complicated/config/software/spidermonkey.rb +60 -0
  204. data/spec/data/complicated/config/software/sqitch.rb +24 -0
  205. data/spec/data/complicated/config/software/test-kitchen.rb +39 -0
  206. data/spec/data/complicated/config/software/unicorn.rb +27 -0
  207. data/spec/data/complicated/config/software/util-macros.rb +46 -0
  208. data/spec/data/complicated/config/software/version-manifest.rb +32 -0
  209. data/spec/data/complicated/config/software/xproto.rb +46 -0
  210. data/spec/data/complicated/config/software/yajl.rb +30 -0
  211. data/spec/data/complicated/config/software/zlib.rb +67 -0
  212. data/spec/data/projects/chefdk.rb +4 -4
  213. data/spec/data/projects/sample.rb +3 -0
  214. data/spec/data/software/erchef.rb +1 -1
  215. data/spec/fixtures/sample/files/windows_msi/Resources/assets/LICENSE.rtf +8 -0
  216. data/spec/fixtures/sample/files/windows_msi/Resources/assets/banner_background.bmp +0 -0
  217. data/spec/fixtures/sample/files/windows_msi/Resources/assets/dialog_background.bmp +0 -0
  218. data/spec/fixtures/sample/files/windows_msi/Resources/assets/project.ico +0 -0
  219. data/spec/fixtures/sample/files/windows_msi/Resources/assets/project_16x16.ico +0 -0
  220. data/spec/fixtures/sample/files/windows_msi/Resources/assets/project_32x32.ico +0 -0
  221. data/spec/fixtures/sample/files/windows_msi/Resources/localization-en-us.wxl +20 -0
  222. data/spec/fixtures/sample/files/windows_msi/Resources/parameters.wxi.erb +9 -0
  223. data/spec/fixtures/sample/files/windows_msi/Resources/source.wxs +74 -0
  224. data/spec/functional/packagers/mac_spec.rb +3 -20
  225. data/spec/functional/packagers/windows_spec.rb +69 -0
  226. data/spec/spec_helper.rb +79 -1
  227. data/spec/unit/artifact_spec.rb +0 -18
  228. data/spec/unit/build_version_dsl_spec.rb +136 -0
  229. data/spec/unit/build_version_spec.rb +185 -198
  230. data/spec/unit/config_spec.rb +18 -1
  231. data/spec/unit/fetchers/git_fetcher_spec.rb +55 -80
  232. data/spec/unit/fetchers/net_fetcher_spec.rb +11 -21
  233. data/spec/unit/install_path_cache_spec.rb +164 -136
  234. data/spec/unit/library_spec.rb +125 -5
  235. data/spec/unit/omnibus_spec.rb +25 -9
  236. data/spec/unit/overrides_spec.rb +2 -14
  237. data/spec/unit/package_release_spec.rb +0 -18
  238. data/spec/unit/packagers/base_spec.rb +84 -21
  239. data/spec/unit/packagers/mac_pkg_spec.rb +34 -24
  240. data/spec/unit/project_spec.rb +100 -102
  241. data/spec/unit/s3_cacher_spec.rb +0 -18
  242. data/spec/unit/software_spec.rb +152 -6
  243. data/spec/{sugar_spec.rb → unit/sugar_spec.rb} +0 -3
  244. metadata +365 -38
  245. data/lib/omnibus/cli/application.rb +0 -147
  246. data/lib/omnibus/cli/build.rb +0 -64
@@ -1,12 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Use Berkshelf for resolving cookbook dependencies
4
- gem 'berkshelf', '~> 3.0.0.beta'
4
+ gem 'berkshelf', '~> 3.0'
5
5
 
6
6
  # Install omnibus software
7
7
  gem 'omnibus', '~> <%= Omnibus::VERSION.split('.')[0...-1].join('.') %>'
8
8
  gem 'omnibus-software', github: 'opscode/omnibus-software'
9
9
 
10
- # Use Test Kitchen with Vagrant for convering the build environment
10
+ # Use Test Kitchen with Vagrant for converging the build environment
11
11
  gem 'test-kitchen', '~> 1.2'
12
12
  gem 'kitchen-vagrant', '~> 0.14'
@@ -19,7 +19,7 @@ Usage
19
19
  You create a platform-specific package using the `build project` command:
20
20
 
21
21
  ```shell
22
- $ bin/omnibus build project <%= config[:name] %>
22
+ $ bin/omnibus build <%= config[:name] %>
23
23
  ```
24
24
 
25
25
  The platform/architecture type of the package created will match the platform
@@ -33,7 +33,7 @@ You can clean up all temporary files generated during the build process with
33
33
  the `clean` command:
34
34
 
35
35
  ```shell
36
- $ bin/omnibus clean
36
+ $ bin/omnibus clean <%= config[:name] %>
37
37
  ```
38
38
 
39
39
  Adding the `--purge` purge option removes __ALL__ files generated during the
@@ -41,7 +41,7 @@ build including the project install directory (`/opt/<%= config[:name] %>`) and
41
41
  the package cache directory (`/var/cache/omnibus/pkg`):
42
42
 
43
43
  ```shell
44
- $ bin/omnibus clean --purge
44
+ $ bin/omnibus clean <%= config[:name] %> --purge
45
45
  ```
46
46
 
47
47
  ### Help
@@ -56,8 +56,7 @@ $ bin/omnibus help
56
56
  Kitchen-based Build Environment
57
57
  -------------------------------
58
58
  Every Omnibus project ships will a project-specific
59
- [Berksfile](http://berkshelf.com/) and [Vagrantfile](http://www.vagrantup.com/)
60
- that will allow you to build your omnibus projects on all of the projects listed
59
+ [Berksfile](http://berkshelf.com/) that will allow you to build your omnibus projects on all of the projects listed
61
60
  in the `.kitchen.yml`. You can add/remove additional platforms as needed by
62
61
  changing the list found in the `.kitchen.yml` `platforms` YAML stanza.
63
62
 
@@ -76,7 +75,7 @@ liking, you can bring up an individual build environment using the `kitchen`
76
75
  command.
77
76
 
78
77
  ```shell
79
- $ bundle exec kitchen converge ubuntu-12.04
78
+ $ bin/kitchen converge ubuntu-12.04
80
79
  ```
81
80
 
82
81
  Then login to the instance and build the project as described in the Usage
@@ -87,7 +86,7 @@ $ bundle exec kitchen login ubuntu-12.04
87
86
  [vagrant@ubuntu...] $ cd <%= config[:name] %>
88
87
  [vagrant@ubuntu...] $ bundle install
89
88
  [vagrant@ubuntu...] $ ...
90
- [vagrant@ubuntu...] $ ./bin/omnibus build project <%= config[:name] %>
89
+ [vagrant@ubuntu...] $ bin/omnibus build <%= config[:name] %>
91
90
  ```
92
91
 
93
92
  For a complete list of all commands and platforms, run `kitchen list` or
@@ -3,7 +3,6 @@ name '<%= config[:name] %>'
3
3
  maintainer 'CHANGE ME'
4
4
  homepage 'CHANGEME.com'
5
5
 
6
- replaces '<%= config[:name] %>'
7
6
  install_path '<%= config[:install_path] %>'
8
7
  build_version Omnibus::BuildVersion.new.semver
9
8
  build_iteration 1
@@ -0,0 +1,8 @@
1
+ {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf190
2
+ {\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
3
+ {\colortbl;\red255\green255\blue255;}
4
+ \vieww12000\viewh15840\viewkind0
5
+ \deftab720
6
+ \pard\pardeftab720\qc
7
+
8
+ \f0\fs20 \cf0 All Rights Reserved.}
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
3
+ <!-- http://wix.codeplex.com/SourceControl/changeset/view/792e101c5cf7#src%2fext%2fUIExtension%2fwixlib%2fWixUI_en-us.wxl -->
4
+ <String Id="LANG">1033</String>
5
+ <String Id="ProductName"><%= friendly_name %></String>
6
+ <String Id="ManufacturerName"><%= maintainer %></String>
7
+ <String Id="WelcomeDlgTitle">{\WixUI_Font_Bigger}Welcome to the [ProductName] Setup Wizard</String>
8
+
9
+ <String Id="LicenseAgreementDlgTitle">{\WixUI_Font_Title_White}End-User License Agreement</String>
10
+ <String Id="LicenseAgreementDlgDescription">{\WixUI_Font_Normal_White}Please read the following license agreement carefully</String>
11
+
12
+ <String Id="InstallDirDlgTitle">{\WixUI_Font_Title_White}Destination Folder</String>
13
+ <String Id="InstallDirDlgDescription">{\WixUI_Font_Normal_White}Click Next to install to the default folder or click Change to choose another.</String>
14
+
15
+ <String Id="ProgressDlgTitleInstalling">{\WixUI_Font_Title_White}Installing [ProductName]</String>
16
+
17
+ <String Id="VerifyReadyDlgInstallTitle">{\WixUI_Font_Title_White}Ready to install [ProductName]</String>
18
+
19
+ <String Id="FeatureMainName"><%= friendly_name %></String>
20
+ </WixLocalization>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Include>
3
+ <!--
4
+ Versioning. These have to be changed for upgrades.
5
+ -->
6
+ <?define VersionNumber="<%= @msi_version %>" ?>
7
+ <?define DisplayVersionNumber="<%= @msi_display_version %>" ?>
8
+ <?define UpgradeCode="92F92680-F445-400D-8A0A-225DC8FC8360" ?>
9
+ </Include>
@@ -0,0 +1,74 @@
1
+ <?xml version='1.0'?>
2
+ <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
3
+
4
+ <!-- This is how we include wxi files -->
5
+ <?include "parameters.wxi" ?>
6
+
7
+ <!--
8
+ Id="*" is to enable upgrading. * means that the product ID will be autogenerated on each build.
9
+ Name is made of localized product name and version number.
10
+ -->
11
+ <Product Id="*" Name="!(loc.ProductName) v$(var.DisplayVersionNumber)" Language="!(loc.LANG)"
12
+ Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)">
13
+
14
+ <!--
15
+ Define the minimum supported installer version (2.0).
16
+ The install should be done for the whole machine not just the current user
17
+ -->
18
+ <Package InstallerVersion="200" InstallPrivileges="elevated"
19
+ Compressed="yes" InstallScope="perMachine" />
20
+
21
+ <Media Id="1" Cabinet="Project.cab" EmbedCab="yes" CompressionLevel="high" />
22
+
23
+ <!-- Major upgrade -->
24
+ <Upgrade Id="$(var.UpgradeCode)">
25
+ <UpgradeVersion OnlyDetect="yes" Minimum="$(var.VersionNumber)" IncludeMinimum="no" Property="NEWERVERSIONDETECTED" />
26
+ <UpgradeVersion Minimum="0.0.0.0" IncludeMinimum="yes" Maximum="$(var.VersionNumber)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
27
+ </Upgrade>
28
+
29
+ <InstallExecuteSequence>
30
+ <RemoveExistingProducts After="InstallValidate" />
31
+ </InstallExecuteSequence>
32
+
33
+ <Directory Id="TARGETDIR" Name="SourceDir">
34
+ <Directory Id="WindowsVolume">
35
+ <!-- Service needs chef directory to be present. -->
36
+ <Directory Id="INSTALLLOCATION" Name="opt">
37
+ <Directory Id="PROJECTLOCATION" Name="<%= config[:name] %>">
38
+ </Directory>
39
+ </Directory>
40
+ </Directory>
41
+ </Directory>
42
+
43
+ <!-- Set the components defined in our fragment files that will be used for our feature -->
44
+ <Feature Id="ProjectFeature" Title="!(loc.FeatureMainName)" Absent="disallow" AllowAdvertise="no" Level="1" ConfigurableDirectory="INSTALLLOCATION">
45
+ <ComponentGroupRef Id="ProjectDir" />
46
+ </Feature>
47
+
48
+ <!--
49
+ UI Stuff
50
+ -->
51
+ <Icon Id="project.ico" SourceFile="Resources\assets\project_16x16.ico"/>
52
+ <Property Id="ARPPRODUCTICON" Value="project.ico" />
53
+ <Property Id="ARPHELPLINK" Value="http://www.getchef.com/" />
54
+ <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
55
+
56
+ <UIRef Id="ProjectUI_InstallDir"/>
57
+ <UI Id="ProjectUI_InstallDir">
58
+ <UIRef Id="WixUI_FeatureTree"/>
59
+ <TextStyle Id="WixUI_Font_Normal_White" FaceName="Tahoma" Size="8" Red="255" Green="255" Blue="255" />
60
+ <TextStyle Id="WixUI_Font_Bigger_White" FaceName="Tahoma" Size="12" Red="255" Green="255" Blue="255" />
61
+ <TextStyle Id="WixUI_Font_Title_White" FaceName="Tahoma" Size="9" Bold="yes" Red="255" Green="255" Blue="255" />
62
+ </UI>
63
+
64
+ <WixVariable Id="WixUILicenseRtf" Value="Resources\assets\LICENSE.rtf" />
65
+ <WixVariable Id="WixUIDialogBmp" Value="Resources\assets\dialog_background.bmp" />
66
+ <WixVariable Id="WixUIBannerBmp" Value="Resources\assets\banner_background.bmp" />
67
+
68
+ <WixVariable Id="WixUIExclamationIco" Value="Resources\assets\project_32x32.ico" />
69
+ <WixVariable Id="WixUIInfoIco" Value="Resources\assets\project_32x32.ico" />
70
+ <WixVariable Id="WixUINewIco" Value="Resources\assets\project_16x16.ico" />
71
+ <WixVariable Id="WixUIUpIco" Value="Resources\assets\project_16x16.ico" />
72
+
73
+ </Product>
74
+ </Wix>
@@ -1,6 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2012-2014 Chef Software, Inc.
3
- # License:: Apache License, Version 2.0
2
+ # Copyright 2012-2014 Chef Software, Inc.
4
3
  #
5
4
  # Licensed under the Apache License, Version 2.0 (the "License");
6
5
  # you may not use this file except in compliance with the License.
@@ -17,6 +16,8 @@
17
16
 
18
17
  module Omnibus
19
18
  class HealthCheck
19
+ include Logging
20
+
20
21
  WHITELIST_LIBS = [
21
22
  /ld-linux/,
22
23
  /libc\.so/,
@@ -66,7 +67,6 @@ module Omnibus
66
67
  /libcrypto.so/,
67
68
  /libcurses\.so/,
68
69
  /libdoor\.so/,
69
- /libgcc_s\.so\.1/,
70
70
  /libgen\.so/,
71
71
  /libmd5\.so/,
72
72
  /libmd\.so/,
@@ -77,7 +77,6 @@ module Omnibus
77
77
  /libssl.so/,
78
78
  /libthread.so/,
79
79
  /libuutil\.so/,
80
- /libz.so/,
81
80
  # solaris 11 libraries:
82
81
  /libc\.so\.1/,
83
82
  /libm\.so\.2/,
@@ -113,6 +112,7 @@ module Omnibus
113
112
  /libobjc\.A\.dylib/,
114
113
  /libSystem\.B\.dylib/,
115
114
  /CoreFoundation/,
115
+ /CoreServices/,
116
116
  /Tcl$/,
117
117
  /Cocoa$/,
118
118
  /Carbon$/,
@@ -135,12 +135,8 @@ module Omnibus
135
135
  /libutil\.so/,
136
136
  ]
137
137
 
138
- def self.log(msg)
139
- puts "[health_check] #{msg}"
140
- end
141
-
142
138
  def self.run(install_dir, whitelist_files = [])
143
- case OHAI.platform
139
+ case Ohai.platform
144
140
  when 'mac_os_x'
145
141
  bad_libs = health_check_otool(install_dir, whitelist_files)
146
142
  when 'aix'
@@ -166,37 +162,79 @@ module Omnibus
166
162
  end
167
163
  end
168
164
  end
169
- log '*** Health Check Failed, Summary follows:'
165
+
166
+ log.warn(log_key) { 'Failed!' }
170
167
  bad_omnibus_libs, bad_omnibus_bins = bad_libs.keys.partition { |k| k.include? 'embedded/lib' }
171
- log '*** The following Omnibus-built libraries have unsafe or unmet dependencies:'
172
- bad_omnibus_libs.each { |lib| log " --> #{lib}" }
173
- log '*** The following Omnibus-built binaries have unsafe or unmet dependencies:'
174
- bad_omnibus_bins.each { |bin| log " --> #{bin}" }
168
+
169
+ log.warn(log_key) do
170
+ out = "The following libraries have unsafe or unmet dependencies:\n"
171
+
172
+ bad_omnibus_libs.each do |lib|
173
+ out << " --> #{lib}\n"
174
+ end
175
+
176
+ out
177
+ end
178
+
179
+ log.warn(log_key) do
180
+ out = "The following binaries have unsafe or unmet dependencies:\n"
181
+
182
+ bad_omnibus_bins.each do |bin|
183
+ out << " --> #{bin}\n"
184
+ end
185
+
186
+ out
187
+ end
188
+
175
189
  if unresolved.length > 0
176
- log '*** The following requirements could not be resolved:'
177
- unresolved.each { |lib| log " --> #{lib}" }
190
+ log.warn(log_key) do
191
+ out = "The following requirements could not be resolved:\n"
192
+
193
+ unresolved.each do |lib|
194
+ out << " --> #{lib}\n"
195
+ end
196
+
197
+ out
198
+ end
178
199
  end
200
+
179
201
  if unreliable.length > 0
180
- log '*** The following libraries cannot be guaranteed to be on target systems:'
181
- unreliable.each { |lib| log " --> #{lib}" }
202
+ log.warn(log_key) do
203
+ out = "The following libraries cannot be guaranteed to be on "
204
+ out << "target systems:\n"
205
+
206
+ unreliable.each do |lib|
207
+ out << " --> #{lib}\n"
208
+ end
209
+
210
+ out
211
+ end
182
212
  end
183
- log '*** The precise failures were:'
184
- detail.each do |line|
185
- item, dependency, location, count = line.split('|')
186
- reason = location =~ /not found/ ? 'Unresolved dependency' : 'Unsafe dependency'
187
- log " --> #{item}"
188
- log " DEPENDS ON: #{dependency}"
189
- log " COUNT: #{count}"
190
- log " PROVIDED BY: #{location}"
191
- log " FAILED BECAUSE: #{reason}"
213
+
214
+ log.warn(log_key) do
215
+ out = "The precise failures were:\n"
216
+
217
+ detail.each do |line|
218
+ item, dependency, location, count = line.split('|')
219
+ reason = location =~ /not found/ ? 'Unresolved dependency' : 'Unsafe dependency'
220
+
221
+ out << " --> #{item}\n"
222
+ out << " DEPENDS ON: #{dependency}\n"
223
+ out << " COUNT: #{count}\n"
224
+ out << " PROVIDED BY: #{location}\n"
225
+ out << " FAILED BECAUSE: #{reason}\n"
226
+ end
227
+
228
+ out
192
229
  end
193
- fail 'Health Check Failed'
230
+
231
+ raise 'Health Check Failed'
194
232
  end
195
233
  end
196
234
 
197
235
  def self.health_check_otool(install_dir, whitelist_files)
198
236
  otool_cmd = "find #{install_dir}/ -type f | egrep '\.(dylib|bundle)$' | xargs otool -L > otool.out 2>/dev/null"
199
- log "Executing `#{otool_cmd}`"
237
+ log.info(log_key) { "Executing: `#{otool_cmd}`" }
200
238
  shell = Mixlib::ShellOut.new(otool_cmd, timeout: 3600)
201
239
  shell.run_command
202
240
 
@@ -224,7 +262,7 @@ module Omnibus
224
262
  def self.check_for_bad_library(install_dir, bad_libs, whitelist_files, current_library, name, linked)
225
263
  safe = nil
226
264
 
227
- whitelist_libs = case OHAI.platform
265
+ whitelist_libs = case Ohai.platform
228
266
  when 'arch'
229
267
  ARCH_WHITELIST_LIBS
230
268
  when 'mac_os_x'
@@ -247,11 +285,11 @@ module Omnibus
247
285
  safe ||= true if reg.match(current_library)
248
286
  end
249
287
 
250
- log " --> Dependency: #{name}" if ARGV[0] == 'verbose'
251
- log " --> Provided by: #{linked}" if ARGV[0] == 'verbose'
288
+ log.debug(log_key) { " --> Dependency: #{name}" }
289
+ log.debug(log_key) { " --> Provided by: #{linked}" }
252
290
 
253
291
  if !safe && linked !~ Regexp.new(install_dir)
254
- log " -> FAILED: #{current_library} has unsafe dependencies" if ARGV[0] == 'verbose'
292
+ log.debug(log_key) { " -> FAILED: #{current_library} has unsafe dependencies" }
255
293
  bad_libs[current_library] ||= {}
256
294
  bad_libs[current_library][name] ||= {}
257
295
  if bad_libs[current_library][name].key?(linked)
@@ -260,7 +298,7 @@ module Omnibus
260
298
  bad_libs[current_library][name][linked] = 1
261
299
  end
262
300
  else
263
- log " -> PASSED: #{name} is either whitelisted or safely provided." if ARGV[0] == 'verbose'
301
+ log.debug(log_key) { " -> PASSED: #{name} is either whitelisted or safely provided." }
264
302
  end
265
303
 
266
304
  bad_libs
@@ -275,7 +313,7 @@ module Omnibus
275
313
  #
276
314
  ldd_cmd = "find #{install_dir}/ -type f | xargs file | grep \"RISC System\" | awk -F: '{print $1}' | xargs -n 1 ldd > ldd.out 2>/dev/null"
277
315
 
278
- log "Executing `#{ldd_cmd}`"
316
+ log.info(log_key) { "Executing `#{ldd_cmd}`" }
279
317
  shell = Mixlib::ShellOut.new(ldd_cmd, timeout: 3600)
280
318
  shell.run_command
281
319
 
@@ -288,14 +326,14 @@ module Omnibus
288
326
  case line
289
327
  when /^(.+) needs:$/
290
328
  current_library = Regexp.last_match[1]
291
- log "*** Analysing dependencies for #{current_library}" if ARGV[0] == 'verbose'
329
+ log.debug(log_key) { "Analyzing dependencies for #{current_library}" }
292
330
  when /^\s+(.+)$/
293
331
  name = Regexp.last_match[1]
294
332
  linked = Regexp.last_match[1]
295
333
  bad_libs = check_for_bad_library(install_dir, bad_libs, whitelist_files, current_library, name, linked)
296
334
  when /File is not an executable XCOFF file/ # ignore non-executable files
297
335
  else
298
- log "*** Line did not match for #{current_library}\n#{line}"
336
+ log.warn(log_key) { "Line did not match for #{current_library}\n#{line}" }
299
337
  end
300
338
  end
301
339
 
@@ -312,7 +350,7 @@ module Omnibus
312
350
  #
313
351
  ldd_cmd = "find #{install_dir}/ -type f | xargs ldd > ldd.out 2>/dev/null"
314
352
 
315
- log "Executing `#{ldd_cmd}`"
353
+ log.info(log_key) { "Executing `#{ldd_cmd}`" }
316
354
  shell = Mixlib::ShellOut.new(ldd_cmd, timeout: 3600)
317
355
  shell.run_command
318
356
 
@@ -325,7 +363,7 @@ module Omnibus
325
363
  case line
326
364
  when /^(.+):$/
327
365
  current_library = Regexp.last_match[1]
328
- log "*** Analysing dependencies for #{current_library}" if ARGV[0] == 'verbose'
366
+ log.debug(log_key) { "Analyzing dependencies for #{current_library}" }
329
367
  when /^\s+(.+) \=\>\s+(.+)( \(.+\))?$/
330
368
  name = Regexp.last_match[1]
331
369
  linked = Regexp.last_match[2]
@@ -342,7 +380,9 @@ module Omnibus
342
380
  next
343
381
  when /^\s+not a dynamic executable$/ # ignore non-executable files
344
382
  else
345
- log "*** Line did not match for #{current_library}\n#{line}"
383
+ log.warn(log_key) do
384
+ "Line did not match for #{current_library}\n#{line}"
385
+ end
346
386
  end
347
387
  end
348
388