24 lines
588 B
Ruby
24 lines
588 B
Ruby
# We can't use Ruby's standard build procedures
|
|
# on Windows because the Ruby executable is
|
|
# built with VC++ while here we want to build
|
|
# with MingW. So just roll our own...
|
|
|
|
require 'fileutils'
|
|
require 'rbconfig'
|
|
|
|
EXTENSION_NAME = "pg.#{Config::CONFIG["DLEXT"]}"
|
|
|
|
# This is called when the Windows GEM is installed!
|
|
task :install do
|
|
# Gems will pass these two environment variables:
|
|
# RUBYARCHDIR=#{dest_path}
|
|
# RUBYLIBDIR=#{dest_path}
|
|
|
|
dest_path = ENV['RUBYLIBDIR']
|
|
mkdir_p(dest_path)
|
|
|
|
# Copy the extension
|
|
cp(EXTENSION_NAME, dest_path)
|
|
end
|
|
|
|
task :default => :install |