pg-jdguyot 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.OS_X ADDED
@@ -0,0 +1,19 @@
1
+ = Compiling on MacOS X
2
+
3
+ If you are building/installing ruby-pg on MacOS X, and the installation doesn't work at first, here are a few things you can try.
4
+
5
+ == Compiling With the Correct Architecture
6
+
7
+ OS X supports both architecture-specific binaries (e.g. i386), as well as universal binaries (i.e. i386 & ppc). If ruby is built as a universal binary and postgresql is not, you need to specify the path to the appropriate pg_config binary or set the environment variable ARCHFLAGS appropriately.
8
+
9
+ For example, if you're using the stock Ruby binary, and PostgreSQL 8.4.x installed from MacPorts (without specifying the {{{+universal}}} variant), do:
10
+
11
+ gem install -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
12
+
13
+ Alternatively, if the build system can't figure out which architectures it should include, you may need to set the 'ARCHFLAGS' environment variable explicitly:
14
+
15
+ sudo env ARCHFLAGS='-arch i386' gem install pg
16
+
17
+ or, if you're building from source:
18
+
19
+ rake compile ARCHFLAGS="-arch i386"
data/README.ja ADDED
@@ -0,0 +1,183 @@
1
+ PostgreSQL$BMQ3HD%%i%$%V%i%j(B version 0.7.1
2
+
3
+ $B$^$D$b$H(B $B$f$-$R$m(B
4
+ $B$^$D$b$H(B $B$($$$8(B
5
+
6
+ $B@$OC?M(B: $B@FF#(B $BEP(B
7
+
8
+ - What's this ?
9
+
10
+ $BK\%i%$%V%i%j$O!"(BRuby$B$+$i(BPostgreSQL$B$X%"%/%;%9$9$k$?$a$N3HD%%i%$%V%i%j$G$9!#(B
11
+ $B%5%]!<%H$7$F$$$k(BPostgreSQL$B$N%P!<%8%g%s$O!"(B6.5/7.0/7.1/7.2 $B$G$9!#(B6.3$B0JA0$N(B
12
+ $B%P!<%8%g%s$G$b(B($B$A$g$C$H$7$?JQ99$G(B)$BF0:n$9$k$H;W$$$^$9$,!"%F%9%H$7$F$$$^$;$s!#(B
13
+
14
+ - How to install ?
15
+ *** requirement ***
16
+ PostgreSQL module$B$r;H$&$s$G$9$+$i!$EvA3(BPostgreSQL$B$OI,MW$G$9$M!%:#$N$H$3$m(B
17
+ $B%m!<%+%k$K(BPostgreSQL$B$,%$%s%9%H!<%k$5$l$F$$$k$3$H$rA0Ds$K$7$F$$$^$9$,!$(B
18
+ $BI,MW$J%X%C%@$H(Blibpq$B$5$($"$l$P!$%5!<%P$OI,$:$7$b%m!<%+%k$GF0:n$7$F$$$kI,MW(B
19
+ $B$O$"$j$^$;$s!%(B
20
+
21
+ $B%G%U%)%k%H$G$O!$(BPostgreSQL$B$,(B/usr/local/pgsql$BG[2<$K%$%s%9%H!<%k$5$l$F$$$k(B
22
+ $B$H$7$F$$$^$9!%JL$N>l=j$K%$%s%9%H!<%k$7$F$$$k>l9g$K$O!$4D6-JQ?t(BPGLIB$B$K(Blibpq
23
+ $B%i%$%V%i%j$,CV$$$F$"$k(Bdirectory$B$K@_Dj$7$F2<$5$$!#(B
24
+
25
+ $BG$0U$N>l=j$G!$$3$N%"!<%+%$%V$rE83+$7$F$/$@$5$$!%8e$O(B
26
+
27
+ ruby extconf.rb
28
+ make
29
+ su ($B$b$7I,MW$J$i(B)
30
+ make install
31
+
32
+ $B$H$9$k$@$1$G$9!%(BPostgreSQL$B$N%$%s%/%k!<%I%U%!%$%k!"%i%$%V%i%j%U%!%$%k$N(B
33
+ $B%$%s%9%H!<%k>l=j$,I8=`$N0LCV$G$O$J$/%3%s%Q%$%i$,8+IU$1$k$3$H$,$G$-$J$$(B
34
+ $B>l9g$K$O(B
35
+
36
+ --with-pgsql-include-dir=<$B%$%s%/%k!<%I%U%!%$%k%G%#%l%/%H%j(B>
37
+ --with-pgsql-lib-dir=<$B%i%$%V%i%j%G%#%l%/%H%j(B>
38
+ $B$^$?$O(B
39
+ --with-pgsql-dir=<$B%G%#%l%/%H%j(B>
40
+ $B$3$l$O0J2<$N$h$&$K;XDj$7$?$H$-$H$*$J$8$G$9!#(B
41
+ --with-pgsql-include-dir=<$B%G%#%l%/%H%j(B>/include
42
+ --with-pgsql-lib-dir=<$B%G%#%l%/%H%j(B>/lib
43
+
44
+
45
+ $BNc$($P(B
46
+
47
+ ruby extconf.rb --with-pgsql-include-dir=/usr/local/pgsql/include \
48
+ --with-pgsql-lib-dir=/usr/local/pgsql/lib
49
+ $B$^$?$O(B
50
+ ruby extconf.rb --with-pgsql-dir=/usr/local/pgsql
51
+
52
+ $B$N$h$&$K;XDj$7$F$/$@$5$$!#(B
53
+
54
+ - How to use ?
55
+
56
+ require "postgres"
57
+
58
+ $B$H$7$F$+$i8f;HMQ2<$5$$!#(B
59
+
60
+ - What function can I use ?
61
+
62
+ $B4pK\E*$K!"(BC$B$N(Blibpq$B%$%s%?%U%'!<%9$GDj5A$5$l$F$$$k4X?t$O%5%]!<%H$7$F$$$^$9!#(B
63
+ ver 0.6.0 $B$+$i?7$7$/(B Large Object $B%$%s%?!<%U%'%$%9$,DI2C$5$l$^$7$?!#(B
64
+
65
+ $B%5%]!<%H$7$F$$$k%a%=%C%I$N0lMw$O0J2<$NDL$j$G$9!#(B
66
+
67
+ PGconn$B%/%i%9(B:
68
+
69
+ $B%/%i%9%a%=%C%I(B
70
+ new
71
+ connect
72
+ setdb
73
+ setdblogin
74
+ escape
75
+ quote
76
+ escape_bytea
77
+
78
+ $B%a%=%C%I(B
79
+ db
80
+ host
81
+ options
82
+ port
83
+ tty
84
+ status
85
+ error
86
+ finish
87
+ close
88
+ reset
89
+ user
90
+ trace
91
+ untrace
92
+
93
+ exec
94
+ query
95
+ async_exec
96
+ async_query
97
+ get_notify
98
+ insert_table
99
+ putline
100
+ getline
101
+ endcopy
102
+ notifies
103
+
104
+ lo_import
105
+ lo_export
106
+ lo_create
107
+ lo_open
108
+ lo_unlink
109
+
110
+ client_encoding
111
+ set_client_encoding
112
+
113
+ PGresult$B%/%i%9(B:
114
+
115
+ $B%a%=%C%I(B
116
+ each
117
+ []
118
+ status
119
+ result
120
+ fields
121
+ num_tuples
122
+ num_fields
123
+ fieldname
124
+ fieldnum
125
+ type
126
+ size
127
+ getvalue
128
+ getlength
129
+ cmdstatus
130
+ print
131
+ clear
132
+
133
+ PGlarge$B%/%i%9(B:
134
+
135
+ $B%a%=%C%I(B
136
+ open
137
+ close
138
+ read
139
+ write
140
+ lseek
141
+ tell
142
+ unlink
143
+ oid
144
+ size
145
+ export
146
+
147
+ - Acknowledgement
148
+
149
+ $BK\3HD%%i%$%V%i%j$r:n@.$9$k$K$"$?$C$F!"(Bruby-list, ruby-dev,
150
+ ruby-talk,$B5Z$S(B pgsql-jp$B%a!<%j%s%0%j%9%H$N%a%s%P!<$K!"B?$/$NM-1W$J(B
151
+ $B%"%I%P%$%9$rD:$-$^$7$?!#$3$3$K46<U$N0U$rI=$7$^$9!#(B
152
+
153
+ - Copying
154
+
155
+ $BK\3HD%%i%$%V%i%j$NCx:n8"$O!"$^$D$b$H(B $B$f$-$R$m$H$^$D$b$H(B $B$($$$8$,(B
156
+ $BJ];}$7$^$9!#(B
157
+
158
+ $BK\3HD%%i%$%V%i%j$O!"(BRuby$BK\BN$HF1$8G[I[>r7o$K=>$C$F:FG[I[$9$k$3$H(B
159
+ $B$,$G$-$^$9!#(BRuby$BK\BN$NG[I[>r7o$K$D$$$F$O!"(BRuby$BG[I[J*Cf$N(BREADME.jp
160
+ $B$K=q$+$l$F$$$^$9!#(B
161
+
162
+ $B8=:_$O@FF#(B $BEP$,(B maintainer $B$r>5$C$F$$$k$N$G!"Ld$$9g$o$;$O$3$A$i$NJ}$K(B
163
+ $B$*4j$$$7$^$9!#(B
164
+
165
+ - Author
166
+
167
+ $B$^$D$b$H(B $B$f$-$R$m(B <matz@ruby-lang.org>
168
+ Author of Ruby
169
+
170
+ $B$^$D$b$H(B $B$($$$8(B <usagi@ruby.club.or.jp>
171
+ One of users who loves Ruby
172
+
173
+ $B$3$N$U$?$j$O7;Do$G$O$"$j$^$;$s!#(B :-)
174
+
175
+ - Special Thanks
176
+
177
+ Guy Decoux ts <decoux@moulon.inra.fr>
178
+
179
+ - maintainer
180
+
181
+ $B@FF#(B $BEP(B <noborus@netlab.jp>
182
+ $B$^$D$b$H$G$J$/$F$9$$$^$;$s(B :-)
183
+
data/README.windows ADDED
@@ -0,0 +1,72 @@
1
+
2
+ = Compiling on MS Windows
3
+
4
+ In order to build this extension on MS Windows you will need a couple things.
5
+
6
+ First, a compiler. For the one click installer this means you should either
7
+ use VC++ 6.0 or the compiler that comes with cygwin or mingw if you're
8
+ building on that platform.
9
+
10
+ If you've built Ruby yourself, you should use the same compiler to build
11
+ this library that you used to build Ruby.
12
+
13
+ Second, PostgreSQL. Be sure you installed it with the development header
14
+ files if you installed it using the standard PostgreSQL installer for
15
+ Windows. If you didn't, you can run the installer again, select "modify",
16
+ and then select the 'development headers' option to install them.
17
+
18
+ I recommend making sure that 'pg_config.exe' is in your PATH. The PostgreSQL
19
+ installer for Windows does not necessarily update your PATH when it installs
20
+ itself, so you may need to do this manually. This isn't strictly necessary,
21
+ however.
22
+
23
+ In order to build ruby-pg, just run 'rake'. If the pg_config.exe executable
24
+ is not in your PATH, you'll need to explicitly point ruby-pg to where your
25
+ PostgreSQL headers and libraries are with something like this:
26
+
27
+ rake --with-pg-dir=c:/progra~1/postgr~1/8.3
28
+
29
+ Adjust your path accordingly. BE SURE TO USE THE SHORT PATH NAMES! If you
30
+ try to use a path with spaces in it, the nmake.exe program will choke.
31
+
32
+
33
+ == Cross compiling for mswin32
34
+
35
+ Using rake-compiler a cross compiled pg-gem can be build on a linux host for
36
+ the win32 platform. The generated gem is statically linked against libpq and
37
+ libssl. OpenSSL and PostgreSQL are downloaded and compiled from the sources.
38
+ There are no runtime dependencies to any but the standard Windows DLLs.
39
+
40
+ Install mingw32. On a debian based system this should work:
41
+
42
+ apt-get install mingw32
43
+
44
+ On MacOS X, if you have MacPorts installed:
45
+
46
+ port install i386-mingw32-gcc
47
+
48
+ Install the rake-compiler:
49
+
50
+ gem install rake-compiler
51
+
52
+ Download and cross compile ruby for win32:
53
+
54
+ rake-compiler cross-ruby VERSION=1.8.6-p287
55
+
56
+ Download and cross compile pg for win32:
57
+
58
+ rake cross native gem RUBY_CC_VERSION=1.8.6 OPENSSL_VERSION=0.9.8l POSTGRESQL_VERSION=8.4.2
59
+
60
+ If everything works, there should be pg-VERSION-x86-mswin32.gem in the pkg
61
+ directory.
62
+
63
+
64
+ If you have any problems you can submit them via the project's issue-tracker:
65
+
66
+ http://bitbucket.org/ged/ruby-pg/issues/new/
67
+
68
+ Or you can join the mailing list:
69
+
70
+ ruby-pg-general@rubyforge.org
71
+
72
+ And submit questions, problems, or solutions, so that it can be improved.
data/Rakefile ADDED
@@ -0,0 +1,359 @@
1
+ #!rake -*- ruby -*-
2
+ #
3
+ # pg rakefile
4
+ #
5
+ # Based on various other Rakefiles, especially one by Ben Bleything
6
+ #
7
+ # Copyright (c) 2007-2010 The FaerieMUD Consortium
8
+ #
9
+ # Authors:
10
+ # * Michael Granger <ged@FaerieMUD.org>
11
+ #
12
+
13
+ BEGIN {
14
+ require 'rbconfig'
15
+ require 'pathname'
16
+ basedir = Pathname.new( __FILE__ ).dirname
17
+
18
+ libdir = basedir + "lib"
19
+ extdir = libdir + Config::CONFIG['sitearch']
20
+
21
+ $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
22
+ $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
23
+ $LOAD_PATH.unshift( extdir.to_s ) unless $LOAD_PATH.include?( extdir.to_s )
24
+ }
25
+
26
+ begin
27
+ require 'readline'
28
+ include Readline
29
+ rescue LoadError
30
+ # Fall back to a plain prompt
31
+ def readline( text )
32
+ $stderr.print( text.chomp )
33
+ return $stdin.gets
34
+ end
35
+ end
36
+
37
+ begin
38
+ require 'rubygems'
39
+ rescue LoadError
40
+ module Gem
41
+ class Specification; end
42
+ end
43
+ end
44
+
45
+ require 'rbconfig'
46
+ require 'rake'
47
+ require 'rake/testtask'
48
+ require 'rake/packagetask'
49
+ require 'rake/clean'
50
+ # require 'rake/191_compat.rb'
51
+
52
+ $dryrun = false
53
+
54
+ ### Config constants
55
+ BASEDIR = Pathname.new( __FILE__ ).dirname.relative_path_from( Pathname.getwd )
56
+ BINDIR = BASEDIR + 'bin'
57
+ LIBDIR = BASEDIR + 'lib'
58
+ EXTDIR = BASEDIR + 'ext'
59
+ DOCSDIR = BASEDIR + 'docs'
60
+ PKGDIR = BASEDIR + 'pkg'
61
+ DATADIR = BASEDIR + 'data'
62
+
63
+ MANUALDIR = DOCSDIR + 'manual'
64
+
65
+ PROJECT_NAME = 'pg-jdguyot'
66
+ PKG_NAME = PROJECT_NAME.downcase
67
+ PKG_SUMMARY = 'A Ruby interface to the PostgreSQL RDBMS'
68
+
69
+ # Cruisecontrol stuff
70
+ CC_BUILD_LABEL = ENV['CC_BUILD_LABEL']
71
+ CC_BUILD_ARTIFACTS = ENV['CC_BUILD_ARTIFACTS'] || 'artifacts'
72
+
73
+ VERSION_FILE = LIBDIR + '../ext/pg.c'
74
+ if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL']
75
+ PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev
76
+ elsif VERSION_FILE.exist?
77
+ PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ]
78
+ end
79
+
80
+ PKG_VERSION = '0.0.0' unless defined?( PKG_VERSION ) && !PKG_VERSION.nil?
81
+
82
+ PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
83
+ GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
84
+
85
+ # Universal VCS constants
86
+ DEFAULT_EDITOR = 'vi'
87
+ COMMIT_MSG_FILE = 'commit-msg.txt'
88
+ FILE_INDENT = " " * 12
89
+ LOG_INDENT = " " * 3
90
+
91
+ EXTCONF = EXTDIR + 'extconf.rb'
92
+
93
+ ARTIFACTS_DIR = Pathname.new( CC_BUILD_ARTIFACTS )
94
+
95
+ TEXT_FILES = Rake::FileList.new( %w[Rakefile ChangeLog README* LICENSE] )
96
+ BIN_FILES = Rake::FileList.new( "#{BINDIR}/*" )
97
+ LIB_FILES = Rake::FileList.new( "#{LIBDIR}/**/*.rb" )
98
+ EXT_FILES = Rake::FileList.new( "#{EXTDIR}/**/*.{c,h,rb}" )
99
+ DATA_FILES = Rake::FileList.new( "#{DATADIR}/**/*" )
100
+
101
+ SPECDIR = BASEDIR + 'spec'
102
+ SPECLIBDIR = SPECDIR + 'lib'
103
+ SPEC_FILES = Rake::FileList.new( "#{SPECDIR}/**/*_spec.rb", "#{SPECLIBDIR}/**/*.rb" )
104
+
105
+ TESTDIR = BASEDIR + 'tests'
106
+ TEST_FILES = Rake::FileList.new( "#{TESTDIR}/**/*.tests.rb" )
107
+
108
+ RAKE_TASKDIR = BASEDIR + 'rake'
109
+ RAKE_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/*.rb" )
110
+ PKG_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/{191_compat,helpers,packaging,rdoc,testing}.rb" )
111
+ PKG_TASKLIBS.include( "#{RAKE_TASKDIR}/manual.rb" ) if MANUALDIR.exist?
112
+
113
+ RAKE_TASKLIBS_URL = 'http://repo.deveiate.org/rake-tasklibs'
114
+
115
+ LOCAL_RAKEFILE = BASEDIR + 'Rakefile.local'
116
+
117
+ EXTRA_PKGFILES = Rake::FileList.new
118
+ EXTRA_PKGFILES.include( "#{BASEDIR}/README.*" )
119
+ EXTRA_PKGFILES.include( "#{BASEDIR}/GPL" )
120
+ EXTRA_PKGFILES.include( "#{BASEDIR}/BSD" )
121
+ EXTRA_PKGFILES.include( "#{BASEDIR}/Contributors" )
122
+
123
+ RELEASE_FILES = TEXT_FILES +
124
+ SPEC_FILES +
125
+ TEST_FILES +
126
+ BIN_FILES +
127
+ LIB_FILES +
128
+ EXT_FILES +
129
+ DATA_FILES +
130
+ RAKE_TASKLIBS +
131
+ EXTRA_PKGFILES
132
+
133
+
134
+ RELEASE_FILES << LOCAL_RAKEFILE.to_s if LOCAL_RAKEFILE.exist?
135
+
136
+ RELEASE_ANNOUNCE_ADDRESSES = [
137
+ "Ruby-Talk List <ruby-talk@ruby-lang.org>",
138
+ ]
139
+
140
+ COVERAGE_MINIMUM = ENV['COVERAGE_MINIMUM'] ? Float( ENV['COVERAGE_MINIMUM'] ) : 85.0
141
+ RCOV_EXCLUDES = 'spec,tests,/Library/Ruby,/var/lib,/usr/local/lib'
142
+ RCOV_OPTS = [
143
+ '--exclude', RCOV_EXCLUDES,
144
+ '--xrefs',
145
+ '--save',
146
+ '--callsites',
147
+ #'--aggregate', 'coverage.data' # <- doesn't work as of 0.8.1.2.0
148
+ ]
149
+
150
+
151
+ ### Load some task libraries that need to be loaded early
152
+ if !RAKE_TASKDIR.exist?
153
+ $stderr.puts "It seems you don't have the build task directory. Shall I fetch it "
154
+ ans = readline( "for you? [y]" )
155
+ ans = 'y' if !ans.nil? && ans.empty?
156
+
157
+ if ans =~ /^y/i
158
+ $stderr.puts "Okay, fetching #{RAKE_TASKLIBS_URL} into #{RAKE_TASKDIR}..."
159
+ system 'hg', 'clone', RAKE_TASKLIBS_URL, "./#{RAKE_TASKDIR}"
160
+ if ! $?.success?
161
+ fail "Damn. That didn't work. Giving up; maybe try manually fetching?"
162
+ end
163
+ else
164
+ $stderr.puts "Then I'm afraid I can't continue. Best of luck."
165
+ fail "Rake tasklibs not present."
166
+ end
167
+
168
+ RAKE_TASKLIBS.include( "#{RAKE_TASKDIR}/*.rb" )
169
+ end
170
+
171
+ require RAKE_TASKDIR + 'helpers.rb'
172
+ include RakefileHelpers
173
+
174
+ # Set the build ID if the mercurial executable is available
175
+ if hg = which( 'hg' )
176
+ id = `#{hg} id -n`.chomp
177
+ PKG_BUILD = (id.chomp[ /^[[:xdigit:]]+/ ] || '1')
178
+ else
179
+ PKG_BUILD = '0'
180
+ end
181
+ SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}"
182
+ SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem"
183
+
184
+ # Documentation constants
185
+ API_DOCSDIR = DOCSDIR + 'api'
186
+ README_FILE = TEXT_FILES.find {|path| path =~ /^README/ } || 'README'
187
+ RDOC_OPTIONS = [
188
+ '--tab-width=4',
189
+ '--show-hash',
190
+ '--include', BASEDIR.to_s,
191
+ "--main=#{README_FILE}",
192
+ "--title=#{PKG_NAME}",
193
+ ]
194
+ YARD_OPTIONS = [
195
+ '--use-cache',
196
+ '--protected',
197
+ '-r', README_FILE,
198
+ '--exclude', 'extconf\\.rb',
199
+ '--files', 'ChangeLog,LICENSE',
200
+ '--output-dir', API_DOCSDIR.to_s,
201
+ '--title', "#{PKG_NAME} #{PKG_VERSION}",
202
+ ]
203
+
204
+ # Release constants
205
+ SMTP_HOST = "mail.faeriemud.org"
206
+ SMTP_PORT = 465 # SMTP + SSL
207
+
208
+ # Project constants
209
+ PROJECT_HOST = 'deveiate.org'
210
+ PROJECT_PUBDIR = '/usr/local/www/public/code/'
211
+ PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}"
212
+ PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}"
213
+ PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}"
214
+
215
+ GEM_PUBHOST = 'rubygems.org'
216
+
217
+ # Gem dependencies: gemname => version
218
+ DEPENDENCIES = {
219
+ }
220
+
221
+ # Developer Gem dependencies: gemname => version
222
+ DEVELOPMENT_DEPENDENCIES = {
223
+ 'rake' => '~> 0.8.7',
224
+ 'rcodetools' => '~> 0.7.0.0',
225
+ 'rcov' => '~> 0.8.1.2.0',
226
+ 'yard' => '~> 0.6.1',
227
+ 'RedCloth' => '~> 4.2.3',
228
+ 'rspec' => '~> 2.0.1',
229
+ 'ruby-termios' => '~> 0.9.6',
230
+ 'text-format' => '~> 1.0.0',
231
+ 'tmail' => '~> 1.2.3.1',
232
+ 'rake-compiler' => '~>0.7.0',
233
+ }
234
+
235
+ # Non-gem requirements: packagename => version
236
+ REQUIREMENTS = {
237
+ 'PostgreSQL' => '>=7.4',
238
+ }
239
+
240
+ # RubyGem specification
241
+ GEMSPEC = Gem::Specification.new do |gem|
242
+ gem.name = PKG_NAME.downcase
243
+ gem.version = PKG_VERSION
244
+
245
+ gem.summary = PKG_SUMMARY
246
+ gem.description = [
247
+ "This is the extension library to access a PostgreSQL database from Ruby.",
248
+ "This library works with PostgreSQL 7.4 and later.",
249
+ ].join( "\n" )
250
+
251
+ gem.authors = ["Jeff Davis", "Michael Granger"]
252
+ gem.email = ["ruby-pg@j-davis.com", "ged@FaerieMUD.org"]
253
+ gem.homepage = 'http://bitbucket.org/ged/ruby-pg/'
254
+ gem.licenses = ["Ruby", "GPL", "BSD"]
255
+
256
+ gem.has_rdoc = true
257
+ gem.rdoc_options = RDOC_OPTIONS
258
+ gem.extra_rdoc_files = TEXT_FILES - [ 'Rakefile' ]
259
+
260
+ gem.bindir = BINDIR.relative_path_from(BASEDIR).to_s
261
+ gem.executables = BIN_FILES.select {|pn| File.executable?(pn) }.
262
+ collect {|pn| File.basename(pn) }
263
+ gem.require_paths << EXTDIR.relative_path_from( BASEDIR ).to_s if EXTDIR.exist?
264
+
265
+ if EXTCONF.exist?
266
+ gem.extensions << EXTCONF.relative_path_from( BASEDIR ).to_s
267
+ end
268
+
269
+ gem.files = RELEASE_FILES
270
+ gem.test_files = SPEC_FILES
271
+
272
+ gem.required_ruby_version = '>=1.8.7'
273
+
274
+ DEPENDENCIES.each do |name, version|
275
+ version = '>= 0' if version.length.zero?
276
+ gem.add_runtime_dependency( name, version )
277
+ end
278
+
279
+ REQUIREMENTS.each do |name, version|
280
+ gem.requirements << [ name, version ].compact.join(' ')
281
+ end
282
+ end
283
+
284
+ $trace = Rake.application.options.trace ? true : false
285
+ $dryrun = Rake.application.options.dryrun ? true : false
286
+ $include_dev_dependencies = false
287
+
288
+ # Load any remaining task libraries
289
+ RAKE_TASKLIBS.each do |tasklib|
290
+ next if tasklib.to_s =~ %r{/helpers\.rb$}
291
+ begin
292
+ trace " loading tasklib %s" % [ tasklib ]
293
+ import tasklib
294
+ rescue ScriptError => err
295
+ fail "Task library '%s' failed to load: %s: %s" %
296
+ [ tasklib, err.class.name, err.message ]
297
+ trace "Backtrace: \n " + err.backtrace.join( "\n " )
298
+ rescue => err
299
+ log "Task library '%s' failed to load: %s: %s. Some tasks may not be available." %
300
+ [ tasklib, err.class.name, err.message ]
301
+ trace "Backtrace: \n " + err.backtrace.join( "\n " )
302
+ end
303
+ end
304
+
305
+ # Load any project-specific rules defined in 'Rakefile.local' if it exists
306
+ import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
307
+
308
+
309
+ #####################################################################
310
+ ### T A S K S
311
+ #####################################################################
312
+
313
+ ### Default task
314
+ task :default => [:clean, :local, :spec, :apidocs, :package]
315
+
316
+ ### Task the local Rakefile can append to -- no-op by default
317
+ task :local
318
+
319
+ ### Task: clean
320
+ CLEAN.include 'coverage', '**/*.orig', '**/*.rej'
321
+ CLOBBER.include 'artifacts', 'coverage.info', 'ChangeLog', PKGDIR
322
+
323
+ ### Task: changelog
324
+ file 'ChangeLog' do |task|
325
+ log "Updating #{task.name}"
326
+
327
+ changelog = make_changelog()
328
+ File.open( task.name, 'w' ) do |fh|
329
+ fh.print( changelog )
330
+ end
331
+ end
332
+
333
+
334
+ ### Task: cruise (Cruisecontrol task)
335
+ desc "Cruisecontrol build"
336
+ task :cruise => [:clean, 'spec:quiet', :package] do |task|
337
+ raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
338
+ artifact_dir = ARTIFACTS_DIR.cleanpath + (CC_BUILD_LABEL || Time.now.strftime('%Y%m%d-%T'))
339
+ artifact_dir.mkpath
340
+
341
+ coverage = BASEDIR + 'coverage'
342
+ if coverage.exist? && coverage.directory?
343
+ $stderr.puts "Copying coverage stats..."
344
+ FileUtils.cp_r( 'coverage', artifact_dir )
345
+ end
346
+
347
+ $stderr.puts "Copying packages..."
348
+ FileUtils.cp_r( FileList['pkg/*'].to_a, artifact_dir )
349
+ end
350
+
351
+
352
+ desc "Update the build system to the latest version"
353
+ task :update_build do
354
+ log "Updating the build system"
355
+ run 'hg', '-R', RAKE_TASKDIR, 'pull', '-u'
356
+ log "Updating the Rakefile"
357
+ sh 'rake', '-f', RAKE_TASKDIR + 'Metarakefile'
358
+ end
359
+