1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Wilson B. setup a nice win32 gem build for Mongrel.

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@40 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
zedshaw 2006-02-15 23:17:23 +00:00
parent 72e46136b5
commit 615bdc0298
2 changed files with 33 additions and 10 deletions

View file

@ -8,7 +8,8 @@ require 'fileutils'
include FileUtils
setup_tests
setup_clean ["ext/http11/Makefile", "pkg", "lib/*.bundle", "ext/http11/*.bundle", "doc/site/output"]
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"
@ -34,3 +35,17 @@ test_file = "test/test_ws.rb"
setup_gem("mongrel", "0.3.3", "Zed A. Shaw", summary, ['mongrel_rails'], test_file) do |spec|
spec.add_dependency('daemons', '>= 0.4.2')
end
desc "Build a binary gem for Win32"
task :win32_gem => [:clean, :compile, :test, :package_win32]
task :package_win32 do
setup_win32_gem("mongrel", "0.3.3", "Zed A. Shaw", summary,
['mongrel_rails'], test_file) do |spec|
spec.add_dependency('daemons', '>= 0.4.2')
spec.files << 'ext/http11/http11.so'
spec.extensions = []
spec.platform = Gem::Platform::WIN32
end
end

View file

@ -1,7 +1,7 @@
def make(makedir)
Dir.chdir(makedir) do
sh 'make'
sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
end
end
@ -64,14 +64,14 @@ def setup_extension(dir, extension)
end
def setup_gem(pkg_name, pkg_version, author, summary, executables, test_file)
def base_gem_spec(pkg_name, pkg_version, author, summary, executables, test_file)
pkg_version = pkg_version
pkg_name = pkg_name
pkg_file_name = "#{pkg_name}-#{pkg_version}"
spec = Gem::Specification.new do |s|
Gem::Specification.new do |s|
s.name = pkg_name
s.version = pkg_version
s.required_ruby_version = '>= 1.8.3'
s.platform = Gem::Platform::RUBY
s.author = author
s.summary = summary
@ -90,14 +90,22 @@ def setup_gem(pkg_name, pkg_version, author, summary, executables, test_file)
s.executables = executables
s.bindir = "bin"
if block_given?
yield s
end
end
end
def setup_gem(pkg_name, pkg_version, author, summary, executables, test_file)
spec = base_gem_spec(pkg_name, pkg_version, author, summary, executables, test_file)
yield spec if block_given?
Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
end
end
def setup_win32_gem(pkg_name, pkg_version, author, summary, executables, test_file)
spec = base_gem_spec(pkg_name, pkg_version, author, summary, executables, test_file)
yield spec if block_given?
Gem::Builder.new(spec).build
end