[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1456-g2f0b1e5

James Turnbull james at lovedthanlost.net
Tue Oct 27 17:05:36 UTC 2009


The following commit has been merged in the upstream branch:
commit 8987509aa171101fc64d5166851e866752f41d8c
Author: James Turnbull <james at lovedthanlost.net>
Date:   Sat Sep 19 12:20:16 2009 +1000

    Refactored Puppet packaging and gem creation

diff --git a/Rakefile b/Rakefile
index 31771a0..8760ee2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -3,13 +3,13 @@
 $: << File.expand_path('lib')
 $LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks')
 
-Dir['tasks/**/*.rake'].each { |t| load t }
-
 require './lib/puppet.rb'
 require 'rake'
 require 'rake/packagetask'
 require 'rake/gempackagetask'
 
+Dir['tasks/**/*.rake'].each { |t| load t }
+
 FILES = FileList[
     '[A-Z]*',
     'install.rb',
@@ -24,37 +24,18 @@ FILES = FileList[
     'spec/**/*'
 ]
 
-task :default do
-    sh %{rake -T}
-end
-
-spec = Gem::Specification.new do |spec|
-    spec.platform = Gem::Platform::RUBY
-    spec.name = 'puppet'
-    spec.files = FILES.to_a
-    spec.version = Puppet::PUPPETVERSION
-    spec.add_dependency('facter', '>= 1.5.1')
-    spec.summary = 'Puppet, an automated configuration management tool'
-    spec.author = 'Reductive Labs'
-    spec.email = 'puppet at reductivelabs.com'
-    spec.homepage = 'http://reductivelabs.com'
-    spec.rubyforge_project = 'puppet'
-    spec.has_rdoc = true
-    spec.rdoc_options <<
-        '--title' <<  'Puppet - Configuration Management' <<
-        '--main' << 'README' <<
-        '--line-numbers'
-end
-
 Rake::PackageTask.new("puppet", Puppet::PUPPETVERSION) do |pkg|
     pkg.package_dir = 'pkg'
     pkg.need_tar_gz = true
     pkg.package_files = FILES.to_a
 end
 
-Rake::GemPackageTask.new(spec) do |pkg|
+task :default do
+    sh %{rake -T}
 end
 
+task :puppetpackages => [:create_gem, :package]
+
 desc "Run the specs under spec/"
 task :spec do
     require 'spec'
diff --git a/tasks/rake/gem.rake b/tasks/rake/gem.rake
new file mode 100644
index 0000000..8da1962
--- /dev/null
+++ b/tasks/rake/gem.rake
@@ -0,0 +1,45 @@
+GEM_FILES = FileList[
+    '[A-Z]*',
+    'install.rb',
+    'bin/**/*',
+    'lib/**/*',
+    'conf/**/*',
+    'man/**/*',
+    'examples/**/*',
+    'ext/**/*',
+    'test/**/*',
+    'spec/**/*'
+]
+
+spec = Gem::Specification.new do |spec|
+    spec.platform = Gem::Platform::RUBY
+    spec.name = 'puppet'
+    spec.files = GEM_FILES.to_a
+    spec.executables = %w{puppetca puppetd puppetmasterd puppetqd puppetrun filebucket pi puppet puppetdoc ralsh} 
+    spec.version = Puppet::PUPPETVERSION
+    spec.add_dependency('facter', '>= 1.5.1')
+    spec.summary = 'Puppet, an automated configuration management tool'
+    spec.author = 'Reductive Labs'
+    spec.email = 'puppet at reductivelabs.com'
+    spec.homepage = 'http://reductivelabs.com'
+    spec.rubyforge_project = 'puppet'
+    spec.has_rdoc = true
+    spec.rdoc_options <<
+        '--title' <<  'Puppet - Configuration Management' <<
+        '--main' << 'README' <<
+        '--line-numbers'
+end
+
+desc "Prepare binaries for gem creation"
+task :prepare_gem do
+    sh "mv sbin/* bin"
+end
+
+desc "Create the gem"
+task :create_gem => :prepare_gem do
+    sh "mkdir -p pkg"
+    Gem::Builder.new(spec).build
+    sh "mv *.gem pkg"
+    sh "rm bin/*"
+    sh "git reset --hard"
+end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list