require 'rubygems' require 'rake/gempackagetask' PLUGIN = "do_postgres" NAME = "do_postgres" VERSION = "0.2.0" AUTHOR = "Yehuda Katz" EMAIL = "wycats@gmail.com" HOMEPAGE = "http://dataobjects.devjavu.com" SUMMARY = "A DataObject.rb driver for postgres" spec = Gem::Specification.new do |s| s.name = NAME s.version = VERSION s.platform = Gem::Platform::RUBY s.has_rdoc = true s.extra_rdoc_files = ["README", "LICENSE", 'TODO'] s.summary = SUMMARY s.description = s.summary s.author = AUTHOR s.email = EMAIL s.homepage = HOMEPAGE s.add_dependency('data_objects') s.require_path = 'lib' s.autorequire = PLUGIN s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs,ext}/**/*") end Rake::GemPackageTask.new(spec) do |pkg| pkg.gem_spec = spec end task :install => [:package] do STDERR.puts STDERR.puts "* Installing native extensions" old_stdout, old_stderr = STDOUT.dup, STDERR.dup STDOUT.reopen("/dev/null") # STDERR.reopen("/dev/null") sh %{ruby ext/extconf.rb}, :verbose => false sh %{make clean}, :verbose => false sh %{make}, :verbose => false sh %{sudo make install}, :verbose => false sh %{sudo gem install pkg/#{NAME}-#{VERSION}}, :verbose => false STDOUT.reopen(old_stdout) STDERR.reopen(old_stderr) puts "* Successfully installed native extensions" end