1 # Rakefile for Puppet -*- ruby -*-
3 $: << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
6 require 'rake/reductive'
8 $stderr.puts "You must have the Reductive build library in your RUBYLIB."
12 TESTHOSTS = %w{rh3a fedora1 centos1 freebsd1 culain}
14 project = Rake::RedLabProject.new("puppet") do |p|
15 p.summary = "System Automation and Configuration Management Software"
16 p.description = "Puppet is a declarative language for expressing system
17 configuration, a client and server for distributing it, and a library
18 for realizing the configuration."
31 p.filelist.exclude("bin/pi")
33 p.add_dependency('facter', '1.1.0')
35 #p.epmhosts = %w{culain}
36 #p.sunpkghost = "sol10b"
37 #p.rpmhost = "fedora1"
41 # Make our gem task. This actually just fills out the spec.
42 project.mkgemtask do |task|
44 task.require_path = 'lib' # Use these for libraries.
46 task.bindir = "bin" # Use these for applications.
47 task.executables = ["puppet", "puppetd", "puppetmasterd", "puppetdoc",
48 "puppetca", "puppetrun", "ralsh"]
49 task.default_executable = "puppet"
50 task.autorequire = 'puppet'
52 #### Documentation and testing.
55 #s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
57 '--title' << 'Puppet - Configuration Management' <<
58 '--main' << 'README' <<
60 task.test_file = "test/Rakefile"
65 project.mkepmtask do |task|
66 task.bins = FileList.new("bin/puppet", "bin/puppetca")
67 task.sbins = FileList.new("bin/puppetmasterd", "bin/puppetd")
68 task.rubylibs = FileList.new('lib/**/*')
72 rule(/_is_runnable$/) do |t|
74 executable = t.name.sub(/_is_runnable$/, '')
75 ENV['PATH'].split(':').each do |elem|
76 available = true if File.executable? File.join(elem, executable)
80 puts "You do not have #{executable} available in your path"
85 file "debian" => :bzr_is_runnable do
86 system("bzr get http://www.hezmatt.org/~mpalmer/bzr/puppet.debian.svn debian") || exit(1)
89 task :check_build_deps => 'dpkg-checkbuilddeps_is_runnable' do
90 system("dpkg-checkbuilddeps") || exit(1)
93 task :debian_packages => [ "debian", :check_build_deps, :fakeroot_is_runnable ] do
94 system("fakeroot debian/rules clean") || exit(1)
95 system("fakeroot debian/rules binary") || exit(1)
99 def dailyfile(package)
100 "#{downdir}/#{package}/#{package}-daily-#{stamp}.tgz"
104 edir = "/tmp/daily-export"
107 sh %{svn export http://reductivelabs.com/svn/#{package}/trunk #{package} >/dev/null}
108 sh %{tar cf - #{package} | gzip -c > #{dailyfile(package)}}
110 FileUtils.rm_rf(edir)
114 ENV['DOWNLOAD_DIR'] || "/opt/rl/docroots/reductivelabs.com/htdocs/downloads"
118 [Time.now.year, Time.now.month, Time.now.day].collect { |i| i.to_s}.join
121 pdaily = dailyfile("puppet")
122 fdaily = dailyfile("facter")
132 task :daily => [pdaily, fdaily]
135 Dir.glob("#{downdir}/*/*daily*.tgz").each do |file|
136 puts "Removing %s" % file