omnibus 3.2.2 → 4.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +140 -10
- data/CHANGELOG.md +181 -8
- data/README.md +63 -35
- data/Rakefile +1 -1
- data/docs/omnibus-build-cache.md b/data/docs/Build → Cache.md +0 -0
- data/docs/Building on Debian.md +59 -0
- data/docs/Building on OSX.md +61 -35
- data/docs/Building on RHEL.md +74 -0
- data/docs/Building on Windows.md +40 -81
- data/features/commands/build.feature +1 -2
- data/features/commands/clean.feature +1 -1
- data/lib/omnibus.rb +111 -204
- data/lib/omnibus/build_version.rb +3 -20
- data/lib/omnibus/build_version_dsl.rb +2 -3
- data/lib/omnibus/builder.rb +103 -211
- data/lib/omnibus/cleaner.rb +5 -7
- data/lib/omnibus/cli.rb +1 -4
- data/lib/omnibus/cli/base.rb +9 -16
- data/lib/omnibus/compressor.rb +60 -0
- data/{spec/data/complicated/config/software/version-manifest.rb → lib/omnibus/compressors/base.rb} +17 -12
- data/lib/omnibus/compressors/dmg.rb +312 -0
- data/lib/omnibus/{null_builder.rb → compressors/null.rb} +10 -4
- data/lib/omnibus/compressors/tgz.rb +141 -0
- data/lib/omnibus/config.rb +89 -83
- data/lib/omnibus/core_extensions.rb +1 -0
- data/lib/omnibus/core_extensions/open_uri.rb +58 -0
- data/lib/omnibus/digestable.rb +9 -3
- data/lib/omnibus/exceptions.rb +116 -175
- data/lib/omnibus/fetcher.rb +97 -138
- data/lib/omnibus/fetchers/git_fetcher.rb +130 -165
- data/lib/omnibus/fetchers/net_fetcher.rb +205 -164
- data/lib/omnibus/fetchers/{s3_cache_fetcher.rb → null_fetcher.rb} +27 -17
- data/lib/omnibus/fetchers/path_fetcher.rb +74 -32
- data/lib/omnibus/file_syncer.rb +149 -0
- data/lib/omnibus/generator.rb +103 -32
- data/lib/omnibus/generator_files/.kitchen.yml.erb +5 -1
- data/lib/omnibus/generator_files/Gemfile.erb +13 -7
- data/lib/omnibus/generator_files/config/projects/project.rb.erb +28 -0
- data/lib/omnibus/generator_files/config/software/zlib.rb.erb +55 -0
- data/lib/omnibus/generator_files/omnibus.rb.erb +5 -7
- data/lib/omnibus/git_cache.rb +11 -13
- data/lib/omnibus/logger.rb +76 -22
- data/lib/omnibus/logging.rb +1 -1
- data/lib/omnibus/metadata.rb +264 -0
- data/lib/omnibus/ohai.rb +0 -51
- data/lib/omnibus/package.rb +4 -228
- data/lib/omnibus/packager.rb +71 -0
- data/lib/omnibus/packagers/base.rb +118 -176
- data/lib/omnibus/packagers/bff.rb +136 -0
- data/lib/omnibus/packagers/deb.rb +389 -0
- data/lib/omnibus/packagers/makeself.rb +114 -0
- data/lib/omnibus/packagers/msi.rb +346 -0
- data/lib/omnibus/packagers/pkg.rb +278 -0
- data/lib/omnibus/packagers/rpm.rb +438 -0
- data/lib/omnibus/packagers/solaris.rb +110 -0
- data/lib/omnibus/project.rb +263 -666
- data/lib/omnibus/publisher.rb +3 -3
- data/lib/omnibus/s3_cache.rb +21 -30
- data/lib/omnibus/software.rb +132 -271
- data/lib/omnibus/templating.rb +66 -0
- data/lib/omnibus/thread_pool.rb +109 -0
- data/lib/omnibus/util.rb +137 -15
- data/lib/omnibus/version.rb +1 -1
- data/omnibus.gemspec +2 -2
- data/resources/bff/gen.template.erb +22 -0
- data/resources/bff/postinstall.sh +0 -0
- data/resources/bff/unpostinstall.sh +0 -0
- data/resources/deb/conffiles.erb +3 -0
- data/resources/deb/control.erb +25 -0
- data/resources/deb/md5sums.erb +3 -0
- data/{lib/omnibus/generator_files/mac_dmg → resources/dmg}/background.png +0 -0
- data/resources/dmg/create_dmg.osascript.erb +17 -0
- data/{lib/omnibus/generator_files/mac_dmg → resources/dmg}/icon.png +0 -0
- data/{bin → resources/makeself}/makeself-header.sh +0 -0
- data/{bin → resources/makeself}/makeself.sh +0 -0
- data/{lib/omnibus/generator_files/package_scripts/makeselfinst.erb → resources/makeself/post_extract.sh.erb} +4 -4
- data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/LICENSE.rtf +0 -0
- data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/banner_background.bmp +0 -0
- data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/dialog_background.bmp +0 -0
- data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/project.ico +0 -0
- data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/project_16x16.ico +0 -0
- data/{lib/omnibus/generator_files/windows_msi → resources/msi}/assets/project_32x32.ico +0 -0
- data/{spec/fixtures/sample/files/windows_msi/Resources/localization-en-us.wxl → resources/msi/localization-en-us.wxl.erb} +3 -4
- data/resources/msi/parameters.wxi.erb +9 -0
- data/{lib/omnibus/generator_files/windows_msi → resources/msi}/source.wxs.erb +14 -15
- data/{lib/omnibus/generator_files/mac_pkg → resources/pkg}/background.png +0 -0
- data/resources/pkg/distribution.xml.erb +21 -0
- data/resources/pkg/license.html.erb +3 -0
- data/resources/pkg/welcome.html.erb +7 -0
- data/resources/rpm/rpmmacros.erb +3 -0
- data/resources/rpm/signing.erb +40 -0
- data/resources/rpm/spec.erb +70 -0
- data/spec/functional/builder_spec.rb +90 -111
- data/spec/functional/fetchers/git_fetcher_spec.rb +130 -0
- data/spec/functional/fetchers/net_fetcher_spec.rb +110 -0
- data/spec/functional/fetchers/path_fetcher_spec.rb +97 -0
- data/spec/functional/file_syncer_spec.rb +206 -0
- data/spec/functional/templating_spec.rb +73 -0
- data/spec/spec_helper.rb +31 -94
- data/spec/support/env_helpers.rb +20 -0
- data/spec/support/examples.rb +56 -0
- data/spec/support/file_helpers.rb +46 -0
- data/spec/support/git_helpers.rb +107 -0
- data/spec/support/logging_helpers.rb +33 -0
- data/spec/support/matchers.rb +36 -0
- data/spec/support/ohai_helpers.rb +22 -0
- data/spec/support/path_helpers.rb +19 -0
- data/spec/support/shell_helpers.rb +14 -0
- data/spec/unit/build_version_dsl_spec.rb +0 -17
- data/spec/unit/build_version_spec.rb +1 -19
- data/spec/unit/builder_spec.rb +158 -46
- data/spec/unit/compressor_spec.rb +45 -0
- data/spec/unit/compressors/base_spec.rb +26 -0
- data/spec/unit/compressors/dmg_spec.rb +291 -0
- data/spec/unit/compressors/null_spec.rb +23 -0
- data/spec/unit/compressors/tgz_spec.rb +67 -0
- data/spec/unit/config_spec.rb +27 -34
- data/spec/unit/digestable_spec.rb +4 -4
- data/spec/unit/fetchers/git_fetcher_spec.rb +110 -39
- data/spec/unit/fetchers/net_fetcher_spec.rb +182 -72
- data/spec/unit/fetchers/path_fetcher_spec.rb +111 -0
- data/spec/unit/generator_spec.rb +137 -0
- data/spec/unit/git_cache_spec.rb +24 -34
- data/spec/unit/library_spec.rb +21 -82
- data/spec/unit/metadata_spec.rb +207 -0
- data/spec/unit/ohai_spec.rb +0 -7
- data/spec/unit/omnibus_spec.rb +41 -36
- data/spec/unit/package_spec.rb +1 -216
- data/spec/unit/packagers/base_spec.rb +76 -190
- data/spec/unit/packagers/bff_spec.rb +160 -0
- data/spec/unit/packagers/deb_spec.rb +324 -0
- data/spec/unit/packagers/makeself_spec.rb +80 -0
- data/spec/unit/packagers/msi_spec.rb +267 -0
- data/spec/unit/packagers/pkg_spec.rb +219 -0
- data/spec/unit/packagers/rpm_spec.rb +328 -0
- data/spec/unit/project_spec.rb +217 -80
- data/spec/unit/publisher_spec.rb +6 -2
- data/spec/unit/publishers/artifactory_publisher_spec.rb +1 -1
- data/spec/unit/publishers/s3_publisher_spec.rb +1 -1
- data/spec/unit/s3_cacher_spec.rb +22 -5
- data/spec/unit/software_spec.rb +89 -232
- data/spec/unit/util_spec.rb +188 -0
- metadata +159 -402
- data/features/commands/_deprecated.feature +0 -84
- data/lib/omnibus/cleanroom.rb +0 -141
- data/lib/omnibus/cli/deprecated.rb +0 -132
- data/lib/omnibus/generator_files/mac_pkg/license.html.erb +0 -1
- data/lib/omnibus/generator_files/mac_pkg/welcome.html.erb +0 -9
- data/lib/omnibus/generator_files/project.rb.erb +0 -20
- data/lib/omnibus/generator_files/software/c-example.rb.erb +0 -42
- data/lib/omnibus/generator_files/software/erlang-example.rb.erb +0 -38
- data/lib/omnibus/generator_files/software/ruby-example.rb.erb +0 -24
- data/lib/omnibus/generator_files/windows_msi/localization-en-us.wxl.erb +0 -20
- data/lib/omnibus/generator_files/windows_msi/parameters.wxi.erb +0 -9
- data/lib/omnibus/packagers/mac_dmg.rb +0 -235
- data/lib/omnibus/packagers/mac_pkg.rb +0 -176
- data/lib/omnibus/packagers/windows_msi.rb +0 -109
- data/spec/data/complicated/config/patches/bzip2/makefile_take_env_vars.patch +0 -15
- data/spec/data/complicated/config/patches/couchdb/patch_for_couchjs_stack.patch +0 -19
- data/spec/data/complicated/config/patches/gd/gd-2.0.33-configure-libpng.patch +0 -100
- data/spec/data/complicated/config/patches/keepalived/keepalived-1.2.9_opscode_centos_5.patch +0 -15
- data/spec/data/complicated/config/patches/libedit/freebsd-vi-fix.patch +0 -24
- data/spec/data/complicated/config/patches/libiconv/libiconv-1.14_srclib_stdio.in.h-remove-gets-declarations.patch +0 -29
- data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-makefile-dest-fix.patch +0 -35
- data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-malloc-fix.patch +0 -13
- data/spec/data/complicated/config/patches/libwrap/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch +0 -1035
- data/spec/data/complicated/config/patches/logrotate/logrotate_basedir_override.patch +0 -12
- data/spec/data/complicated/config/patches/ncurses/ncurses-5.9-solaris-xopen_source_extended-detection.patch +0 -11
- data/spec/data/complicated/config/patches/ncurses/ncurses-clang.patch +0 -42
- data/spec/data/complicated/config/patches/ncurses/patch-aa +0 -23
- data/spec/data/complicated/config/patches/ncurses/patch-ab +0 -44
- data/spec/data/complicated/config/patches/ncurses/patch-ac +0 -40
- data/spec/data/complicated/config/patches/ncurses/patch-ad +0 -12
- data/spec/data/complicated/config/patches/ncurses/patch-aix-configure +0 -23
- data/spec/data/complicated/config/patches/ncurses/patch-cxx_cursesf.h +0 -22
- data/spec/data/complicated/config/patches/ncurses/patch-cxx_cursesm.h +0 -22
- data/spec/data/complicated/config/patches/nrpe/fix_for_runit.patch +0 -64
- data/spec/data/complicated/config/patches/openssl/openssl-1.0.1f-do-not-build-docs.patch +0 -101
- data/spec/data/complicated/config/patches/postgresql/postgresql-9.1.2-configure-ncurses-fix.patch +0 -12
- data/spec/data/complicated/config/patches/ruby/patch-configure +0 -103
- data/spec/data/complicated/config/patches/ruby/ruby-aix-configure.patch +0 -10
- data/spec/data/complicated/config/patches/ruby/ruby-openssl-1.0.1c.patch +0 -42
- data/spec/data/complicated/config/patches/ruby/ruby_aix_1_9_3_448_ssl_EAGAIN.patch +0 -57
- data/spec/data/complicated/config/patches/ruby/rvm-cflags.patch +0 -27
- data/spec/data/complicated/config/projects/angrychef.rb +0 -32
- data/spec/data/complicated/config/projects/chef-windows.rb +0 -32
- data/spec/data/complicated/config/projects/chef.rb +0 -32
- data/spec/data/complicated/config/projects/chefdk-windows.rb +0 -41
- data/spec/data/complicated/config/projects/chefdk.rb +0 -44
- data/spec/data/complicated/config/software/appbundler.rb +0 -25
- data/spec/data/complicated/config/software/autoconf.rb +0 -35
- data/spec/data/complicated/config/software/automake.rb +0 -39
- data/spec/data/complicated/config/software/berkshelf.rb +0 -44
- data/spec/data/complicated/config/software/bundler.rb +0 -25
- data/spec/data/complicated/config/software/bzip2.rb +0 -46
- data/spec/data/complicated/config/software/cacerts.rb +0 -44
- data/spec/data/complicated/config/software/chef-client-msi.rb +0 -87
- data/spec/data/complicated/config/software/chef-gem.rb +0 -26
- data/spec/data/complicated/config/software/chef-vault.rb +0 -43
- data/spec/data/complicated/config/software/chef-windows.rb +0 -158
- data/spec/data/complicated/config/software/chef.rb +0 -170
- data/spec/data/complicated/config/software/chefdk.rb +0 -103
- data/spec/data/complicated/config/software/couchdb.rb +0 -53
- data/spec/data/complicated/config/software/curl.rb +0 -48
- data/spec/data/complicated/config/software/erlang.rb +0 -65
- data/spec/data/complicated/config/software/expat.rb +0 -21
- data/spec/data/complicated/config/software/fcgi.rb +0 -56
- data/spec/data/complicated/config/software/fcgiwrap.rb +0 -41
- data/spec/data/complicated/config/software/gd.rb +0 -56
- data/spec/data/complicated/config/software/gdbm.rb +0 -40
- data/spec/data/complicated/config/software/gecode.rb +0 -48
- data/spec/data/complicated/config/software/git.rb +0 -40
- data/spec/data/complicated/config/software/help2man.rb +0 -30
- data/spec/data/complicated/config/software/icu.rb +0 -40
- data/spec/data/complicated/config/software/jre.rb +0 -48
- data/spec/data/complicated/config/software/keepalived.rb +0 -43
- data/spec/data/complicated/config/software/libarchive.rb +0 -50
- data/spec/data/complicated/config/software/libedit.rb +0 -69
- data/spec/data/complicated/config/software/libffi.rb +0 -71
- data/spec/data/complicated/config/software/libgcc.rb +0 -39
- data/spec/data/complicated/config/software/libiconv.rb +0 -55
- data/spec/data/complicated/config/software/libjpeg.rb +0 -39
- data/spec/data/complicated/config/software/libpng.rb +0 -38
- data/spec/data/complicated/config/software/libtool.rb +0 -52
- data/spec/data/complicated/config/software/libwrap.rb +0 -50
- data/spec/data/complicated/config/software/libxml2.rb +0 -51
- data/spec/data/complicated/config/software/libxslt.rb +0 -52
- data/spec/data/complicated/config/software/libyaml-windows.rb +0 -43
- data/spec/data/complicated/config/software/libyaml.rb +0 -62
- data/spec/data/complicated/config/software/logrotate.rb +0 -41
- data/spec/data/complicated/config/software/makedepend.rb +0 -73
- data/spec/data/complicated/config/software/mysql2.rb +0 -42
- data/spec/data/complicated/config/software/nagios-plugins.rb +0 -53
- data/spec/data/complicated/config/software/nagios.rb +0 -66
- data/spec/data/complicated/config/software/ncurses.rb +0 -149
- data/spec/data/complicated/config/software/nginx.rb +0 -40
- data/spec/data/complicated/config/software/nodejs.rb +0 -44
- data/spec/data/complicated/config/software/nokogiri.rb +0 -55
- data/spec/data/complicated/config/software/nrpe.rb +0 -61
- data/spec/data/complicated/config/software/ohai.rb +0 -64
- data/spec/data/complicated/config/software/omnibus-ctl.rb +0 -34
- data/spec/data/complicated/config/software/openresty.rb +0 -67
- data/spec/data/complicated/config/software/openssl.rb +0 -158
- data/spec/data/complicated/config/software/pcre.rb +0 -42
- data/spec/data/complicated/config/software/perl-extutils-embed.rb +0 -15
- data/spec/data/complicated/config/software/perl-extutils-makemaker.rb +0 -15
- data/spec/data/complicated/config/software/perl.rb +0 -48
- data/spec/data/complicated/config/software/perl_pg_driver.rb +0 -12
- data/spec/data/complicated/config/software/php.rb +0 -41
- data/spec/data/complicated/config/software/pip.rb +0 -30
- data/spec/data/complicated/config/software/pkg-config.rb +0 -66
- data/spec/data/complicated/config/software/popt.rb +0 -47
- data/spec/data/complicated/config/software/postgresql.rb +0 -51
- data/spec/data/complicated/config/software/preparation.rb +0 -30
- data/spec/data/complicated/config/software/pygments.rb +0 -25
- data/spec/data/complicated/config/software/python.rb +0 -49
- data/spec/data/complicated/config/software/rabbitmq.rb +0 -36
- data/spec/data/complicated/config/software/rebar.rb +0 -36
- data/spec/data/complicated/config/software/redis.rb +0 -33
- data/spec/data/complicated/config/software/rsync.rb +0 -48
- data/spec/data/complicated/config/software/ruby-windows-devkit.rb +0 -30
- data/spec/data/complicated/config/software/ruby-windows.rb +0 -30
- data/spec/data/complicated/config/software/ruby.rb +0 -162
- data/spec/data/complicated/config/software/rubygems-customization.rb +0 -57
- data/spec/data/complicated/config/software/rubygems.rb +0 -37
- data/spec/data/complicated/config/software/runit.rb +0 -118
- data/spec/data/complicated/config/software/server-jre.rb +0 -46
- data/spec/data/complicated/config/software/setuptools.rb +0 -30
- data/spec/data/complicated/config/software/spawn-fcgi.rb +0 -40
- data/spec/data/complicated/config/software/sphinx.rb +0 -26
- data/spec/data/complicated/config/software/spidermonkey.rb +0 -60
- data/spec/data/complicated/config/software/sqitch.rb +0 -24
- data/spec/data/complicated/config/software/test-kitchen.rb +0 -39
- data/spec/data/complicated/config/software/unicorn.rb +0 -27
- data/spec/data/complicated/config/software/util-macros.rb +0 -46
- data/spec/data/complicated/config/software/xproto.rb +0 -46
- data/spec/data/complicated/config/software/yajl.rb +0 -30
- data/spec/data/complicated/config/software/zlib.rb +0 -67
- data/spec/data/overrides/bad_line.overrides +0 -3
- data/spec/data/overrides/good.overrides +0 -5
- data/spec/data/overrides/with_dupes.overrides +0 -4
- data/spec/data/projects/chefdk.rb +0 -41
- data/spec/data/projects/sample.rb +0 -13
- data/spec/data/software/erchef.rb +0 -42
- data/spec/data/software/zlib.rb +0 -67
- data/spec/fixtures/sample/files/mac_dmg/Resources/background.png +0 -0
- data/spec/fixtures/sample/files/mac_dmg/Resources/icon.png +0 -0
- data/spec/fixtures/sample/files/mac_pkg/Resources/background.png +0 -0
- data/spec/fixtures/sample/files/mac_pkg/Resources/license.html +0 -1
- data/spec/fixtures/sample/files/mac_pkg/Resources/welcome.html +0 -9
- data/spec/fixtures/sample/files/windows_msi/Resources/assets/LICENSE.rtf +0 -8
- data/spec/fixtures/sample/files/windows_msi/Resources/assets/banner_background.bmp +0 -0
- data/spec/fixtures/sample/files/windows_msi/Resources/assets/dialog_background.bmp +0 -0
- data/spec/fixtures/sample/files/windows_msi/Resources/assets/project.ico +0 -0
- data/spec/fixtures/sample/files/windows_msi/Resources/assets/project_16x16.ico +0 -0
- data/spec/fixtures/sample/files/windows_msi/Resources/assets/project_32x32.ico +0 -0
- data/spec/fixtures/sample/files/windows_msi/Resources/parameters.wxi.erb +0 -9
- data/spec/fixtures/sample/files/windows_msi/Resources/source.wxs +0 -74
- data/spec/integration/packagers/mac_spec.rb +0 -58
- data/spec/integration/packagers/windows_spec.rb +0 -70
- data/spec/unit/packagers/mac_pkg_spec.rb +0 -151
@@ -1,24 +0,0 @@
|
|
1
|
-
# This is an example software definition for a Ruby project.
|
2
|
-
#
|
3
|
-
# Lots of software definitions for popular open source software
|
4
|
-
# already exist in `opscode-omnibus`:
|
5
|
-
#
|
6
|
-
# https://github.com/opscode/omnibus-software/tree/master/config/software
|
7
|
-
#
|
8
|
-
name "ruby-example"
|
9
|
-
default_version "1.0.0"
|
10
|
-
|
11
|
-
dependency "ruby"
|
12
|
-
dependency "rubygems"
|
13
|
-
dependency "bundler"
|
14
|
-
dependency "rsync"
|
15
|
-
|
16
|
-
source :git => "git://github.com/example/ruby.git"
|
17
|
-
|
18
|
-
relative_path "ruby-example"
|
19
|
-
|
20
|
-
build do
|
21
|
-
bundle "install --path=#{install_dir}/embedded/service/gem"
|
22
|
-
command "mkdir -p #{install_dir}/embedded/service/ruby-example"
|
23
|
-
command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/ruby-example/"
|
24
|
-
end
|
@@ -1,20 +0,0 @@
|
|
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"><%= project.friendly_name %></String>
|
6
|
-
<String Id="ManufacturerName"><%= project.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"><%= project.friendly_name %></String>
|
20
|
-
</WixLocalization>
|
@@ -1,9 +0,0 @@
|
|
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>
|
@@ -1,235 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright 2014 Chef Software, Inc.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
#
|
16
|
-
|
17
|
-
module Omnibus
|
18
|
-
class Packager::MacDmg < Packager::Base
|
19
|
-
attr_reader :packager
|
20
|
-
|
21
|
-
validate do
|
22
|
-
assert_presence!(resource('background.png'))
|
23
|
-
assert_presence!(resource('icon.png'))
|
24
|
-
end
|
25
|
-
|
26
|
-
setup do
|
27
|
-
create_directory(dmg_stage)
|
28
|
-
purge_directory(staging_resources_path)
|
29
|
-
copy_directory(resources_path, staging_resources_path)
|
30
|
-
|
31
|
-
remove_file(writable_dmg)
|
32
|
-
clean_disks
|
33
|
-
end
|
34
|
-
|
35
|
-
build do
|
36
|
-
copy_assets_to_dmg
|
37
|
-
create_writable_dmg
|
38
|
-
attach_dmg
|
39
|
-
# Give some time to the system so attached dmg shows up in Finder
|
40
|
-
sleep 5
|
41
|
-
set_volume_icon
|
42
|
-
prettify_dmg
|
43
|
-
compress_dmg
|
44
|
-
set_dmg_icon
|
45
|
-
end
|
46
|
-
|
47
|
-
clean do
|
48
|
-
remove_file("#{staging_dir}/tmp.icns")
|
49
|
-
remove_file("#{staging_dir}/tmp.rsrc")
|
50
|
-
end
|
51
|
-
|
52
|
-
#
|
53
|
-
# Create a new DMG packager.
|
54
|
-
#
|
55
|
-
# @param [Packager::MacPkg] mac_packager
|
56
|
-
#
|
57
|
-
def initialize(mac_packager)
|
58
|
-
@packager = mac_packager
|
59
|
-
super(mac_packager.project)
|
60
|
-
end
|
61
|
-
|
62
|
-
#
|
63
|
-
# Cleans any previously left over mounted disks
|
64
|
-
#
|
65
|
-
def clean_disks
|
66
|
-
# We're trying to detach disks that look like below:
|
67
|
-
# /dev/disk1s1 on /Volumes/chef (hfs, local, nodev, nosuid, read-only, noowners, quarantine, mounted by serdar)
|
68
|
-
# /dev/disk2s1 on /Volumes/chef 1 (hfs, local, nodev, nosuid, read-only, noowners, quarantine, mounted by serdar)
|
69
|
-
existing_disks = execute "mount | grep /Volumes/#{project.name} | awk '{print $1}'"
|
70
|
-
existing_disks.stdout.lines.each do |existing_disk|
|
71
|
-
existing_disk.chomp!
|
72
|
-
Omnibus.logger.debug { "Detaching disk '#{existing_disk}' before starting dmg packaging." }
|
73
|
-
execute "hdiutil detach #{existing_disk}"
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
#
|
78
|
-
# Copy the assets in the local omnibus project into a staging folder that
|
79
|
-
# will soon become our writable dmg.
|
80
|
-
#
|
81
|
-
def copy_assets_to_dmg
|
82
|
-
# Copy the compiled pkg into the dmg
|
83
|
-
copy_file(packager.final_pkg, "#{dmg_stage}/#{project.name}.pkg")
|
84
|
-
|
85
|
-
# Copy support files
|
86
|
-
support = create_directory("#{dmg_stage}/.support")
|
87
|
-
copy_file(resource('background.png'), "#{support}/background.png")
|
88
|
-
end
|
89
|
-
|
90
|
-
#
|
91
|
-
# Create a writable dmg we can put assets on.
|
92
|
-
#
|
93
|
-
def create_writable_dmg
|
94
|
-
execute <<-EOH.gsub(/^ {8}/, '')
|
95
|
-
hdiutil create \\
|
96
|
-
-srcfolder "#{dmg_stage}" \\
|
97
|
-
-volname "#{project.name}" \\
|
98
|
-
-fs HFS+ \\
|
99
|
-
-fsargs "-c c=64,a=16,e=16" \\
|
100
|
-
-format UDRW \\
|
101
|
-
-size 512000k \\
|
102
|
-
"#{writable_dmg}"
|
103
|
-
EOH
|
104
|
-
end
|
105
|
-
|
106
|
-
#
|
107
|
-
# Attach the dmg, storing a reference to the device for later use.
|
108
|
-
#
|
109
|
-
def attach_dmg
|
110
|
-
@device = execute(<<-EOH.gsub(/^ {8}/, '')).stdout.strip
|
111
|
-
hdiutil attach \\
|
112
|
-
-readwrite \\
|
113
|
-
-noverify \\
|
114
|
-
-noautoopen \\
|
115
|
-
"#{writable_dmg}" | egrep '^/dev/' | sed 1q | awk '{print $1}'
|
116
|
-
EOH
|
117
|
-
end
|
118
|
-
|
119
|
-
#
|
120
|
-
# Create the icon for the volume using sips.
|
121
|
-
#
|
122
|
-
def set_volume_icon
|
123
|
-
execute <<-EOH.gsub(/^ {8}/, '')
|
124
|
-
# Generate the icns
|
125
|
-
mkdir tmp.iconset
|
126
|
-
sips -z 16 16 #{resource('icon.png')} --out tmp.iconset/icon_16x16.png
|
127
|
-
sips -z 32 32 #{resource('icon.png')} --out tmp.iconset/icon_16x16@2x.png
|
128
|
-
sips -z 32 32 #{resource('icon.png')} --out tmp.iconset/icon_32x32.png
|
129
|
-
sips -z 64 64 #{resource('icon.png')} --out tmp.iconset/icon_32x32@2x.png
|
130
|
-
sips -z 128 128 #{resource('icon.png')} --out tmp.iconset/icon_128x128.png
|
131
|
-
sips -z 256 256 #{resource('icon.png')} --out tmp.iconset/icon_128x128@2x.png
|
132
|
-
sips -z 256 256 #{resource('icon.png')} --out tmp.iconset/icon_256x256.png
|
133
|
-
sips -z 512 512 #{resource('icon.png')} --out tmp.iconset/icon_256x256@2x.png
|
134
|
-
sips -z 512 512 #{resource('icon.png')} --out tmp.iconset/icon_512x512.png
|
135
|
-
sips -z 1024 1024 #{resource('icon.png')} --out tmp.iconset/icon_512x512@2x.png
|
136
|
-
iconutil -c icns tmp.iconset
|
137
|
-
|
138
|
-
# Copy it over
|
139
|
-
cp tmp.icns "/Volumes/#{project.name}/.VolumeIcon.icns"
|
140
|
-
|
141
|
-
# Source the icon
|
142
|
-
SetFile -a C "/Volumes/#{project.name}"
|
143
|
-
EOH
|
144
|
-
end
|
145
|
-
|
146
|
-
#
|
147
|
-
# Use Applescript to setup the DMG with pretty logos and colors.
|
148
|
-
#
|
149
|
-
def prettify_dmg
|
150
|
-
execute <<-EOH.gsub(/ ^{8}/, '')
|
151
|
-
echo '
|
152
|
-
tell application "Finder"
|
153
|
-
tell disk "'#{project.name}'"
|
154
|
-
open
|
155
|
-
set current view of container window to icon view
|
156
|
-
set toolbar visible of container window to false
|
157
|
-
set statusbar visible of container window to false
|
158
|
-
set the bounds of container window to {#{Config[:dmg_window_bounds]}}
|
159
|
-
set theViewOptions to the icon view options of container window
|
160
|
-
set arrangement of theViewOptions to not arranged
|
161
|
-
set icon size of theViewOptions to 72
|
162
|
-
set background picture of theViewOptions to file ".support:'background.png'"
|
163
|
-
delay 5
|
164
|
-
set position of item "'#{project.name}.pkg'" of container window to {#{Config[:dmg_pkg_position]}}
|
165
|
-
update without registering applications
|
166
|
-
delay 5
|
167
|
-
end tell
|
168
|
-
end tell
|
169
|
-
' | osascript
|
170
|
-
EOH
|
171
|
-
end
|
172
|
-
|
173
|
-
#
|
174
|
-
# Compress the dmg using hdiutil and zlib.
|
175
|
-
#
|
176
|
-
def compress_dmg
|
177
|
-
execute <<-EOH.gsub(/ ^{8}/, '')
|
178
|
-
chmod -Rf go-w /Volumes/#{project.name}
|
179
|
-
sync
|
180
|
-
hdiutil detach "#{@device}"
|
181
|
-
hdiutil convert \\
|
182
|
-
"#{writable_dmg}" \\
|
183
|
-
-format UDZO \\
|
184
|
-
-imagekey zlib-level=9 \\
|
185
|
-
-o "#{final_dmg}"
|
186
|
-
rm -rf "#{writable_dmg}"
|
187
|
-
EOH
|
188
|
-
end
|
189
|
-
|
190
|
-
#
|
191
|
-
# Set the dmg icon to our custom icon.
|
192
|
-
#
|
193
|
-
def set_dmg_icon
|
194
|
-
execute <<-EOH.gsub(/^ {8}/, '')
|
195
|
-
# Convert the png to an icon
|
196
|
-
sips -i "#{resource('icon.png')}"
|
197
|
-
|
198
|
-
# Extract the icon into its own resource
|
199
|
-
DeRez -only icns "#{resource('icon.png')}" > tmp.rsrc
|
200
|
-
|
201
|
-
# Append the icon reosurce to the DMG
|
202
|
-
Rez -append tmp.rsrc -o "#{final_dmg}"
|
203
|
-
|
204
|
-
# Source the icon
|
205
|
-
SetFile -a C "#{final_dmg}"
|
206
|
-
EOH
|
207
|
-
end
|
208
|
-
|
209
|
-
# @see Base#package_name
|
210
|
-
def package_name
|
211
|
-
"#{project.name}-#{project.build_version}-#{project.iteration}.dmg"
|
212
|
-
end
|
213
|
-
|
214
|
-
# The path to the folder that we should stage.
|
215
|
-
#
|
216
|
-
# @return [String]
|
217
|
-
def dmg_stage
|
218
|
-
File.expand_path("#{staging_dir}/dmg")
|
219
|
-
end
|
220
|
-
|
221
|
-
# The path to the writable dmg on disk.
|
222
|
-
#
|
223
|
-
# @return [String]
|
224
|
-
def writable_dmg
|
225
|
-
File.expand_path("#{staging_dir}/#{project.name}-writable.dmg")
|
226
|
-
end
|
227
|
-
|
228
|
-
# The path where the final dmg will be produced.
|
229
|
-
#
|
230
|
-
# @return [String]
|
231
|
-
def final_dmg
|
232
|
-
File.expand_path("#{Config.package_dir}/#{project.name}-#{project.build_version}-#{project.iteration}.dmg")
|
233
|
-
end
|
234
|
-
end
|
235
|
-
end
|
@@ -1,176 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright 2014 Chef Software, Inc.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
#
|
16
|
-
|
17
|
-
module Omnibus
|
18
|
-
# Builds a Mac OS X "product" package (.pkg extension)
|
19
|
-
#
|
20
|
-
# Mac OS X packages are built in two stages. First, files are packaged up
|
21
|
-
# into one or more "component" .pkg files (MacPkg only supports making a
|
22
|
-
# single component). This is done with `pkgbuild`. Next the component(s)
|
23
|
-
# are combined into a single "product" package, using `productbuild`. It is
|
24
|
-
# this container package that can have custom branding (background image)
|
25
|
-
# and a license. It can also allow for user customization of which
|
26
|
-
# component packages to install, but MacPkg does not expose this feature.
|
27
|
-
class Packager::MacPkg < Packager::Base
|
28
|
-
validate do
|
29
|
-
assert_presence!(resource('background.png'))
|
30
|
-
assert_presence!(resource('license.html'))
|
31
|
-
assert_presence!(resource('welcome.html'))
|
32
|
-
end
|
33
|
-
|
34
|
-
setup do
|
35
|
-
purge_directory(staging_dir)
|
36
|
-
purge_directory(Config.package_dir)
|
37
|
-
purge_directory(staging_resources_path)
|
38
|
-
copy_directory(resources_path, staging_resources_path)
|
39
|
-
|
40
|
-
# Render resource templates if needed
|
41
|
-
['license.html.erb', 'welcome.html.erb'].each do |res|
|
42
|
-
res_path = resource(res)
|
43
|
-
render_template(res_path) if File.exist?(res_path)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
build do
|
48
|
-
build_component_pkg
|
49
|
-
generate_distribution
|
50
|
-
build_product_pkg
|
51
|
-
|
52
|
-
if Config.build_dmg
|
53
|
-
Packager::MacDmg.new(self).run!
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
clean do
|
58
|
-
# There is nothing to cleanup
|
59
|
-
end
|
60
|
-
|
61
|
-
# @see Base#package_name
|
62
|
-
def package_name
|
63
|
-
"#{project.name}-#{project.build_version}-#{project.iteration}.pkg"
|
64
|
-
end
|
65
|
-
|
66
|
-
# The full path where the product package was/will be written.
|
67
|
-
#
|
68
|
-
# @return [String] Path to the packge file.
|
69
|
-
def final_pkg
|
70
|
-
File.expand_path("#{Config.package_dir}/#{package_name}")
|
71
|
-
end
|
72
|
-
|
73
|
-
#
|
74
|
-
# Construct the intermediate build product. It can be installed with the
|
75
|
-
# Installer.app, but doesn't contain the data needed to customize the
|
76
|
-
# installer UI.
|
77
|
-
#
|
78
|
-
def build_component_pkg
|
79
|
-
execute <<-EOH.gsub(/^ {8}/, '')
|
80
|
-
pkgbuild \\
|
81
|
-
--identifier "#{identifier}" \\
|
82
|
-
--version "#{project.build_version}" \\
|
83
|
-
--scripts "#{project.package_scripts_path}" \\
|
84
|
-
--root "#{project.install_dir}" \\
|
85
|
-
--install-location "#{project.install_dir}" \\
|
86
|
-
"#{component_pkg}"
|
87
|
-
EOH
|
88
|
-
end
|
89
|
-
|
90
|
-
#
|
91
|
-
# Write the Distribution file to the staging area. This method generates the
|
92
|
-
# content of the Distribution file, which is used by +productbuild+ to
|
93
|
-
# select the component packages to include in the product package.
|
94
|
-
#
|
95
|
-
# It also includes information used to customize the UI of the Mac OS X
|
96
|
-
# installer.
|
97
|
-
#
|
98
|
-
def generate_distribution
|
99
|
-
File.open(distribution_file, 'w', 0600) do |file|
|
100
|
-
file.puts <<-EOH.gsub(/^ {10}/, '')
|
101
|
-
<?xml version="1.0" standalone="no"?>
|
102
|
-
<installer-gui-script minSpecVersion="1">
|
103
|
-
<title>#{project.friendly_name}</title>
|
104
|
-
<background file="background.png" alignment="bottomleft" mime-type="image/png"/>
|
105
|
-
<welcome file="welcome.html" mime-type="text/html"/>
|
106
|
-
<license file="license.html" mime-type="text/html"/>
|
107
|
-
|
108
|
-
<!-- Generated by productbuild - - synthesize -->
|
109
|
-
<pkg-ref id="#{identifier}"/>
|
110
|
-
<options customize="never" require-scripts="false"/>
|
111
|
-
<choices-outline>
|
112
|
-
<line choice="default">
|
113
|
-
<line choice="#{identifier}"/>
|
114
|
-
</line>
|
115
|
-
</choices-outline>
|
116
|
-
<choice id="default"/>
|
117
|
-
<choice id="#{identifier}" visible="false">
|
118
|
-
<pkg-ref id="#{identifier}"/>
|
119
|
-
</choice>
|
120
|
-
<pkg-ref id="#{identifier}" version="#{project.build_version}" onConclusion="none">#{component_pkg}</pkg-ref>
|
121
|
-
</installer-gui-script>
|
122
|
-
EOH
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
#
|
127
|
-
# Construct the product package. The generated package is the final build
|
128
|
-
# product that is shipped to end users.
|
129
|
-
#
|
130
|
-
def build_product_pkg
|
131
|
-
command = <<-EOH.gsub(/^ {8}/, '')
|
132
|
-
productbuild \\
|
133
|
-
--distribution "#{distribution_file}" \\
|
134
|
-
--resources "#{staging_resources_path}" \\
|
135
|
-
EOH
|
136
|
-
|
137
|
-
command << %Q( --sign "#{Config.signing_identity}" \\\n) if Config.sign_pkg
|
138
|
-
command << %Q( "#{final_pkg}")
|
139
|
-
command << %Q(\n)
|
140
|
-
|
141
|
-
execute(command)
|
142
|
-
end
|
143
|
-
|
144
|
-
# The identifier for this mac package (the com.whatever.thing.whatever).
|
145
|
-
# This is a configurable project value, but a default value is calculated if
|
146
|
-
# one is not given.
|
147
|
-
#
|
148
|
-
# @return [String]
|
149
|
-
def identifier
|
150
|
-
@identifier ||= project.mac_pkg_identifier ||
|
151
|
-
"test.#{sanitize(project.maintainer)}.pkg.#{sanitize(project.name)}"
|
152
|
-
end
|
153
|
-
|
154
|
-
# Filesystem path where the Distribution XML file is written.
|
155
|
-
#
|
156
|
-
# @return [String]
|
157
|
-
def distribution_file
|
158
|
-
File.expand_path("#{staging_dir}/Distribution")
|
159
|
-
end
|
160
|
-
|
161
|
-
# The name of the (only) component package.
|
162
|
-
#
|
163
|
-
# @return [String] the filename of the component .pkg file to create.
|
164
|
-
def component_pkg
|
165
|
-
"#{project.name}-core.pkg"
|
166
|
-
end
|
167
|
-
|
168
|
-
# Sanitize the given string for the package identifier.
|
169
|
-
#
|
170
|
-
# @param [String]
|
171
|
-
# @return [String]
|
172
|
-
def sanitize(string)
|
173
|
-
string.gsub(/[^[:alnum:]]/, '').downcase
|
174
|
-
end
|
175
|
-
end
|
176
|
-
end
|