mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
c888a2fa04
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@541 19e92222-5c0b-0410-8929-a290d50e31e9
118 lines
3.5 KiB
Ruby
118 lines
3.5 KiB
Ruby
require 'rake'
|
|
require 'rake/testtask'
|
|
require 'rake/clean'
|
|
require 'rake/gempackagetask'
|
|
require 'rake/rdoctask'
|
|
require 'tools/rakehelp'
|
|
require 'fileutils'
|
|
include FileUtils
|
|
|
|
setup_tests
|
|
setup_clean ["ext/http11/*.{bundle,so,obj,pdb,lib,def,exp}", "ext/http11/Makefile", "pkg", "lib/*.bundle", "*.gem", "doc/site/output", ".config"]
|
|
|
|
setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc', 'ext/http11/http11.c']
|
|
|
|
desc "Does a full compile, test run"
|
|
task :default => [:compile, :test]
|
|
|
|
desc "Compiles all extensions"
|
|
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"
|
|
STDERR.puts "NOT configured properly to build Mongrel."
|
|
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
exit(1)
|
|
end
|
|
end
|
|
|
|
task :package => [:clean,:compile,:test,:rerdoc]
|
|
|
|
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 doc/site; webgen; ruby atom.rb > output/feed.atom; rsync -azv output/* rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
|
|
end
|
|
|
|
task :site_rdoc do
|
|
sh %{ rsync -azv doc/rdoc/* 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]
|
|
|
|
setup_extension("http11", "http11")
|
|
|
|
name="mongrel"
|
|
version="1.0.1"
|
|
|
|
setup_gem(name, version) do |spec|
|
|
spec.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps."
|
|
spec.description = spec.summary
|
|
spec.test_files = Dir.glob('test/test_*.rb')
|
|
spec.author="Zed A. Shaw"
|
|
spec.executables=['mongrel_rails']
|
|
spec.files += %w(ext/http11/MANIFEST README Rakefile setup.rb lib/mongrel/mime_types.yml)
|
|
|
|
spec.required_ruby_version = '>= 1.8.4'
|
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
spec.files += ['lib/http11.so']
|
|
spec.extensions.clear
|
|
spec.platform = Gem::Platform::WIN32
|
|
else
|
|
spec.add_dependency('daemons', '>= 1.0.3')
|
|
spec.add_dependency('fastthread', '>= 0.6.2')
|
|
end
|
|
|
|
spec.add_dependency('gem_plugin', '>= 0.2.2')
|
|
spec.add_dependency('cgi_multipart_eof_fix', '>= 1.0.0')
|
|
end
|
|
|
|
task :install do
|
|
sub_project("gem_plugin", :install)
|
|
sub_project("fastthread", :install)
|
|
sh %{rake package}
|
|
sh %{gem install pkg/mongrel-#{version}}
|
|
sub_project("mongrel_status", :install)
|
|
sub_project("mongrel_upload_progress", :install)
|
|
sub_project("mongrel_console", :install)
|
|
sub_project("mongrel_cluster", :install)
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
sub_project("mongrel_service", :install)
|
|
end
|
|
end
|
|
|
|
task :uninstall => [:clean] do
|
|
sub_project("mongrel_status", :uninstall)
|
|
sub_project("mongrel_upload_progress", :uninstall)
|
|
sub_project("mongrel_console", :uninstall)
|
|
sh %{gem uninstall mongrel}
|
|
sub_project("gem_plugin", :uninstall)
|
|
sub_project("fastthread", :uninstall)
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
sub_project("mongrel_service", :install)
|
|
end
|
|
end
|
|
|
|
|
|
task :gem_source do
|
|
mkdir_p "pkg/gems"
|
|
mkdir_p "pkg/tar"
|
|
|
|
FileList["**/*.gem"].each { |gem| mv gem, "pkg/gems" }
|
|
FileList["pkg/*.tgz"].each {|tgz| mv tgz, "pkg/tar" }
|
|
rm_rf "pkg/#{name}-#{version}"
|
|
|
|
sh %{ index_gem_repository.rb -d pkg }
|
|
sh %{ scp -r ChangeLog pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/ }
|
|
end
|