2006-01-28 19:03:53 +00:00
|
|
|
require 'rake'
|
|
|
|
require 'rake/testtask'
|
|
|
|
require 'rake/clean'
|
|
|
|
require 'rake/gempackagetask'
|
|
|
|
require 'rake/rdoctask'
|
|
|
|
require 'tools/rakehelp'
|
|
|
|
require 'fileutils'
|
|
|
|
include FileUtils
|
|
|
|
|
|
|
|
setup_tests
|
2006-02-15 23:17:23 +00:00
|
|
|
setup_clean ["ext/http11/*.{bundle,so,obj,pdb,lib,def,exp}", "ext/http11/Makefile", "pkg", "lib/*.bundle", "*.gem", "doc/site/output", ".config"]
|
|
|
|
|
2006-03-04 19:10:26 +00:00
|
|
|
setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc', 'ext/http11/http11.c']
|
2006-01-28 19:03:53 +00:00
|
|
|
|
|
|
|
desc "Does a full compile, test run"
|
|
|
|
task :default => [:compile, :test]
|
|
|
|
|
|
|
|
desc "Compiles all extensions"
|
2006-05-11 19:10:34 +00:00
|
|
|
task :compile => [:http11] do
|
|
|
|
if Dir.glob(File.join("lib","http11.*")).length == 0
|
|
|
|
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
|
|
STDERR.puts "Gem actually failed to build. Your system is"
|
2006-05-20 20:12:52 +00:00
|
|
|
STDERR.puts "NOT configured properly to build Mongrel."
|
2006-05-11 19:10:34 +00:00
|
|
|
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
|
|
exit(1)
|
|
|
|
end
|
|
|
|
end
|
2006-05-21 14:46:42 +00:00
|
|
|
|
2006-06-02 03:02:06 +00:00
|
|
|
task :package => [:clean,:compile,:test,:rerdoc]
|
2006-01-28 19:03:53 +00:00
|
|
|
|
|
|
|
task :ragel do
|
2006-02-12 20:02:56 +00:00
|
|
|
sh %{/usr/local/bin/ragel ext/http11/http11_parser.rl | /usr/local/bin/rlcodegen -G2 -o ext/http11/http11_parser.c}
|
|
|
|
end
|
|
|
|
|
2006-05-20 20:08:50 +00:00
|
|
|
task :site_webgen do
|
2006-06-15 18:14:07 +00:00
|
|
|
sh %{pushd doc/site; webgen; scp -r output/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
|
2006-05-20 20:08:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
task :site_rdoc do
|
2006-02-12 20:02:56 +00:00
|
|
|
sh %{ scp -r doc/rdoc/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/ }
|
2006-05-20 20:08:50 +00:00
|
|
|
end
|
|
|
|
|
2006-05-23 06:40:24 +00:00
|
|
|
task :site_coverage => [:rcov] do
|
|
|
|
sh %{ scp -r test/coverage/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/coverage/ }
|
2006-05-20 20:08:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
task :site_projects_rdoc do
|
2006-03-06 05:31:39 +00:00
|
|
|
sh %{ cd projects/gem_plugin; rake site }
|
2006-01-28 19:03:53 +00:00
|
|
|
end
|
|
|
|
|
2006-05-20 20:08:50 +00:00
|
|
|
task :site => [:site_webgen, :site_rdoc, :site_coverage, :site_projects_rdoc]
|
|
|
|
|
2006-01-28 19:03:53 +00:00
|
|
|
setup_extension("http11", "http11")
|
|
|
|
|
2006-02-16 07:04:18 +00:00
|
|
|
name="mongrel"
|
2006-10-24 23:00:29 +00:00
|
|
|
version="0.3.14"
|
2006-03-10 06:46:45 +00:00
|
|
|
|
|
|
|
setup_gem(name, version) do |spec|
|
2006-09-26 21:25:44 +00:00
|
|
|
spec.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps."
|
2006-03-10 06:46:45 +00:00
|
|
|
spec.description = spec.summary
|
2006-06-02 03:02:06 +00:00
|
|
|
spec.test_files = Dir.glob('test/test_*.rb')
|
2006-03-10 06:46:45 +00:00
|
|
|
spec.author="Zed A. Shaw"
|
|
|
|
spec.executables=['mongrel_rails']
|
|
|
|
spec.files += %w(ext/http11/MANIFEST README Rakefile setup.rb)
|
2006-02-16 07:04:18 +00:00
|
|
|
|
2006-03-10 06:46:45 +00:00
|
|
|
spec.required_ruby_version = '>= 1.8.4'
|
2006-02-15 23:17:23 +00:00
|
|
|
|
2006-06-02 03:02:06 +00:00
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
2006-06-16 21:01:12 +00:00
|
|
|
Dir.chdir "projects/mongrel_service" do
|
2006-08-31 00:26:39 +00:00
|
|
|
`rake.cmd install`
|
2006-06-16 21:01:12 +00:00
|
|
|
end
|
2006-08-14 20:37:07 +00:00
|
|
|
spec.files += ['ext/http11/http11.so']
|
|
|
|
spec.files += ['lib/http11.so']
|
2006-06-02 03:23:41 +00:00
|
|
|
spec.extensions.clear
|
2006-02-15 23:17:23 +00:00
|
|
|
spec.platform = Gem::Platform::WIN32
|
2006-06-02 03:02:06 +00:00
|
|
|
else
|
|
|
|
spec.add_dependency('daemons', '>= 0.4.2')
|
2006-02-15 23:17:23 +00:00
|
|
|
end
|
2006-06-02 03:02:06 +00:00
|
|
|
|
|
|
|
spec.add_dependency('gem_plugin', '>= 0.2.1')
|
2006-10-24 22:52:21 +00:00
|
|
|
spec.add_dependency('cgi_multipart_eof_fix', '>= 0.2.1')
|
2006-02-15 23:17:23 +00:00
|
|
|
end
|
|
|
|
|
2006-03-11 16:35:53 +00:00
|
|
|
task :install do
|
|
|
|
sub_project("gem_plugin", :install)
|
|
|
|
sh %{rake package}
|
2006-06-10 07:02:19 +00:00
|
|
|
sh %{gem install pkg/mongrel-#{version}}
|
2006-03-11 16:35:53 +00:00
|
|
|
sub_project("mongrel_status", :install)
|
2006-06-25 14:49:46 +00:00
|
|
|
sub_project("mongrel_upload_progress", :install)
|
2006-03-19 05:18:11 +00:00
|
|
|
sub_project("mongrel_console", :install)
|
2006-08-16 21:51:38 +00:00
|
|
|
sub_project("mongrel_cluster", :install)
|
2006-06-16 21:01:12 +00:00
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
|
|
sub_project("mongrel_service", :install)
|
|
|
|
end
|
2006-03-11 16:35:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
task :uninstall => [:clean] do
|
|
|
|
sub_project("mongrel_status", :uninstall)
|
2006-06-25 14:49:46 +00:00
|
|
|
sub_project("mongrel_upload_progress", :uninstall)
|
2006-03-19 05:18:11 +00:00
|
|
|
sub_project("mongrel_console", :uninstall)
|
2006-06-10 07:02:19 +00:00
|
|
|
sh %{gem uninstall mongrel}
|
2006-03-11 16:35:53 +00:00
|
|
|
sub_project("gem_plugin", :uninstall)
|
2006-06-16 21:01:12 +00:00
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
|
|
sub_project("mongrel_service", :install)
|
|
|
|
end
|
2006-03-11 16:35:53 +00:00
|
|
|
end
|
2006-03-12 19:40:35 +00:00
|
|
|
|
|
|
|
|
2006-03-15 06:41:28 +00:00
|
|
|
task :gem_source do
|
2006-03-12 19:40:35 +00:00
|
|
|
mkdir_p "pkg/gems"
|
2006-06-10 07:02:19 +00:00
|
|
|
|
2006-03-12 19:40:35 +00:00
|
|
|
FileList["**/*.gem"].each { |gem| mv gem, "pkg/gems" }
|
|
|
|
FileList["pkg/*.tgz"].each {|tgz| rm tgz }
|
|
|
|
rm_rf "pkg/#{name}-#{version}"
|
|
|
|
|
|
|
|
sh %{ generate_yaml_index.rb -d pkg }
|
|
|
|
sh %{ scp -r pkg/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/releases/ }
|
|
|
|
end
|