ibm_db 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - IBM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-06 00:00:00.000000000 Z
11
+ date: 2016-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -41,8 +41,6 @@ files:
41
41
  - README
42
42
  - ext/Makefile.nt32
43
43
  - ext/Makefile.nt32.191
44
- - ext/OLD/extconf.rb
45
- - ext/OLD/extconf_MacOS.rb
46
44
  - ext/extconf.rb
47
45
  - ext/ibm_db.c
48
46
  - ext/ruby_ibm_db.h
data/ext/OLD/extconf.rb DELETED
@@ -1,264 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'net/http'
3
- require 'open-uri'
4
- require 'rubygems/package'
5
- require 'zlib'
6
- require 'fileutils'
7
-
8
-
9
- # +----------------------------------------------------------------------+
10
- # | Licensed Materials - Property of IBM |
11
- # | |
12
- # | (C) Copyright IBM Corporation 2006 - 2015 |
13
- # +----------------------------------------------------------------------+
14
-
15
- TAR_LONGLINK = '././@LongLink'
16
-
17
- WIN = RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/
18
-
19
- # use ENV['IBM_DB_HOME'] or latest db2 you can find
20
- IBM_DB_HOME = ENV['IBM_DB_HOME']
21
-
22
- machine_bits = ['ibm'].pack('p').size * 8
23
-
24
- is64Bit = true
25
-
26
- if machine_bits == 64
27
- is64Bit = true
28
- puts "Detected 64-bit Ruby\n "
29
- else
30
- is64Bit = false
31
- puts "Detected 32-bit Ruby\n "
32
- end
33
-
34
- module Kernel
35
- def suppress_warnings
36
- origVerbosity = $VERBOSE
37
- $VERBOSE = nil
38
- result = yield
39
- $VERBOSE = origVerbosity
40
- return result
41
- end
42
- end
43
-
44
- DOWNLOADLINK = ''
45
-
46
- if(RUBY_PLATFORM =~ /aix/i)
47
- #AIX
48
- if(is64Bit)
49
- puts "Detected platform - aix 64"
50
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix64_odbc_cli.tar.gz"
51
- else
52
- puts "Detected platform - aix 32"
53
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix32_odbc_cli.tar.gz"
54
- end
55
- elsif (RUBY_PLATFORM =~ /powerpc/ || RUBY_PLATFORM =~ /ppc/)
56
- #PPC
57
- if(is64Bit)
58
- puts "Detected platform - ppc linux 64"
59
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc64_odbc_cli.tar.gz"
60
- else
61
- puts "Detected platform - ppc linux 64"
62
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc32_odbc_cli.tar.gz"
63
- end
64
- elsif (RUBY_PLATFORM =~ /linux/)
65
- #x86
66
- if(is64Bit)
67
- puts "Detected platform - linux x86 64"
68
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz"
69
- else
70
- puts "Detected platform - linux 32"
71
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxia32_odbc_cli.tar.gz"
72
- end
73
- elsif (RUBY_PLATFORM =~ /sparc/i)
74
- #Solaris
75
- if(is64Bit)
76
- puts "Detected platform - sun sparc64"
77
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun64_odbc_cli.tar.gz"
78
- else
79
- puts "Detected platform - sun sparc32"
80
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun32_odbc_cli.tar.gz"
81
- end
82
- elsif (RUBY_PLATFORM =~ /solaris/i)
83
- if(is64Bit)
84
- puts "Detected platform - sun amd64"
85
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd64_odbc_cli.tar.gz"
86
- else
87
- puts "Detected platform - sun amd32"
88
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd32_odbc_cli.tar.gz"
89
- end
90
- end
91
-
92
- def downloadCLIPackage(destination, link = nil)
93
- if(link.nil?)
94
- downloadLink = DOWNLOADLINK
95
- else
96
- downloadLink = link
97
- end
98
-
99
- uri = URI.parse(downloadLink)
100
- filename = "#{destination}/clidriver.tar.gz"
101
-
102
- headers = {
103
- 'Accept-Encoding' => 'identity',
104
- }
105
-
106
- request = Net::HTTP::Get.new(uri.request_uri, headers)
107
- http = Net::HTTP.new(uri.host, uri.port)
108
- response = http.request(request)
109
-
110
- f = open(filename, 'wb')
111
- f.write(response.body)
112
- f.close()
113
-
114
- filename
115
- end
116
-
117
- def untarCLIPackage(archive,destination)
118
- Gem::Package::TarReader.new( Zlib::GzipReader.open(archive) ) do |tar|
119
- tar.each do |entry|
120
- file = nil
121
- if entry.full_name == $TAR_LONGLINK
122
- file = File.join destination, entry.read.strip
123
- next
124
- end
125
- file ||= File.join destination, entry.full_name
126
- if entry.directory?
127
- File.delete file if File.file? file
128
- FileUtils.mkdir_p file, :mode => entry.header.mode, :verbose => false
129
- elsif entry.file?
130
- FileUtils.rm_rf file if File.directory? file
131
- File.open file, "wb" do |f|
132
- f.print entry.read
133
- end
134
- FileUtils.chmod entry.header.mode, file, :verbose => false
135
- elsif entry.header.typeflag == '2' #Symlink!
136
- File.symlink entry.header.linkname, file
137
- end
138
- end
139
- end
140
- end
141
-
142
- if(IBM_DB_HOME == nil || IBM_DB_HOME == '')
143
- IBM_DB_INCLUDE = ENV['IBM_DB_INCLUDE']
144
- IBM_DB_LIB = ENV['IBM_DB_LIB']
145
-
146
- if( ( (IBM_DB_INCLUDE.nil?) || (IBM_DB_LIB.nil?) ) ||
147
- ( IBM_DB_INCLUDE == '' || IBM_DB_LIB == '' )
148
- )
149
- if(!DOWNLOADLINK.nil? && !DOWNLOADLINK.empty?)
150
- puts "Environment variable IBM_DB_HOME is not set. Downloading and setting up the DB2 client driver\n"
151
- destination = "#{File.expand_path(File.dirname(File.dirname(__FILE__)))}/../lib"
152
-
153
- archive = downloadCLIPackage(destination)
154
- untarCLIPackage(archive,destination)
155
-
156
- IBM_DB_HOME="#{destination}/clidriver"
157
-
158
- IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
159
- IBM_DB_LIB="#{IBM_DB_HOME}/lib"
160
- else
161
- puts "Environment variable IBM_DB_HOME is not set. Set it to your DB2/IBM_Data_Server_Driver installation directory and retry gem install.\n "
162
- exit 1
163
- end
164
- end
165
- else
166
- IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
167
-
168
- if(is64Bit)
169
- IBM_DB_LIB="#{IBM_DB_HOME}/lib64"
170
- else
171
- IBM_DB_LIB="#{IBM_DB_HOME}/lib32"
172
- end
173
- end
174
-
175
- if( !(File.directory?(IBM_DB_LIB)) )
176
- suppress_warnings{IBM_DB_LIB = "#{IBM_DB_HOME}/lib"}
177
- if( !(File.directory?(IBM_DB_LIB)) )
178
- puts "Cannot find #{IBM_DB_LIB} directory. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
179
- exit 1
180
- end
181
- notifyString = "Detected usage of IBM Data Server Driver package. Ensure you have downloaded "
182
-
183
- if(is64Bit)
184
- notifyString = notifyString + "64-bit package "
185
- else
186
- notifyString = notifyString + "32-bit package "
187
- end
188
- notifyString = notifyString + "of IBM_Data_Server_Driver and retry the 'gem install ibm_db' command\n "
189
-
190
- puts notifyString
191
- end
192
-
193
- if( !(File.directory?(IBM_DB_INCLUDE)) )
194
- puts " #{IBM_DB_HOME}/include folder not found. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
195
- exit 1
196
- end
197
-
198
- require 'mkmf'
199
-
200
- dir_config('IBM_DB',IBM_DB_INCLUDE,IBM_DB_LIB)
201
-
202
- def crash(str)
203
- printf(" extconf failure: %s\n", str)
204
- exit 1
205
- end
206
-
207
- if( RUBY_VERSION =~ /1.9/ || RUBY_VERSION =~ /2./)
208
- create_header('gil_release_version')
209
- create_header('unicode_support_version')
210
- end
211
-
212
- unless (have_library(WIN ? 'db2cli' : 'db2','SQLConnect') or find_library(WIN ? 'db2cli' : 'db2','SQLConnect', IBM_DB_LIB))
213
- crash(<<EOL)
214
- Unable to locate libdb2.so/a under #{IBM_DB_LIB}
215
-
216
- Follow the steps below and retry
217
-
218
- Step 1: - Install IBM DB2 Universal Database Server/Client
219
-
220
- step 2: - Set the environment variable IBM_DB_HOME as below
221
-
222
- (assuming bash shell)
223
-
224
- export IBM_DB_HOME=<DB2/IBM_Data_Server_Driver installation directory> #(Eg: export IBM_DB_HOME=/opt/ibm/db2/v10)
225
-
226
- step 3: - Retry gem install
227
-
228
- EOL
229
- end
230
-
231
- if(RUBY_VERSION =~ /2./)
232
- require 'rbconfig'
233
- end
234
-
235
- alias :libpathflag0 :libpathflag
236
- def libpathflag(libpath)
237
- if(RUBY_VERSION =~ /2./)
238
- ldflags = case RbConfig::CONFIG["arch"]
239
- when /solaris2/
240
- libpath[0..-2].map {|path| " -R#{path}"}.join
241
- when /linux/
242
- libpath[0..-2].map {|path| " -R#{path} "}.join
243
- else
244
- ""
245
- end
246
- else
247
- ldflags = case Config::CONFIG["arch"]
248
- when /solaris2/
249
- libpath[0..-2].map {|path| " -R#{path}"}.join
250
- when /linux/
251
- libpath[0..-2].map {|path| " -R#{path} "}.join
252
- else
253
- ""
254
- end
255
- end
256
-
257
- #libpathflag0 + " '-Wl,-R$$ORIGIN/clidriver/lib #{ldflags}' "
258
- libpathflag0 + " '-Wl,-R$$ORIGIN/clidriver/lib' "
259
- end
260
-
261
- have_header('gil_release_version')
262
- have_header('unicode_support_version')
263
-
264
- create_makefile('ibm_db')
@@ -1,269 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'net/http'
3
- require 'open-uri'
4
- require 'rubygems/package'
5
- require 'zlib'
6
- require 'fileutils'
7
-
8
-
9
- # +----------------------------------------------------------------------+
10
- # | Licensed Materials - Property of IBM |
11
- # | |
12
- # | (C) Copyright IBM Corporation 2006 - 2015 |
13
- # +----------------------------------------------------------------------+
14
-
15
- TAR_LONGLINK = '././@LongLink'
16
-
17
- WIN = RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/
18
-
19
- # use ENV['IBM_DB_HOME'] or latest db2 you can find
20
- IBM_DB_HOME = ENV['IBM_DB_HOME']
21
-
22
- machine_bits = ['ibm'].pack('p').size * 8
23
-
24
- is64Bit = true
25
-
26
- if machine_bits == 64
27
- is64Bit = true
28
- puts "Detected 64-bit Ruby\n "
29
- else
30
- is64Bit = false
31
- puts "Detected 32-bit Ruby\n "
32
- end
33
-
34
- module Kernel
35
- def suppress_warnings
36
- origVerbosity = $VERBOSE
37
- $VERBOSE = nil
38
- result = yield
39
- $VERBOSE = origVerbosity
40
- return result
41
- end
42
- end
43
-
44
- DOWNLOADLINK = ''
45
-
46
- if(RUBY_PLATFORM =~ /aix/i)
47
- #AIX
48
- if(is64Bit)
49
- puts "Detected platform - aix 64"
50
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix64_odbc_cli.tar.gz"
51
- else
52
- puts "Detected platform - aix 32"
53
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix32_odbc_cli.tar.gz"
54
- end
55
- elsif (RUBY_PLATFORM =~ /powerpc/ || RUBY_PLATFORM =~ /ppc/)
56
- #PPC
57
- if(is64Bit)
58
- puts "Detected platform - ppc linux 64"
59
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc64_odbc_cli.tar.gz"
60
- else
61
- puts "Detected platform - ppc linux 64"
62
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc32_odbc_cli.tar.gz"
63
- end
64
- elsif (RUBY_PLATFORM =~ /linux/)
65
- #x86
66
- if(is64Bit)
67
- puts "Detected platform - linux x86 64"
68
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz"
69
- else
70
- puts "Detected platform - linux 32"
71
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxia32_odbc_cli.tar.gz"
72
- end
73
- elsif (RUBY_PLATFORM =~ /sparc/i)
74
- #Solaris
75
- if(is64Bit)
76
- puts "Detected platform - sun sparc64"
77
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun64_odbc_cli.tar.gz"
78
- else
79
- puts "Detected platform - sun sparc32"
80
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun32_odbc_cli.tar.gz"
81
- end
82
- elsif (RUBY_PLATFORM =~ /solaris/i)
83
- if(is64Bit)
84
- puts "Detected platform - sun amd64"
85
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd64_odbc_cli.tar.gz"
86
- else
87
- puts "Detected platform - sun amd32"
88
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd32_odbc_cli.tar.gz"
89
- end
90
- elsif (RUBY_PLATFORM =~ /darwin/i)
91
- if(is64Bit)
92
- puts "Detected platform - MacOS darwin64"
93
- DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz"
94
- else
95
- puts "Mac OS 32 bit not supported. Please use an x64 architecture."
96
- end
97
- end
98
-
99
- def downloadCLIPackage(destination, link = nil)
100
- if(link.nil?)
101
- downloadLink = DOWNLOADLINK
102
- else
103
- downloadLink = link
104
- end
105
-
106
- uri = URI.parse(downloadLink)
107
- filename = "#{destination}/clidriver.tar.gz"
108
-
109
- headers = {
110
- 'Accept-Encoding' => 'identity',
111
- }
112
-
113
- request = Net::HTTP::Get.new(uri.request_uri, headers)
114
- http = Net::HTTP.new(uri.host, uri.port)
115
- response = http.request(request)
116
-
117
- f = open(filename, 'wb')
118
- f.write(response.body)
119
- f.close()
120
-
121
- filename
122
- end
123
-
124
- def untarCLIPackage(archive,destination)
125
- Gem::Package::TarReader.new( Zlib::GzipReader.open(archive) ) do |tar|
126
- tar.each do |entry|
127
- file = nil
128
- if entry.full_name == $TAR_LONGLINK
129
- file = File.join destination, entry.read.strip
130
- next
131
- end
132
- file ||= File.join destination, entry.full_name
133
- if entry.directory?
134
- File.delete file if File.file? file
135
- FileUtils.mkdir_p file, :mode => entry.header.mode, :verbose => false
136
- elsif entry.file?
137
- FileUtils.rm_rf file if File.directory? file
138
- File.open file, "wb" do |f|
139
- f.print entry.read
140
- end
141
- FileUtils.chmod entry.header.mode, file, :verbose => false
142
- elsif entry.header.typeflag == '2' #Symlink!
143
- File.symlink entry.header.linkname, file
144
- end
145
- end
146
- end
147
- end
148
-
149
- if(IBM_DB_HOME == nil || IBM_DB_HOME == '')
150
- IBM_DB_INCLUDE = ENV['IBM_DB_INCLUDE']
151
- IBM_DB_LIB = ENV['IBM_DB_LIB']
152
-
153
- if( ( (IBM_DB_INCLUDE.nil?) || (IBM_DB_LIB.nil?) ) ||
154
- ( IBM_DB_INCLUDE == '' || IBM_DB_LIB == '' )
155
- )
156
- if(!DOWNLOADLINK.nil? && !DOWNLOADLINK.empty?)
157
- puts "Environment variable IBM_DB_HOME is not set. Downloading and setting up the DB2 client driver\n"
158
- destination = "#{File.expand_path(File.dirname(File.dirname(__FILE__)))}/../lib"
159
-
160
- archive = downloadCLIPackage(destination)
161
- untarCLIPackage(archive,destination)
162
-
163
- IBM_DB_HOME="#{destination}/clidriver"
164
-
165
- IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
166
- IBM_DB_LIB="#{IBM_DB_HOME}/lib"
167
- else
168
- puts "Environment variable IBM_DB_HOME is not set. Set it to your DB2/IBM_Data_Server_Driver installation directory and retry gem install.\n "
169
- exit 1
170
- end
171
- end
172
- else
173
- IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
174
-
175
- if(is64Bit)
176
- IBM_DB_LIB="#{IBM_DB_HOME}/lib64"
177
- else
178
- IBM_DB_LIB="#{IBM_DB_HOME}/lib32"
179
- end
180
- end
181
-
182
- if( !(File.directory?(IBM_DB_LIB)) )
183
- suppress_warnings{IBM_DB_LIB = "#{IBM_DB_HOME}/lib"}
184
- if( !(File.directory?(IBM_DB_LIB)) )
185
- puts "Cannot find #{IBM_DB_LIB} directory. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
186
- exit 1
187
- end
188
- notifyString = "Detected usage of IBM Data Server Driver package. Ensure you have downloaded "
189
-
190
- if(is64Bit)
191
- notifyString = notifyString + "64-bit package "
192
- else
193
- notifyString = notifyString + "32-bit package "
194
- end
195
- notifyString = notifyString + "of IBM_Data_Server_Driver and retry the 'gem install ibm_db' command\n "
196
-
197
- puts notifyString
198
- end
199
-
200
- if( !(File.directory?(IBM_DB_INCLUDE)) )
201
- puts " #{IBM_DB_HOME}/include folder not found. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
202
- exit 1
203
- end
204
-
205
- require 'mkmf'
206
-
207
- dir_config('IBM_DB',IBM_DB_INCLUDE,IBM_DB_LIB)
208
-
209
- def crash(str)
210
- printf(" extconf failure: %s\n", str)
211
- exit 1
212
- end
213
-
214
- if( RUBY_VERSION =~ /1.9/ || RUBY_VERSION =~ /2./)
215
- create_header('gil_release_version')
216
- create_header('unicode_support_version')
217
- end
218
-
219
- unless (have_library(WIN ? 'db2cli' : 'db2','SQLConnect') or find_library(WIN ? 'db2cli' : 'db2','SQLConnect', IBM_DB_LIB))
220
- crash(<<EOL)
221
- Unable to locate libdb2.so/a under #{IBM_DB_LIB}
222
-
223
- Follow the steps below and retry
224
-
225
- Step 1: - Install IBM DB2 Universal Database Server/Client
226
-
227
- step 2: - Set the environment variable IBM_DB_HOME as below
228
-
229
- (assuming bash shell)
230
-
231
- export IBM_DB_HOME=<DB2/IBM_Data_Server_Driver installation directory> #(Eg: export IBM_DB_HOME=/opt/ibm/db2/v10)
232
-
233
- step 3: - Retry gem install
234
-
235
- EOL
236
- end
237
-
238
- if(RUBY_VERSION =~ /2./)
239
- require 'rbconfig'
240
- end
241
-
242
- alias :libpathflag0 :libpathflag
243
- def libpathflag(libpath)
244
- if(RUBY_VERSION =~ /2./)
245
- libpathflag0 + case RbConfig::CONFIG["arch"]
246
- when /solaris2/
247
- libpath[0..-2].map {|path| " -R#{path}"}.join
248
- when /linux/
249
- libpath[0..-2].map {|path| " -R#{path} "}.join
250
- else
251
- ""
252
- end
253
- else
254
- libpathflag0 + case Config::CONFIG["arch"]
255
- when /solaris2/
256
- libpath[0..-2].map {|path| " -R#{path}"}.join
257
- when /linux/
258
- libpath[0..-2].map {|path| " -R#{path} "}.join
259
- else
260
- ""
261
- end
262
- end
263
-
264
- end
265
-
266
- have_header('gil_release_version')
267
- have_header('unicode_support_version')
268
-
269
- create_makefile('ibm_db')