puppet 3.0.0.rc5 → 3.0.0.rc7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/LICENSE +1 -1
- data/README_DEVELOPER.md +209 -1
- data/README_HIERA.md +148 -0
- data/Rakefile +25 -27
- data/bin/extlookup2hiera +56 -0
- data/conf/auth.conf +34 -34
- data/examples/hiera/README.md +91 -0
- data/examples/hiera/etc/hiera.yaml +15 -0
- data/examples/hiera/etc/hieradb/common.yaml +3 -0
- data/examples/hiera/etc/hieradb/dc1.yaml +6 -0
- data/examples/hiera/etc/hieradb/development.yaml +2 -0
- data/examples/hiera/etc/puppet.conf +3 -0
- data/examples/hiera/modules/data/manifests/common.pp +3 -0
- data/examples/hiera/modules/ntp/manifests/config.pp +5 -0
- data/examples/hiera/modules/ntp/manifests/data.pp +3 -0
- data/examples/hiera/modules/ntp/templates/ntp.conf.erb +3 -0
- data/examples/hiera/modules/users/manifests/common.pp +3 -0
- data/examples/hiera/modules/users/manifests/dc1.pp +3 -0
- data/examples/hiera/modules/users/manifests/development.pp +3 -0
- data/examples/hiera/site.pp +3 -0
- data/ext/build_defaults.yaml +23 -0
- data/ext/debian/README.Debian +8 -0
- data/ext/debian/README.source +2 -0
- data/ext/debian/TODO.Debian +1 -0
- data/ext/debian/changelog.erb +1104 -0
- data/ext/debian/compat +1 -0
- data/ext/debian/control +143 -0
- data/ext/debian/copyright +361 -0
- data/ext/debian/docs +1 -0
- data/ext/debian/fileserver.conf +17 -0
- data/ext/debian/puppet-common.dirs +8 -0
- data/ext/debian/puppet-common.install +4 -0
- data/ext/debian/puppet-common.lintian-overrides +5 -0
- data/ext/debian/puppet-common.manpages +2 -0
- data/ext/debian/puppet-common.postinst +35 -0
- data/ext/debian/puppet-common.postrm +32 -0
- data/ext/debian/puppet-el.dirs +1 -0
- data/ext/debian/puppet-el.emacsen-install +25 -0
- data/ext/debian/puppet-el.emacsen-remove +11 -0
- data/ext/debian/puppet-el.emacsen-startup +9 -0
- data/ext/debian/puppet-el.install +1 -0
- data/ext/debian/puppet-testsuite.install +2 -0
- data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
- data/ext/debian/puppet.conf +14 -0
- data/ext/debian/puppet.default +7 -0
- data/ext/debian/puppet.init +118 -0
- data/ext/debian/puppet.lintian-overrides +3 -0
- data/ext/debian/puppet.logrotate +11 -0
- data/ext/debian/puppet.manpages +32 -0
- data/ext/debian/puppet.postinst +20 -0
- data/ext/debian/puppet.postrm +20 -0
- data/ext/debian/puppet.preinst +20 -0
- data/ext/debian/puppetmaster-common.install +2 -0
- data/ext/debian/puppetmaster-common.manpages +2 -0
- data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
- data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
- data/ext/debian/puppetmaster-passenger.dirs +4 -0
- data/ext/debian/puppetmaster-passenger.postinst +66 -0
- data/ext/debian/puppetmaster-passenger.postrm +33 -0
- data/ext/debian/puppetmaster.README.debian +16 -0
- data/ext/debian/puppetmaster.default +38 -0
- data/ext/debian/puppetmaster.init +158 -0
- data/ext/debian/puppetmaster.lintian-overrides +3 -0
- data/ext/debian/puppetmaster.postinst +20 -0
- data/ext/debian/puppetmaster.postrm +5 -0
- data/ext/debian/puppetmaster.preinst +22 -0
- data/ext/debian/rules +128 -0
- data/ext/debian/source/format +1 -0
- data/ext/debian/source/options +1 -0
- data/ext/debian/vim-puppet.README.Debian +13 -0
- data/ext/debian/vim-puppet.dirs +3 -0
- data/ext/debian/vim-puppet.yaml +5 -0
- data/ext/debian/watch +2 -0
- data/ext/emacs/puppet-mode.el +1 -0
- data/ext/envpuppet +4 -0
- data/ext/envpuppet.bat +3 -2
- data/{conf → ext}/freebsd/puppetd +0 -0
- data/{conf → ext}/freebsd/puppetmasterd +0 -0
- data/{conf → ext}/gentoo/conf.d/puppet +0 -0
- data/{conf → ext}/gentoo/conf.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/init.d/puppet +0 -0
- data/{conf → ext}/gentoo/init.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/puppet/fileserver.conf +0 -0
- data/{conf → ext}/gentoo/puppet/puppet.conf +0 -0
- data/ext/ips/puppet-agent +49 -0
- data/ext/ips/puppet-master +44 -0
- data/ext/ips/puppet.conf +29 -0
- data/ext/ips/puppet.p5m.erb +12 -0
- data/ext/ips/puppetagent.xml +46 -0
- data/ext/ips/puppetmaster.xml +42 -0
- data/ext/ips/rules +19 -0
- data/ext/ips/transforms +34 -0
- data/{conf → ext}/osx/PackageInfo.plist +0 -0
- data/{conf → ext}/osx/createpackage.sh +1 -1
- data/ext/osx/file_mapping.yaml +33 -0
- data/ext/osx/preflight.erb +37 -0
- data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
- data/ext/packaging/README-Solaris.md +117 -0
- data/ext/packaging/README.md +89 -0
- data/ext/packaging/tasks/00_utils.rb +236 -0
- data/ext/packaging/tasks/10_setupvars.rake +62 -0
- data/ext/packaging/tasks/apple.rake +201 -0
- data/ext/packaging/tasks/clean.rake +5 -0
- data/ext/packaging/tasks/deb.rake +105 -0
- data/ext/packaging/tasks/gem.rake +52 -0
- data/ext/packaging/tasks/ips.rake +78 -0
- data/ext/packaging/tasks/mock.rake +88 -0
- data/ext/packaging/tasks/release.rake +20 -0
- data/ext/packaging/tasks/rpm.rake +39 -0
- data/ext/packaging/tasks/ship.rake +34 -0
- data/ext/packaging/tasks/sign.rake +76 -0
- data/ext/packaging/tasks/tar.rake +20 -0
- data/ext/project_data.yaml +25 -0
- data/ext/rack/files/apache2.conf +2 -1
- data/{conf → ext}/redhat/client.init +0 -0
- data/{conf → ext}/redhat/client.sysconfig +0 -0
- data/{conf → ext}/redhat/fileserver.conf +0 -0
- data/{conf → ext}/redhat/logrotate +0 -0
- data/{conf → ext}/redhat/puppet.conf +0 -0
- data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +140 -33
- data/{conf → ext}/redhat/queue.init +0 -0
- data/{conf → ext}/redhat/rundir-perms.patch +0 -0
- data/{conf → ext}/redhat/server.init +0 -0
- data/{conf → ext}/redhat/server.sysconfig +0 -0
- data/{conf → ext}/solaris/pkginfo +0 -0
- data/{conf → ext}/solaris/smf/puppetd.xml +0 -0
- data/{conf → ext}/solaris/smf/puppetmasterd.xml +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetd +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetmasterd +0 -0
- data/{conf → ext}/suse/client.init +0 -0
- data/{conf → ext}/suse/fileserver.conf +0 -0
- data/{conf → ext}/suse/logrotate +0 -0
- data/{conf → ext}/suse/puppet.conf +0 -0
- data/{conf → ext}/suse/puppet.spec +1 -1
- data/{conf → ext}/suse/server.init +0 -0
- data/ext/systemd/puppetagent.service +13 -0
- data/ext/systemd/puppetmaster.service +13 -0
- data/{conf → ext}/windows/eventlog/Rakefile +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.dll +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.mc +0 -0
- data/ext/windows/service/daemon.bat +6 -0
- data/ext/windows/service/daemon.rb +90 -0
- data/install.rb +22 -32
- data/lib/hiera/backend/puppet_backend.rb +102 -0
- data/lib/hiera/scope.rb +42 -0
- data/lib/hiera_puppet.rb +89 -0
- data/lib/puppet.rb +1 -1
- data/lib/puppet/agent.rb +2 -2
- data/lib/puppet/agent/locker.rb +12 -9
- data/lib/puppet/application.rb +10 -8
- data/lib/puppet/application/agent.rb +12 -8
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/cert.rb +6 -6
- data/lib/puppet/application/certificate.rb +1 -4
- data/lib/puppet/application/describe.rb +1 -1
- data/lib/puppet/application/device.rb +5 -2
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/face_base.rb +3 -13
- data/lib/puppet/application/filebucket.rb +1 -1
- data/lib/puppet/application/inspect.rb +1 -1
- data/lib/puppet/application/kick.rb +4 -2
- data/lib/puppet/application/master.rb +2 -2
- data/lib/puppet/application/queue.rb +3 -1
- data/lib/puppet/application/resource.rb +1 -1
- data/lib/puppet/configurer.rb +11 -7
- data/lib/puppet/configurer/downloader.rb +1 -4
- data/lib/puppet/daemon.rb +4 -4
- data/lib/puppet/defaults.rb +64 -60
- data/lib/puppet/external/dot.rb +1 -1
- data/lib/puppet/external/pson/common.rb +15 -0
- data/lib/puppet/external/pson/pure.rb +0 -62
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +2 -2
- data/lib/puppet/face/ca.rb +19 -14
- data/lib/puppet/face/config.rb +2 -2
- data/lib/puppet/face/facts.rb +1 -1
- data/lib/puppet/face/help/action.erb +0 -1
- data/lib/puppet/face/help/face.erb +0 -1
- data/lib/puppet/face/help/man.erb +3 -6
- data/lib/puppet/face/module/install.rb +1 -1
- data/lib/puppet/face/module/list.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/node.rb +1 -1
- data/lib/puppet/face/node/clean.rb +30 -25
- data/lib/puppet/feature/base.rb +0 -3
- data/lib/puppet/feature/rails.rb +2 -1
- data/lib/puppet/file_serving/terminus_selector.rb +1 -1
- data/lib/puppet/indirector/catalog/active_record.rb +5 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +2 -3
- data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/face.rb +3 -3
- data/lib/puppet/indirector/facts/active_record.rb +5 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -4
- data/lib/puppet/indirector/facts/inventory_active_record.rb +6 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +2 -1
- data/lib/puppet/indirector/indirection.rb +2 -2
- data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/node/active_record.rb +5 -0
- data/lib/puppet/indirector/request.rb +4 -0
- data/lib/puppet/indirector/resource/active_record.rb +5 -0
- data/lib/puppet/network/authentication.rb +30 -0
- data/lib/puppet/network/http.rb +0 -13
- data/lib/puppet/network/http/connection.rb +10 -2
- data/lib/puppet/network/http/handler.rb +8 -0
- data/lib/puppet/network/http/mongrel/rest.rb +5 -0
- data/lib/puppet/network/http/rack/rest.rb +7 -0
- data/lib/puppet/network/http/webrick.rb +3 -6
- data/lib/puppet/network/http/webrick/rest.rb +4 -0
- data/lib/puppet/network/server.rb +9 -33
- data/lib/puppet/node.rb +1 -1
- data/lib/puppet/node/facts.rb +0 -1
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions.rb +12 -1
- data/lib/puppet/parser/functions/hiera.rb +8 -0
- data/lib/puppet/parser/functions/hiera_array.rb +8 -0
- data/lib/puppet/parser/functions/hiera_hash.rb +8 -0
- data/lib/puppet/parser/functions/hiera_include.rb +11 -0
- data/lib/puppet/parser/functions/shellquote.rb +21 -29
- data/lib/puppet/parser/lexer.rb +2 -1
- data/lib/puppet/parser/scope.rb +8 -0
- data/lib/puppet/provider/exec/windows.rb +1 -1
- data/lib/puppet/provider/group/groupadd.rb +2 -3
- data/lib/puppet/provider/package/pkg.rb +37 -10
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/runit.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +8 -3
- data/lib/puppet/provider/user/windows_adsi.rb +11 -0
- data/lib/puppet/provider/zfs/zfs.rb +29 -2
- data/lib/puppet/provider/zone/solaris.rb +144 -39
- data/lib/puppet/provider/zpool/zpool.rb +7 -10
- data/lib/puppet/settings.rb +50 -86
- data/lib/puppet/settings/duration_setting.rb +34 -0
- data/lib/puppet/settings/terminus_setting.rb +16 -0
- data/lib/puppet/ssl/base.rb +49 -9
- data/lib/puppet/ssl/certificate.rb +13 -9
- data/lib/puppet/ssl/certificate_authority.rb +4 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +10 -17
- data/lib/puppet/ssl/certificate_factory.rb +4 -21
- data/lib/puppet/ssl/certificate_request.rb +1 -10
- data/lib/puppet/ssl/certificate_revocation_list.rb +1 -3
- data/lib/puppet/ssl/digest.rb +20 -0
- data/lib/puppet/ssl/host.rb +31 -6
- data/lib/puppet/test/test_helper.rb +1 -1
- data/lib/puppet/transaction/report.rb +2 -1
- data/lib/puppet/type.rb +1 -1
- data/lib/puppet/type/augeas.rb +1 -1
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +7 -8
- data/lib/puppet/type/file.rb +1 -1
- data/lib/puppet/type/file/content.rb +2 -2
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/selcontext.rb +6 -2
- data/lib/puppet/type/file/source.rb +1 -1
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/scheduled_task.rb +1 -1
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/type/zone.rb +126 -253
- data/lib/puppet/util.rb +10 -23
- data/lib/puppet/util/adsi.rb +22 -14
- data/lib/puppet/util/log/destinations.rb +7 -0
- data/lib/puppet/util/log/rate_limited_logger.rb +40 -0
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +8 -0
- data/lib/puppet/util/platform.rb +7 -0
- data/lib/puppet/util/selinux.rb +31 -36
- data/lib/puppet/util/windows/error.rb +1 -1
- data/lib/puppet/util/windows/process.rb +3 -3
- data/lib/puppet/util/windows/security.rb +7 -7
- data/lib/puppet/util/windows/user.rb +65 -2
- data/lib/puppet/util/zaml.rb +90 -46
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/hiera.yaml +9 -0
- data/spec/fixtures/manifests/site.pp +0 -0
- data/spec/integration/defaults_spec.rb +25 -11
- data/spec/integration/faces/ca_spec.rb +11 -16
- data/spec/integration/network/server/webrick_spec.rb +14 -27
- data/spec/integration/node_spec.rb +4 -1
- data/spec/integration/parser/functions/require_spec.rb +3 -3
- data/spec/integration/parser/undef_param_spec.rb +88 -0
- data/spec/integration/provider/mount_spec.rb +4 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +18 -0
- data/spec/lib/puppet_spec/files.rb +3 -3
- data/spec/lib/puppet_spec/settings.rb +0 -1
- data/spec/shared_contexts/platform.rb +8 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/unit/agent/locker_spec.rb +8 -2
- data/spec/unit/application/agent_spec.rb +29 -7
- data/spec/unit/application/apply_spec.rb +1 -1
- data/spec/unit/application/device_spec.rb +18 -1
- data/spec/unit/application/face_base_spec.rb +16 -2
- data/spec/unit/application/kick_spec.rb +8 -0
- data/spec/unit/application/queue_spec.rb +5 -0
- data/spec/unit/application_spec.rb +13 -23
- data/spec/unit/configurer/downloader_spec.rb +2 -11
- data/spec/unit/configurer_spec.rb +6 -0
- data/spec/unit/face/node_spec.rb +1 -1
- data/spec/unit/hiera/backend/puppet_backend_spec.rb +140 -0
- data/spec/unit/hiera/scope_spec.rb +62 -0
- data/spec/unit/hiera_puppet_spec.rb +111 -0
- data/spec/unit/indirector/catalog/active_record_spec.rb +4 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/facts/active_record_spec.rb +37 -26
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +5 -0
- data/spec/unit/indirector/hiera_spec.rb +2 -1
- data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/node/active_record_spec.rb +7 -0
- data/spec/unit/indirector/request_spec.rb +22 -0
- data/spec/unit/indirector/resource/active_record_spec.rb +5 -0
- data/spec/unit/module_tool/application_spec.rb +1 -1
- data/spec/unit/network/authentication_spec.rb +86 -0
- data/spec/unit/network/http/connection_spec.rb +21 -0
- data/spec/unit/network/http/handler_spec.rb +12 -0
- data/spec/unit/network/http/rack/rest_spec.rb +7 -0
- data/spec/unit/network/http/webrick_spec.rb +11 -26
- data/spec/unit/network/server_spec.rb +79 -192
- data/spec/unit/node/facts_spec.rb +2 -2
- data/spec/unit/parser/ast/vardef_spec.rb +4 -4
- data/spec/unit/parser/files_spec.rb +3 -0
- data/spec/unit/parser/functions/defined_spec.rb +5 -5
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_array_spec.rb +23 -0
- data/spec/unit/parser/functions/hiera_hash_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_include_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_spec.rb +21 -0
- data/spec/unit/parser/functions/include_spec.rb +3 -3
- data/spec/unit/parser/functions/realize_spec.rb +3 -3
- data/spec/unit/parser/functions/require_spec.rb +5 -5
- data/spec/unit/parser/functions/shellquote_spec.rb +0 -4
- data/spec/unit/parser/functions_spec.rb +6 -10
- data/spec/unit/parser/lexer_spec.rb +13 -0
- data/spec/unit/parser/scope_spec.rb +16 -1
- data/spec/unit/provider/exec/posix_spec.rb +7 -6
- data/spec/unit/provider/group/groupadd_spec.rb +36 -30
- data/spec/unit/provider/package/pkg_spec.rb +16 -2
- data/spec/unit/provider/service/redhat_spec.rb +2 -2
- data/spec/unit/provider/sshkey/parsed_spec.rb +4 -0
- data/spec/unit/provider/user/user_role_add_spec.rb +125 -126
- data/spec/unit/provider/user/useradd_spec.rb +147 -118
- data/spec/unit/provider/user/windows_adsi_spec.rb +22 -0
- data/spec/unit/provider/zone/solaris_spec.rb +126 -7
- data/spec/unit/provider/zpool/zpool_spec.rb +4 -3
- data/spec/unit/puppet_spec.rb +7 -0
- data/spec/unit/settings/duration_setting_spec.rb +45 -0
- data/spec/unit/settings/terminus_setting_spec.rb +28 -0
- data/spec/unit/settings_spec.rb +21 -23
- data/spec/unit/ssl/base_spec.rb +68 -19
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +19 -30
- data/spec/unit/ssl/certificate_authority_spec.rb +3 -2
- data/spec/unit/ssl/certificate_factory_spec.rb +15 -6
- data/spec/unit/ssl/certificate_request_spec.rb +80 -113
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/unit/ssl/certificate_spec.rb +26 -2
- data/spec/unit/ssl/digest_spec.rb +35 -0
- data/spec/unit/ssl/host_spec.rb +73 -27
- data/spec/unit/ssl/key_spec.rb +0 -4
- data/spec/unit/type/exec_spec.rb +1 -1
- data/spec/unit/type/file_spec.rb +2 -1
- data/spec/unit/type/scheduled_task_spec.rb +2 -2
- data/spec/unit/type/zone_spec.rb +52 -10
- data/spec/unit/util/adsi_spec.rb +19 -0
- data/spec/unit/util/checksums_spec.rb +2 -3
- data/spec/unit/util/execution_spec.rb +1 -1
- data/spec/unit/util/log/destinations_spec.rb +1 -0
- data/spec/unit/util/log/rate_limited_logger_spec.rb +51 -0
- data/spec/unit/util/logging_spec.rb +6 -6
- data/spec/unit/util/selinux_spec.rb +24 -32
- data/spec/unit/util/zaml_spec.rb +94 -6
- data/spec/unit/util_spec.rb +17 -0
- data/spec/watchr.rb +2 -6
- data/tasks/{rake/manpages.rake → manpages.rake} +0 -0
- data/tasks/{rake/parser.rake → parser.rake} +0 -0
- metadata +1003 -119
- data/CHANGELOG +0 -9233
- data/conf/osx/preflight +0 -24
- data/lib/puppet/network/http/mongrel.rb +0 -35
- data/lib/puppet/util/config_timeout.rb +0 -24
- data/spec/unit/network/http/mongrel/rest_spec.rb +0 -257
- data/spec/unit/network/http/mongrel_spec.rb +0 -91
- data/spec/unit/network/http_spec.rb +0 -31
- data/spec/unit/util/config_timeout_spec.rb +0 -57
- data/tasks/rake/apple.rake +0 -176
- data/tasks/rake/changelog.rake +0 -15
- data/tasks/rake/ci.rake +0 -22
- data/tasks/rake/dailybuild.rake +0 -9
- data/tasks/rake/gem.rake +0 -63
- data/tasks/rake/git_workflow.rake +0 -134
- data/tasks/rake/metrics.rake +0 -14
- data/tasks/rake/sign.rake +0 -14
- data/tasks/rake/testbranch.rake +0 -16
- data/tasks/rake/yard.rake +0 -11
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'erb'
|
3
|
+
|
4
|
+
begin
|
5
|
+
@project_specs ||= YAML.load_file('ext/project_data.yaml')
|
6
|
+
@name = @project_specs['project']
|
7
|
+
@author = @project_specs['author']
|
8
|
+
@email = @project_specs['email']
|
9
|
+
@homepage = @project_specs['homepage']
|
10
|
+
@summary = @project_specs['summary']
|
11
|
+
@description = @project_specs['description']
|
12
|
+
@files = @project_specs['files']
|
13
|
+
@version_file = @project_specs['version_file']
|
14
|
+
@gem_files = @project_specs['gem_files']
|
15
|
+
@gem_require_path = @project_specs['gem_require_path']
|
16
|
+
@gem_test_files = @project_specs['gem_test_files']
|
17
|
+
@gem_executables = @project_specs['gem_executables']
|
18
|
+
@gem_runtime_dependencies = @project_specs['gem_runtime_dependencies']
|
19
|
+
@gem_devel_dependencies = @project_specs['gem_devel_dependencies']
|
20
|
+
@gem_rdoc_options = @project_specs['gem_rdoc_options']
|
21
|
+
@gem_forge_project = @project_specs['gem_forge_project']
|
22
|
+
rescue
|
23
|
+
STDERR.puts "There was an error loading the project specifications from the 'ext/project_data.yaml' file."
|
24
|
+
exit 1
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
@pkg_defaults ||= YAML.load_file('ext/build_defaults.yaml')
|
29
|
+
@default_cow = ENV['COW'] || @pkg_defaults['default_cow']
|
30
|
+
@cows = ENV['COW'] || @pkg_defaults['cows']
|
31
|
+
@pbuild_conf = ENV['PBUILDCONF'] || @pkg_defaults['pbuild_conf']
|
32
|
+
@packager = ENV['PACKAGER'] || @pkg_defaults['packager']
|
33
|
+
@sign_tar = ENV['SIGN_TAR'] || @pkg_defaults['sign_tar']
|
34
|
+
@final_mocks = ENV['MOCK'] || @pkg_defaults['final_mocks']
|
35
|
+
@rc_mocks = ENV['MOCK'] || @pkg_defaults['rc_mocks']
|
36
|
+
@gpg_name = ENV['GPG_NAME'] || @pkg_defaults['gpg_name']
|
37
|
+
@gpg_key = ENV['GPG_KEY'] || @pkg_defaults['gpg_key']
|
38
|
+
@certificate_pem= ENV['CERT_PEM'] || @pkg_defaults['certificate_pem']
|
39
|
+
@privatekey_pem = ENV['PRIVATE_PEM'] || @pkg_defaults['privatekey_pem']
|
40
|
+
@build_gem = ENV['GEM'] || @pkg_defaults['build_gem']
|
41
|
+
@build_dmg = ENV['DMG'] || @pkg_defaults['build_dmg']
|
42
|
+
@yum_host = @pkg_defaults['yum_host']
|
43
|
+
@yum_repo_path = @pkg_defaults['yum_repo_path']
|
44
|
+
@apt_host = @pkg_defaults['apt_host']
|
45
|
+
@apt_repo_url = @pkg_defaults['apt_repo_url']
|
46
|
+
@apt_repo_path = @pkg_defaults['apt_repo_path']
|
47
|
+
@ips_repo = @pkg_defaults['ips_repo']
|
48
|
+
@ips_store = @pkg_defaults['ips_store']
|
49
|
+
@ips_host = @pkg_defaults['ips_host']
|
50
|
+
rescue
|
51
|
+
STDERR.puts "There was an error loading the packaging defaults from the 'ext/build_defaults.yaml' file."
|
52
|
+
exit 1
|
53
|
+
end
|
54
|
+
|
55
|
+
@build_root ||= Dir.pwd
|
56
|
+
@version ||= get_dash_version
|
57
|
+
@gemversion ||= get_dot_version
|
58
|
+
@ipsversion ||= get_ips_version
|
59
|
+
@debversion ||= get_debversion
|
60
|
+
@origversion ||= get_origversion
|
61
|
+
@rpmversion ||= get_rpmversion
|
62
|
+
@rpmrelease ||= get_rpmrelease
|
@@ -0,0 +1,201 @@
|
|
1
|
+
# Title: Rake task to build Apple packages for #{@name}.
|
2
|
+
# Author: Gary Larizza
|
3
|
+
# Date: 05/18/2012
|
4
|
+
# Description: This task will create a DMG-encapsulated package that will
|
5
|
+
# install a package on OS X systems. This happens by building
|
6
|
+
# a directory tree of files that will then be fed to the
|
7
|
+
# packagemaker binary (can be installed by installing the
|
8
|
+
# XCode Tools) which will create the .pkg file.
|
9
|
+
#
|
10
|
+
|
11
|
+
# Path to Binaries (Constants)
|
12
|
+
TAR = '/usr/bin/tar'
|
13
|
+
CP = '/bin/cp'
|
14
|
+
INSTALL = '/usr/bin/install'
|
15
|
+
DITTO = '/usr/bin/ditto'
|
16
|
+
PACKAGEMAKER = '/Developer/usr/bin/packagemaker'
|
17
|
+
SED = '/usr/bin/sed'
|
18
|
+
|
19
|
+
# Setup task to populate all the variables
|
20
|
+
task :setup do
|
21
|
+
# Read the Apple file-mappings
|
22
|
+
begin
|
23
|
+
@source_files = YAML.load_file('ext/osx/file_mapping.yaml')
|
24
|
+
rescue
|
25
|
+
STDERR.puts "Could not load Apple file mappings from 'ext/osx/file_mapping.yaml'"
|
26
|
+
exit 1
|
27
|
+
end
|
28
|
+
@package_name = @name
|
29
|
+
@title = "#{@name}-#{@version}"
|
30
|
+
@reverse_domain = "com.#{@packager}.#{@package_name}"
|
31
|
+
@package_major_version = @version.split('.')[0]
|
32
|
+
@package_minor_version = @version.split('.')[1] +
|
33
|
+
@version.split('.')[2].split('-')[0].split('rc')[0]
|
34
|
+
@pm_restart = 'None'
|
35
|
+
@build_date = Time.new.strftime("%Y-%m-%dT%H:%M:%SZ")
|
36
|
+
@apple_bindir = '/usr/bin'
|
37
|
+
@apple_sbindir = '/usr/sbin'
|
38
|
+
@apple_libdir = '/usr/lib/ruby/site_ruby/1.8'
|
39
|
+
@apple_docdir = '/usr/share/doc'
|
40
|
+
end
|
41
|
+
|
42
|
+
# method: make_directory_tree
|
43
|
+
# description: This method sets up the directory structure that packagemaker
|
44
|
+
# needs to build a package. A prototype.plist file (holding
|
45
|
+
# package-specific options) is built from an ERB template located
|
46
|
+
# in the ext/osx directory.
|
47
|
+
def make_directory_tree
|
48
|
+
project_tmp = "#{get_temp}/#{@package_name}"
|
49
|
+
@scratch = "#{project_tmp}/#{@title}"
|
50
|
+
@working_tree = {
|
51
|
+
'scripts' => "#{@scratch}/scripts",
|
52
|
+
'resources' => "#{@scratch}/resources",
|
53
|
+
'working' => "#{@scratch}/root",
|
54
|
+
'payload' => "#{@scratch}/payload",
|
55
|
+
}
|
56
|
+
puts "Cleaning Tree: #{project_tmp}"
|
57
|
+
rm_rf(project_tmp)
|
58
|
+
@working_tree.each do |key,val|
|
59
|
+
mkdir_p(val)
|
60
|
+
end
|
61
|
+
|
62
|
+
erb 'ext/osx/preflight.erb', "#{@working_tree["scripts"]}/preflight"
|
63
|
+
erb 'ext/osx/prototype.plist.erb', "#{@scratch}/prototype.plist"
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
# method: build_dmg
|
68
|
+
# description: This method builds a package from the directory structure in
|
69
|
+
# /tmp/#{@name} and puts it in the
|
70
|
+
# /tmp/#{@name}/#{@name}-#{version}/payload directory. A DMG is
|
71
|
+
# created, using hdiutil, based on the contents of the
|
72
|
+
# /tmp/#{@name}/#{@name}-#{version}/payload directory. The resultant
|
73
|
+
# DMG is placed in the pkg/apple directory.
|
74
|
+
#
|
75
|
+
def build_dmg
|
76
|
+
# Local Variables
|
77
|
+
dmg_format_code = 'UDZO'
|
78
|
+
zlib_level = '9'
|
79
|
+
dmg_format_option = "-imagekey zlib-level=#{zlib_level}"
|
80
|
+
dmg_format = "#{dmg_format_code} #{dmg_format_option}"
|
81
|
+
dmg_file = "#{@title}.dmg"
|
82
|
+
package_file = "#{@title}.pkg"
|
83
|
+
pm_extra_args = '--verbose --no-recommend --no-relocate'
|
84
|
+
package_target_os = '10.4'
|
85
|
+
|
86
|
+
# Build .pkg file
|
87
|
+
system("sudo #{PACKAGEMAKER} --root #{@working_tree['working']} \
|
88
|
+
--id #{@reverse_domain} \
|
89
|
+
--filter DS_Store \
|
90
|
+
--target #{package_target_os} \
|
91
|
+
--title #{@title} \
|
92
|
+
--info #{@scratch}/prototype.plist \
|
93
|
+
--scripts #{@working_tree['scripts']} \
|
94
|
+
--resources #{@working_tree['resources']} \
|
95
|
+
--version #{@version} \
|
96
|
+
#{pm_extra_args} --out #{@working_tree['payload']}/#{package_file}")
|
97
|
+
|
98
|
+
# Build .dmg file
|
99
|
+
system("sudo hdiutil create -volname #{@title} \
|
100
|
+
-srcfolder #{@working_tree['payload']} \
|
101
|
+
-uid 99 \
|
102
|
+
-gid 99 \
|
103
|
+
-ov \
|
104
|
+
-format #{dmg_format} \
|
105
|
+
#{dmg_file}")
|
106
|
+
|
107
|
+
if File.directory?("#{pwd}/pkg/apple")
|
108
|
+
mv("#{pwd}/#{dmg_file}", "#{pwd}/pkg/apple/#{dmg_file}")
|
109
|
+
puts "moved: #{dmg_file} has been moved to #{pwd}/pkg/apple/#{dmg_file}"
|
110
|
+
else
|
111
|
+
mkdir_p("#{pwd}/pkg/apple")
|
112
|
+
mv(dmg_file, "#{pwd}/pkg/apple/#{dmg_file}")
|
113
|
+
puts "moved: #{dmg_file} has been moved to #{pwd}/pkg/apple/#{dmg_file}"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# method: pack_source
|
118
|
+
# description: This method copies the #{@name} source into a directory
|
119
|
+
# structure in /tmp/#{@name}/#{@name}-#{version}/root mirroring the
|
120
|
+
# structure on the target system for which the package will be
|
121
|
+
# installed. Anything installed into /tmp/#{@name}/root will be
|
122
|
+
# installed as the package's payload.
|
123
|
+
#
|
124
|
+
def pack_source
|
125
|
+
work = "#{@working_tree['working']}"
|
126
|
+
source = pwd
|
127
|
+
|
128
|
+
# Make all necessary directories
|
129
|
+
@source_files.each_value do |files|
|
130
|
+
files.each_value do |params|
|
131
|
+
mkdir_p "#{work}/#{params['path']}"
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# Install directory contents into place
|
136
|
+
unless @source_files['directories'].nil?
|
137
|
+
@source_files['directories'].each do |dir, params|
|
138
|
+
unless FileList["#{source}/#{dir}/*"].empty?
|
139
|
+
cmd = "#{DITTO} #{source}/#{dir}/ #{work}/#{params['path']}"
|
140
|
+
puts cmd
|
141
|
+
system(cmd)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# Setup a preflight script and replace variables in the files with
|
147
|
+
# the correct paths.
|
148
|
+
chown('root', 'wheel', "#{@working_tree['scripts']}/preflight")
|
149
|
+
chmod(0644, "#{@working_tree['scripts']}/preflight")
|
150
|
+
|
151
|
+
# Do a run through first setting the specified permissions then
|
152
|
+
# making sure 755 is set for all directories
|
153
|
+
unless @source_files['directories'].nil?
|
154
|
+
@source_files['directories'].each do |dir, params|
|
155
|
+
owner = params['owner']
|
156
|
+
group = params['group']
|
157
|
+
perms = params['perms']
|
158
|
+
path = params['path']
|
159
|
+
chmod_R(Integer(perms), "#{work}/#{path}")
|
160
|
+
chown_R(owner, group, "#{work}/#{path}")
|
161
|
+
chmod(0755, "#{work}/#{path}")
|
162
|
+
Dir["#{work}/#{path}/**/*"].each do |file|
|
163
|
+
chmod(0755, file) if File.directory?(file)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
# Install any files
|
169
|
+
unless @source_files['files'].nil?
|
170
|
+
@source_files['files'].each do |file, params|
|
171
|
+
owner = params['owner']
|
172
|
+
group = params['group']
|
173
|
+
perms = params['perms']
|
174
|
+
dest = params['path']
|
175
|
+
# Allow for regexs like [A-Z]*
|
176
|
+
FileList[file].each do |file|
|
177
|
+
cmd = "#{INSTALL} -o #{owner} -g #{group} -m #{perms} #{source}/#{file} #{work}/#{dest}"
|
178
|
+
puts cmd
|
179
|
+
system(cmd)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
if @build_dmg or @build_dmg == 'TRUE' or @build_dmg == 'true'
|
186
|
+
namespace :package do
|
187
|
+
desc "Task for building an Apple Package"
|
188
|
+
task :apple => [:setup] do
|
189
|
+
# Test for Root and Packagemaker binary
|
190
|
+
raise "Please run rake as root to build Apple Packages" unless Process.uid == 0
|
191
|
+
raise "Packagemaker must be installed. Please install XCode Tools" unless \
|
192
|
+
File.exists?('/Developer/usr/bin/packagemaker')
|
193
|
+
|
194
|
+
make_directory_tree
|
195
|
+
pack_source
|
196
|
+
build_dmg
|
197
|
+
chmod_R(0775, "#{pwd}/pkg")
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
@@ -0,0 +1,105 @@
|
|
1
|
+
def pdebuild args
|
2
|
+
results_dir = args[:work_dir]
|
3
|
+
cow = args[:cow]
|
4
|
+
devel_repo = args[:devel]
|
5
|
+
set_cow_envs(cow)
|
6
|
+
begin
|
7
|
+
sh "pdebuild --configfile #{@pbuild_conf} --buildresult #{results_dir} --pbuilder cowbuilder -- --override-config --othermirror=\"deb #{@apt_repo_url} #{ENV['DIST']} main dependencies #{devel_repo}\" --basepath /var/cache/pbuilder/#{cow}/"
|
8
|
+
rescue
|
9
|
+
STDERR.puts "Something went wrong. Hopefully the backscroll or #{results_dir}/#{@name}_#{@debversion}.build file has a clue."
|
10
|
+
exit 1
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def update_cow(cow, is_rc = nil)
|
15
|
+
ENV['FOSS_DEVEL'] = is_rc
|
16
|
+
set_cow_envs(cow)
|
17
|
+
begin
|
18
|
+
sh "sudo cowbuilder --update --override-config --configfile #{@pbuild_conf} --basepath /var/cache/pbuilder/#{cow} --distribution #{ENV['DIST']} --architecture #{ENV['ARCH']}"
|
19
|
+
rescue
|
20
|
+
STDERR.puts "Couldn't update the cow #{cow}. Perhaps you don't have sudo?"
|
21
|
+
exit 1
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def debuild args
|
26
|
+
results_dir = args[:work_dir]
|
27
|
+
begin
|
28
|
+
sh "debuild --no-lintian -uc -us"
|
29
|
+
rescue
|
30
|
+
STDERR.puts "Something went wrong. Hopefully the backscroll or #{results_dir}/#{@name}_#{@debversion}.build file has a clue."
|
31
|
+
exit 1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
task :prep_deb_tars, :work_dir do |t,args|
|
36
|
+
work_dir = args.work_dir
|
37
|
+
cp_p "pkg/#{@name}-#{@version}.tar.gz", work_dir
|
38
|
+
cd work_dir do
|
39
|
+
sh "tar zxf #{@name}-#{@version}.tar.gz"
|
40
|
+
mv "#{@name}-#{@version}", "#{@name}-#{@debversion}"
|
41
|
+
mv "#{@name}-#{@version}.tar.gz", "#{@name}_#{@origversion}.orig.tar.gz"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
task :build_deb, :deb_command, :cow, :devel do |t,args|
|
46
|
+
deb_build = args.deb_command
|
47
|
+
cow = args.cow
|
48
|
+
devel = args.devel
|
49
|
+
work_dir = get_temp
|
50
|
+
dest_dir = "#{@build_root}/pkg/deb/#{cow.split('-')[1] unless cow.nil?}"
|
51
|
+
check_tool(deb_build)
|
52
|
+
mkdir_p dest_dir
|
53
|
+
deb_args = { :work_dir => work_dir, :cow => cow, :devel => devel}
|
54
|
+
Rake::Task[:prep_deb_tars].reenable
|
55
|
+
Rake::Task[:prep_deb_tars].invoke(work_dir)
|
56
|
+
cd "#{work_dir}/#{@name}-#{@debversion}" do
|
57
|
+
mv 'ext/debian', '.'
|
58
|
+
begin
|
59
|
+
send(deb_build, deb_args)
|
60
|
+
cp FileList["#{work_dir}/*.deb", "#{work_dir}/*.dsc", "#{work_dir}/*.changes", "#{work_dir}/*.debian.tar.gz", "#{work_dir}/*.orig.tar.gz"], dest_dir
|
61
|
+
rm_rf "#{work_dir}/#{@name}-#{@debversion}"
|
62
|
+
rescue
|
63
|
+
STDERR.puts "Something went wrong. Hopefully the backscroll or #{work_dir}/#{@name}_#{@debversion}.build file has a clue."
|
64
|
+
end
|
65
|
+
rm_rf work_dir
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
namespace :package do
|
70
|
+
desc "Create a deb from this repo, using debuild (all builddeps must be installed)"
|
71
|
+
task :deb => :tar do
|
72
|
+
Rake::Task[:build_deb].invoke('debuild')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
namespace :pl do
|
77
|
+
desc "Create a deb from this repo using the default cow #{@default_cow}."
|
78
|
+
task :deb => "package:tar" do
|
79
|
+
Rake::Task[:build_deb].invoke('pdebuild', @default_cow)
|
80
|
+
end
|
81
|
+
|
82
|
+
desc "Create an RC deb from this repo using the default cow #{@default_cow}."
|
83
|
+
task :deb_rc => "package:tar" do
|
84
|
+
Rake::Task[:build_deb].invoke('pdebuild', @default_cow, 'devel')
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Create debs from this git repository using all cows specified in build_defaults yaml"
|
88
|
+
task :deb_all do
|
89
|
+
@cows.split(' ').each do |cow|
|
90
|
+
Rake::Task["package:tar"].invoke
|
91
|
+
Rake::Task[:build_deb].reenable
|
92
|
+
Rake::Task[:build_deb].invoke('pdebuild', cow)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
desc "Create RC debs from this git repository using all cows specified in build_defaults yaml"
|
97
|
+
task :deb_all_rc do
|
98
|
+
@cows.split(' ').each do |cow|
|
99
|
+
Rake::Task["package:tar"].invoke
|
100
|
+
Rake::Task[:build_deb].reenable
|
101
|
+
Rake::Task[:build_deb].invoke('pdebuild', cow, 'devel')
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
if @build_gem == TRUE or @build_gem == 'true' or @build_gem == 'TRUE'
|
2
|
+
require 'rubygems/package_task'
|
3
|
+
|
4
|
+
def glob_gem_files
|
5
|
+
gem_files = []
|
6
|
+
files = FileList[@gem_files.split(' ')]
|
7
|
+
files.each do |file|
|
8
|
+
if File.directory?(file)
|
9
|
+
gem_files << FileList["#{file}/**/*"].exclude("ext/packaging/")
|
10
|
+
else
|
11
|
+
gem_files << file
|
12
|
+
end
|
13
|
+
end
|
14
|
+
gem_files
|
15
|
+
end
|
16
|
+
|
17
|
+
spec = Gem::Specification.new do |s|
|
18
|
+
s.name = @name unless @name.nil?
|
19
|
+
s.version = @gemversion unless @gemversion.nil?
|
20
|
+
s.author = @author unless @author.nil?
|
21
|
+
s.email = @email unless @email.nil?
|
22
|
+
s.homepage = @homepage unless @homepage.nil?
|
23
|
+
s.summary = @summary unless @summary.nil?
|
24
|
+
s.description = @description unless @description.nil?
|
25
|
+
s.files = glob_gem_files unless glob_gem_files.nil?
|
26
|
+
s.executables = @gem_executables unless @gem_executables.nil?
|
27
|
+
s.require_path = @gem_require_path unless @gem_require_path.nil?
|
28
|
+
s.test_files = FileList[@gem_test_files.split(' ')] unless @gem_test_files.nil?
|
29
|
+
s.rubyforge_project = @gem_forge_project unless @gem_forge_project.nil?
|
30
|
+
|
31
|
+
@gem_runtime_dependencies.each do |gem, version|
|
32
|
+
s.add_runtime_dependency("#{gem}", "#{version}") unless (version.nil? or version.empty?)
|
33
|
+
s.add_runtime_dependency("#{gem}") if (version.nil? or version.empty?)
|
34
|
+
end unless @gem_runtime_dependencies.nil?
|
35
|
+
|
36
|
+
@gem_devel_dependencies.each do |gem, version|
|
37
|
+
s.add_devel_dependency("#{gem}", "#{version}") unless (version.nil? or version.empty?)
|
38
|
+
s.add_devel_dependency("#{gem}") if (version.nil? or version.empty?)
|
39
|
+
end unless @gem_devel_dependencies.nil?
|
40
|
+
|
41
|
+
@gem_rdoc_options.each do |option|
|
42
|
+
s.rdoc_options << option
|
43
|
+
end unless @gem_rdoc_options.nil?
|
44
|
+
end
|
45
|
+
|
46
|
+
namespace :package do
|
47
|
+
Gem::PackageTask.new(spec) do |pkg|
|
48
|
+
pkg.need_tar_gz = true
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'erb'
|
2
|
+
namespace :package do
|
3
|
+
namespace :ips do
|
4
|
+
workdir = "pkg/ips"
|
5
|
+
proto = workdir + '/proto'
|
6
|
+
repo = workdir + '/repo'
|
7
|
+
pkgs = workdir + '/pkgs'
|
8
|
+
repouri = "file://#{`pwd`.strip + '/' + repo}"
|
9
|
+
artifact = "#{pkgs}/#{@name}@#{@ipsversion}.p5p"
|
10
|
+
|
11
|
+
# Create a source repo
|
12
|
+
# We dont clean the base pkg directory only ips work dir.
|
13
|
+
task :clean do
|
14
|
+
%x[rm -rf #{workdir}]
|
15
|
+
end
|
16
|
+
|
17
|
+
# Create an installation image at ips/proto
|
18
|
+
task :prepare => :clean do
|
19
|
+
check_tool('pkgsend')
|
20
|
+
x %[mkdir -p #{workdir}]
|
21
|
+
x %[gmake -f ext/ips/rules DESTDIR=#{proto} 2>#{workdir}/build.out ]
|
22
|
+
end
|
23
|
+
|
24
|
+
# Process templates and write the initial manifest
|
25
|
+
task :prototmpl do
|
26
|
+
erb("ext/ips/#{@name}.p5m.erb", workdir + '/' + @name + '.p5m.x')
|
27
|
+
end
|
28
|
+
|
29
|
+
# Update manifest to include the installation image information.
|
30
|
+
task :protogen => :prototmpl do
|
31
|
+
x %[pkgsend generate #{proto} >> #{workdir}/#{@name}.p5m.x ]
|
32
|
+
os=%x[uname -p].chomp
|
33
|
+
end
|
34
|
+
|
35
|
+
# Generate and resolve dependency list
|
36
|
+
task :protodeps => :protogen do
|
37
|
+
x %[pkgdepend generate -d #{proto} #{workdir}/#{@name}.p5m.x > #{workdir}/#{@name}.depends ]
|
38
|
+
x %[pkgdepend resolve -m #{workdir}/#{@name}.depends ]
|
39
|
+
x %[cat #{workdir}/#{@name}.depends.res >> #{workdir}/#{@name}.p5m.x]
|
40
|
+
end
|
41
|
+
|
42
|
+
# Mogrify manifest to remove unncecessary info, and other kinds of transforms.
|
43
|
+
task :protomogrify => :protodeps do
|
44
|
+
x %[pkgmogrify ./ext/ips/transforms ./#{workdir}/#{@name}.p5m.x| pkgfmt >> #{workdir}/#{@name}.p5m ]
|
45
|
+
end
|
46
|
+
|
47
|
+
# Generate and resolve dependency list
|
48
|
+
task :license => :protomogrify do
|
49
|
+
x %[cp LICENSE #{proto}/#{@name}.license]
|
50
|
+
end
|
51
|
+
|
52
|
+
# Ensure that our manifest is sane.
|
53
|
+
task :lint => :license do
|
54
|
+
x %[pkglint #{workdir}/#{@name}.p5m]
|
55
|
+
end
|
56
|
+
|
57
|
+
task :package => :lint do
|
58
|
+
x %[rm -rf #{pkgs}]
|
59
|
+
x %[mkdir -p #{pkgs}]
|
60
|
+
x %[pkgrepo create #{repo}]
|
61
|
+
x %[pkgrepo set -s #{repo} publisher/prefix=puppetlabs.com]
|
62
|
+
x %[pkgsend -s #{repouri} publish -d #{proto} --fmri-in-manifest #{workdir}/#{@name}.p5m]
|
63
|
+
x %[rm -f #{artifact}]
|
64
|
+
x %[pkgrecv -s #{repouri} -a -d #{artifact} #{@name}@#{@ipsversion}]
|
65
|
+
end
|
66
|
+
|
67
|
+
task :dry_install do
|
68
|
+
x %[pkg install -nv -g #{artifact} #{@name}@#{@ipsversion}]
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
desc "Creates an ips version"
|
73
|
+
task :ips do
|
74
|
+
Rake::Task['package:ips:prepare'].invoke
|
75
|
+
Rake::Task['package:ips:package'].invoke
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|