Man I love gems. +1
On Sep 18, 2009, at 7:21 PM, James Turnbull wrote: > > > Signed-off-by: James Turnbull <[email protected]> > --- > Rakefile | 31 ++++++------------------------- > tasks/rake/gem.rake | 45 ++++++++++++++++++++++++++++++++++++++++++ > +++ > 2 files changed, 51 insertions(+), 25 deletions(-) > create mode 100644 tasks/rake/gem.rake > > 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 = '[email protected]' > - 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 = '[email protected]' > + 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 > -- > 1.6.0.6 > > > > -- The remarkable thing about Shakespeare is that he really is very good, in spite of all the people who say he is very good. -- Robert Graves --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
