2006-01-28 14:03:53 -05:00
|
|
|
|
2007-09-22 23:09:56 -04:00
|
|
|
require 'echoe'
|
|
|
|
|
|
|
|
Echoe.new("mongrel") do |p|
|
|
|
|
p.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps."
|
|
|
|
p.author ="Zed A. Shaw"
|
|
|
|
p.clean_pattern = ["ext/http11/*.{bundle,so,o,obj,pdb,lib,def,exp}", "ext/http11/Makefile", "pkg", "lib/*.bundle", "*.gem", "doc/site/output", ".config"]
|
|
|
|
p.rdoc_pattern = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc', 'ext/http11/http11.c']
|
2007-09-25 17:42:39 -04:00
|
|
|
p.ignore_pattern = /^(pkg|site|projects|doc|log)|CVS|\.log/
|
2007-09-22 23:09:56 -04:00
|
|
|
p.ruby_version = '>= 1.8.4'
|
2007-10-11 03:00:43 -04:00
|
|
|
p.dependencies = ['gem_plugin >=0.2.3', 'cgi_multipart_eof_fix >=2.4']
|
2007-09-22 23:09:56 -04:00
|
|
|
|
|
|
|
p.need_tar_gz = false
|
|
|
|
p.need_tgz = true
|
|
|
|
p.require_signed = true
|
|
|
|
|
2007-09-25 20:17:31 -04:00
|
|
|
unless RUBY_PLATFORM =~ /mswin/
|
2007-10-10 12:28:29 -04:00
|
|
|
p.certificate_chain = ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem',
|
2007-09-25 20:17:56 -04:00
|
|
|
'~/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem']
|
2007-09-25 20:17:31 -04:00
|
|
|
else
|
2007-10-10 12:28:29 -04:00
|
|
|
p.certificate_chain = ['~/gem_certificates/mongrel-public_cert.pem',
|
|
|
|
'~/gem_certificates/luislavena-mongrel-public_cert.pem']
|
2007-09-25 20:17:31 -04:00
|
|
|
end
|
|
|
|
|
2007-09-22 23:09:56 -04:00
|
|
|
p.eval = proc do
|
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
2007-09-24 01:45:18 -04:00
|
|
|
self.files += ['lib/http11.so']
|
2007-09-22 23:09:56 -04:00
|
|
|
extensions.clear
|
2007-09-25 19:22:24 -04:00
|
|
|
self.platform = Gem::Platform::WIN32
|
2007-09-22 23:09:56 -04:00
|
|
|
else
|
|
|
|
add_dependency('daemons', '>= 1.0.3')
|
2007-09-22 23:12:07 -04:00
|
|
|
add_dependency('fastthread', '>= 1.0.1')
|
2007-09-22 23:09:56 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2006-01-28 14:03:53 -05:00
|
|
|
|
2007-09-25 19:09:51 -04:00
|
|
|
# NOTE: a big HACK around RubyGems and Echoe for pre-compiled extensions.
|
|
|
|
# as usual, just for win32... to make it happy.
|
|
|
|
# starting to feel the pain...
|
|
|
|
file "lib/http11.so" do
|
|
|
|
extension = "ext/http11/extconf.rb"
|
|
|
|
directory = File.dirname(extension)
|
|
|
|
Dir.chdir(directory) do
|
|
|
|
ruby File.basename(extension)
|
|
|
|
system(PLATFORM =~ /win32/ ? 'nmake' : 'make')
|
2006-05-11 15:10:34 -04:00
|
|
|
end
|
2007-09-25 19:09:51 -04:00
|
|
|
Dir["#{directory}/*.#{Config::CONFIG['DLEXT']}"].each do |file|
|
|
|
|
cp file, "lib/"
|
|
|
|
end
|
|
|
|
end if RUBY_PLATFORM =~ /mswin/
|
|
|
|
|
|
|
|
task :compile => ["lib/http11.so"] if RUBY_PLATFORM =~ /mswin/
|
2006-05-21 10:46:42 -04:00
|
|
|
|
2007-09-22 23:09:56 -04:00
|
|
|
#### Project-wide install and uninstall tasks
|
2006-03-10 01:46:45 -05:00
|
|
|
|
2007-09-22 23:09:56 -04:00
|
|
|
def sub_project(project, *targets)
|
|
|
|
targets.each do |target|
|
|
|
|
Dir.chdir "projects/#{project}" do
|
|
|
|
sh %{rake --trace #{target.to_s} }
|
|
|
|
end
|
2006-02-15 18:17:23 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-09-22 23:09:56 -04:00
|
|
|
task :install_requirements do
|
|
|
|
# These run before Mongrel is installed
|
2006-03-11 11:35:53 -05:00
|
|
|
sub_project("gem_plugin", :install)
|
2007-09-22 23:09:56 -04:00
|
|
|
sub_project("cgi_multipart_eof_fix", :install)
|
2006-11-20 11:52:46 -05:00
|
|
|
sub_project("fastthread", :install)
|
2007-09-22 23:09:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
task :install => [:install_requirements] do
|
|
|
|
# These run after Mongrel is installed
|
2006-03-11 11:35:53 -05:00
|
|
|
sub_project("mongrel_status", :install)
|
2006-06-25 10:49:46 -04:00
|
|
|
sub_project("mongrel_upload_progress", :install)
|
2006-03-19 00:18:11 -05:00
|
|
|
sub_project("mongrel_console", :install)
|
2006-08-16 17:51:38 -04:00
|
|
|
sub_project("mongrel_cluster", :install)
|
2006-06-16 17:01:12 -04:00
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
|
|
sub_project("mongrel_service", :install)
|
|
|
|
end
|
2006-03-11 11:35:53 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
task :uninstall => [:clean] do
|
|
|
|
sub_project("mongrel_status", :uninstall)
|
2007-09-22 23:09:56 -04:00
|
|
|
sub_project("cgi_multipart_eof_fix", :uninstall)
|
2006-06-25 10:49:46 -04:00
|
|
|
sub_project("mongrel_upload_progress", :uninstall)
|
2006-03-19 00:18:11 -05:00
|
|
|
sub_project("mongrel_console", :uninstall)
|
2006-03-11 11:35:53 -05:00
|
|
|
sub_project("gem_plugin", :uninstall)
|
2006-11-20 11:52:46 -05:00
|
|
|
sub_project("fastthread", :uninstall)
|
2006-06-16 17:01:12 -04:00
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
|
|
sub_project("mongrel_service", :install)
|
|
|
|
end
|
2006-03-11 11:35:53 -05:00
|
|
|
end
|
2006-03-12 14:40:35 -05:00
|
|
|
|
2007-09-22 23:09:56 -04:00
|
|
|
#### Documentation upload tasks
|
2006-03-12 14:40:35 -05:00
|
|
|
|
2007-09-22 23:09:56 -04:00
|
|
|
# Is this still used?
|
2006-03-15 01:41:28 -05:00
|
|
|
task :gem_source do
|
2006-03-12 14:40:35 -05:00
|
|
|
mkdir_p "pkg/gems"
|
2007-08-10 23:44:05 -04:00
|
|
|
mkdir_p "pkg/tar"
|
2006-06-10 03:02:19 -04:00
|
|
|
|
2006-03-12 14:40:35 -05:00
|
|
|
FileList["**/*.gem"].each { |gem| mv gem, "pkg/gems" }
|
2007-08-10 23:44:05 -04:00
|
|
|
FileList["pkg/*.tgz"].each {|tgz| mv tgz, "pkg/tar" }
|
2006-03-12 14:40:35 -05:00
|
|
|
rm_rf "pkg/#{name}-#{version}"
|
|
|
|
|
2006-10-24 19:50:25 -04:00
|
|
|
sh %{ index_gem_repository.rb -d pkg }
|
2007-01-19 19:17:35 -05:00
|
|
|
sh %{ scp -r ChangeLog pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/ }
|
2006-03-12 14:40:35 -05:00
|
|
|
end
|
2007-09-22 23:09:56 -04:00
|
|
|
|
|
|
|
task :ragel do
|
|
|
|
sh %{ragel ext/http11/http11_parser.rl | rlgen-cd -G2 -o ext/http11/http11_parser.c}
|
|
|
|
end
|
|
|
|
|
|
|
|
task :site_webgen do
|
|
|
|
sh %{pushd site; webgen; ruby atom.rb > output/feed.atom; rsync -azv output/* rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
|
|
|
|
end
|
|
|
|
|
|
|
|
task :site_rdoc => [:redoc] do
|
|
|
|
sh %{ rsync -azv doc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/ }
|
|
|
|
end
|
|
|
|
|
|
|
|
task :site_coverage => [:rcov] do
|
|
|
|
sh %{ rsync -azv test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/ }
|
|
|
|
end
|
|
|
|
|
|
|
|
task :site_projects_rdoc do
|
|
|
|
sh %{ cd projects/gem_plugin; rake site }
|
|
|
|
end
|
|
|
|
|
|
|
|
task :site => [:site_webgen, :site_rdoc, :site_coverage, :site_projects_rdoc]
|