rroonga 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -0
- data/Rakefile +13 -125
- data/bug.rb +36 -0
- data/crash.rb +17 -0
- data/ext/groonga/Makefile +31 -31
- data/ext/groonga/extconf.rb +71 -0
- data/ext/groonga/rb-grn.h +1 -1
- data/extconf.rb +1 -88
- data/rroonga-build.rb +1 -1
- metadata +179 -82
data/README.textile
CHANGED
data/Rakefile
CHANGED
@@ -226,6 +226,10 @@ def rsync_to_rubyforge(spec, source, destination, options={})
|
|
226
226
|
sh("rsync #{rsync_args} #{source} #{host}:#{remote_dir}#{destination}")
|
227
227
|
end
|
228
228
|
|
229
|
+
def rake(*arguments)
|
230
|
+
ruby($0, *arguments)
|
231
|
+
end
|
232
|
+
|
229
233
|
namespace :reference do
|
230
234
|
translate_languages = [:ja]
|
231
235
|
supported_languages = [:en, *translate_languages]
|
@@ -260,6 +264,15 @@ namespace :reference do
|
|
260
264
|
task :update => po_file
|
261
265
|
end
|
262
266
|
end
|
267
|
+
|
268
|
+
desc "Updates po files."
|
269
|
+
task :update do
|
270
|
+
ruby($0, "clobber")
|
271
|
+
ruby($0, "yard")
|
272
|
+
translate_languages.each do |language|
|
273
|
+
ruby($0, "reference:po:#{language}:update")
|
274
|
+
end
|
275
|
+
end
|
263
276
|
end
|
264
277
|
|
265
278
|
namespace :translate do
|
@@ -348,128 +361,3 @@ desc "Tag the current revision."
|
|
348
361
|
task :tag do
|
349
362
|
sh("git tag -a #{version} -m 'release #{version}!!!'")
|
350
363
|
end
|
351
|
-
|
352
|
-
namespace :win32 do
|
353
|
-
patches_dir = (Pathname.new(base_dir) + "patches").expand_path
|
354
|
-
if groonga_win32_i386_p
|
355
|
-
host = "i586-mingw32msvc"
|
356
|
-
mecab_patches = []
|
357
|
-
else
|
358
|
-
host = "x86_64-w64-mingw32"
|
359
|
-
mecab_patches = [
|
360
|
-
"mecab-0.98-mingw-w64.diff",
|
361
|
-
"mecab-0.98-not-use-locale-on-mingw.diff",
|
362
|
-
]
|
363
|
-
end
|
364
|
-
|
365
|
-
desc "Build MeCab and groonga and install them into vendor/local/."
|
366
|
-
task(:build => [:build_mecab, :build_mecab_dict, :build_groonga])
|
367
|
-
|
368
|
-
desc "Build MeCab and install it into vendor/local/."
|
369
|
-
task(:build_mecab) do
|
370
|
-
tmp_dir = "tmp/mecab"
|
371
|
-
rm_rf(tmp_dir)
|
372
|
-
mkdir_p(tmp_dir)
|
373
|
-
require 'open-uri'
|
374
|
-
mecab_version = "0.98"
|
375
|
-
mecab_base = "mecab-#{mecab_version}"
|
376
|
-
mecab_tar_gz = "#{mecab_base}.tar.gz"
|
377
|
-
mecab_tar_gz_url = "http://sourceforge.net/projects/mecab/files/mecab/#{mecab_version}/#{mecab_tar_gz}/download"
|
378
|
-
Dir.chdir(tmp_dir) do
|
379
|
-
open(mecab_tar_gz_url) do |downloaded_tar_gz|
|
380
|
-
File.open(mecab_tar_gz, "wb") do |tar_gz|
|
381
|
-
tar_gz.print(downloaded_tar_gz.read)
|
382
|
-
end
|
383
|
-
end
|
384
|
-
sh("tar", "xzf", mecab_tar_gz) or exit(false)
|
385
|
-
end
|
386
|
-
Dir.chdir(File.join(tmp_dir, mecab_base)) do
|
387
|
-
mecab_patches.each do |patch|
|
388
|
-
sh("patch -p1 < #{patches_dir + patch}")
|
389
|
-
end
|
390
|
-
sh("./configure",
|
391
|
-
"--prefix=#{binary_dir}",
|
392
|
-
"--host=#{host}") or exit(false)
|
393
|
-
sh("env", "GREP_OPTIONS=--text", "nice", "make", "-j8") or exit(false)
|
394
|
-
sh("env", "GREP_OPTIONS=--text", "make", "install") or exit(false)
|
395
|
-
|
396
|
-
mecab_rc_path = File.join(binary_dir, "etc", "mecabrc")
|
397
|
-
win32_mecab_rc_path = File.join(binary_dir, "bin", "mecabrc")
|
398
|
-
mv(mecab_rc_path, win32_mecab_rc_path)
|
399
|
-
|
400
|
-
mecab_files_dir = File.join(vendor_dir, "mecab")
|
401
|
-
mkdir_p(mecab_files_dir)
|
402
|
-
files = ["AUTHORS", "BSD", "COPYING", "GPL", "LGPL"]
|
403
|
-
cp(files, mecab_files_dir)
|
404
|
-
end
|
405
|
-
end
|
406
|
-
|
407
|
-
task(:build_mecab_dict) do
|
408
|
-
tmp_dir = "tmp/mecab_dict"
|
409
|
-
rm_rf(tmp_dir)
|
410
|
-
mkdir_p(tmp_dir)
|
411
|
-
require 'open-uri'
|
412
|
-
naist_jdic_base = "mecab-naist-jdic-0.6.3-20100801"
|
413
|
-
naist_jdic_tar_gz = "#{naist_jdic_base}.tar.gz"
|
414
|
-
naist_jdic_tar_gz_url = "http://osdn.dl.sourceforge.jp/naist-jdic/48487/#{naist_jdic_tar_gz}"
|
415
|
-
Dir.chdir(tmp_dir) do
|
416
|
-
open(naist_jdic_tar_gz_url) do |downloaded_tar_gz|
|
417
|
-
File.open(naist_jdic_tar_gz, "wb") do |tar_gz|
|
418
|
-
tar_gz.print(downloaded_tar_gz.read)
|
419
|
-
end
|
420
|
-
end
|
421
|
-
sh("tar", "xzf", naist_jdic_tar_gz) or exit(false)
|
422
|
-
end
|
423
|
-
Dir.chdir(File.join(tmp_dir, naist_jdic_base)) do
|
424
|
-
sh("./configure",
|
425
|
-
"--with-dicdir=#{binary_dir}/share/mecab/dic/naist-jdic",
|
426
|
-
"--with-charset=utf-8") or exit(false)
|
427
|
-
sh("make", "-j8") or exit(false)
|
428
|
-
sh("make", "install-data") or exit(false)
|
429
|
-
|
430
|
-
naist_jdic_files_dir = File.join(vendor_dir, "mecab-naist-jdic")
|
431
|
-
mkdir_p(naist_jdic_files_dir)
|
432
|
-
files = ["AUTHORS", "COPYING"]
|
433
|
-
cp(files, naist_jdic_files_dir)
|
434
|
-
end
|
435
|
-
dictionary_dir = '$(rcpath)\..\share\mecab\dic\naist-jdic'
|
436
|
-
mecab_rc_path = File.join(binary_dir, "bin", "mecabrc")
|
437
|
-
mecab_rc_content = File.read(mecab_rc_path)
|
438
|
-
File.open(mecab_rc_path, "w") do |mecab_rc|
|
439
|
-
mecab_rc.print(mecab_rc_content.gsub(/^dicdir\s*=.+$/,
|
440
|
-
"dicdir = #{dictionary_dir}"))
|
441
|
-
end
|
442
|
-
end
|
443
|
-
|
444
|
-
desc "Build groonga and install it into vendor/local/."
|
445
|
-
task(:build_groonga) do
|
446
|
-
tmp_dir = "tmp/groonga"
|
447
|
-
rm_rf(tmp_dir)
|
448
|
-
mkdir_p(tmp_dir)
|
449
|
-
Dir.chdir(tmp_dir) do
|
450
|
-
sh("git", "clone", "git://github.com/groonga/groonga.git") or exit(false)
|
451
|
-
end
|
452
|
-
Dir.chdir(File.join(tmp_dir, "groonga")) do
|
453
|
-
sh("./autogen.sh") or exit(false)
|
454
|
-
mecab_config = File.join(binary_dir, "bin", "mecab-config")
|
455
|
-
args = ["./configure",
|
456
|
-
"--prefix=#{binary_dir}",
|
457
|
-
"--host=#{host}",
|
458
|
-
"--without-cutter",
|
459
|
-
"--disable-benchmark"]
|
460
|
-
if File.exist?(mecab_config)
|
461
|
-
args << "--with-mecab-config=#{mecab_config}"
|
462
|
-
else
|
463
|
-
args << "--without-mecab"
|
464
|
-
end
|
465
|
-
sh(*args) or exit(false)
|
466
|
-
sh("env", "GREP_OPTIONS=--text", "nice", "make", "-j8") or exit(false)
|
467
|
-
sh("env", "GREP_OPTIONS=--text", "make", "install") or exit(false)
|
468
|
-
|
469
|
-
groonga_files_dir = File.join(vendor_dir, "groonga")
|
470
|
-
mkdir_p(groonga_files_dir)
|
471
|
-
files = ["AUTHORS", "COPYING"]
|
472
|
-
cp(files, groonga_files_dir)
|
473
|
-
end
|
474
|
-
end
|
475
|
-
end
|
data/bug.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'groonga'
|
5
|
+
|
6
|
+
Groonga::Logger.log_path = "/tmp/groonga.log"
|
7
|
+
Groonga::Logger.query_log_path = "/tmp/groonga-query.log"
|
8
|
+
|
9
|
+
i = 0
|
10
|
+
loop do
|
11
|
+
path = "/tmp/db/db"
|
12
|
+
FileUtils.rm_rf(File.dirname(path))
|
13
|
+
FileUtils.mkdir_p(File.dirname(path))
|
14
|
+
Groonga::Context.default = nil
|
15
|
+
database = Groonga::Database.create(:path => path)
|
16
|
+
Groonga::Schema.define do |schema|
|
17
|
+
schema.create_table("Users",
|
18
|
+
:type => :hash,
|
19
|
+
:key_type => "ShortText") do |table|
|
20
|
+
table.uint32("name_length")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
users = Groonga["Users"]
|
25
|
+
10.times do
|
26
|
+
i += 1
|
27
|
+
exit if i > 100
|
28
|
+
name = i.to_s
|
29
|
+
users.add(name, :name_length => name.length)
|
30
|
+
end
|
31
|
+
builder = Groonga::RecordExpressionBuilder.new(users, nil)
|
32
|
+
builder.query = "name_length:3"
|
33
|
+
builder.build
|
34
|
+
database.close
|
35
|
+
GC.start
|
36
|
+
end
|
data/crash.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'groonga'
|
4
|
+
|
5
|
+
context = Groonga::Context.default
|
6
|
+
context.connect(:port => 10042)
|
7
|
+
|
8
|
+
10000.times do |i|
|
9
|
+
p i
|
10
|
+
GC.stress = true
|
11
|
+
result = context.select("Program")
|
12
|
+
result.records.each do |record|
|
13
|
+
record["_key"]
|
14
|
+
record["unknown"]
|
15
|
+
end
|
16
|
+
GC.stress = false
|
17
|
+
end
|
data/ext/groonga/Makefile
CHANGED
@@ -3,7 +3,7 @@ SHELL = /bin/sh
|
|
3
3
|
|
4
4
|
#### Start of system configuration section. ####
|
5
5
|
|
6
|
-
srcdir = /home/
|
6
|
+
srcdir = /home/kou/work/ruby/rroonga/ext/groonga
|
7
7
|
topdir = /usr/include/ruby-1.9.1
|
8
8
|
hdrdir = /usr/include/ruby-1.9.1
|
9
9
|
arch_hdrdir = /usr/include/ruby-1.9.1/$(arch)
|
@@ -54,15 +54,15 @@ COUTFLAG = -o
|
|
54
54
|
|
55
55
|
RUBY_EXTCONF_H =
|
56
56
|
cflags = $(optflags) $(debugflags) $(warnflags)
|
57
|
-
optflags = -
|
58
|
-
debugflags = -
|
57
|
+
optflags = -O3
|
58
|
+
debugflags = -ggdb
|
59
59
|
warnflags = -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long
|
60
|
-
CFLAGS = -fPIC -fno-strict-aliasing -
|
60
|
+
CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -I/home/kou/work/ruby/rroonga/vendor/local/include/groonga
|
61
61
|
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
62
62
|
DEFS =
|
63
|
-
CPPFLAGS = -DRB_GRN_COMPILATION -DGRN_MAJOR_VERSION=1 -DGRN_MINOR_VERSION=2 -DGRN_MICRO_VERSION=
|
63
|
+
CPPFLAGS = -DRB_GRN_COMPILATION -DGRN_MAJOR_VERSION=1 -DGRN_MINOR_VERSION=2 -DGRN_MICRO_VERSION=3 -DHAVE_RB_ERRINFO -DHAVE_TYPE_ENUM_RUBY_VALUE_TYPE $(DEFS) $(cppflags)
|
64
64
|
CXXFLAGS = $(CFLAGS) -fno-strict-aliasing -g
|
65
|
-
ldflags = -L. -rdynamic -Wl,-export-dynamic -L/
|
65
|
+
ldflags = -L. -rdynamic -Wl,-export-dynamic -L/home/kou/work/ruby/rroonga/vendor/local/lib
|
66
66
|
dldflags =
|
67
67
|
ARCH_FLAG =
|
68
68
|
DLDFLAGS = $(ldflags) $(dldflags)
|
@@ -105,8 +105,8 @@ extout_prefix =
|
|
105
105
|
target_prefix =
|
106
106
|
LOCAL_LIBS =
|
107
107
|
LIBS = $(LIBRUBYARG_SHARED) -lgroonga -lpthread -lrt -ldl -lcrypt -lm -lc
|
108
|
-
SRCS = rb-grn-
|
109
|
-
OBJS = rb-grn-
|
108
|
+
SRCS = rb-grn-procedure.c rb-grn-column.c rb-grn-index-column.c rb-grn-encoding-support.c rb-grn-variable.c rb-grn-table.c rb-grn-hash-cursor.c rb-grn-table-cursor-key-support.c rb-grn-object.c rb-grn-view-accessor.c rb-grn-table-key-support.c rb-grn-array.c rb-grn-patricia-trie.c rb-grn-utils.c rb-grn-record.c rb-grn-query.c rb-groonga.c rb-grn-exception.c rb-grn-variable-size-column.c rb-grn-encoding.c rb-grn-expression-builder.c rb-grn-operator.c rb-grn-snippet.c rb-grn-array-cursor.c rb-grn-type.c rb-grn-table-cursor.c rb-grn-fix-size-column.c rb-grn-view-cursor.c rb-grn-logger.c rb-grn-plugin.c rb-grn-database.c rb-grn-view-record.c rb-grn-patricia-trie-cursor.c rb-grn-index-cursor.c rb-grn-view.c rb-grn-accessor.c rb-grn-context.c rb-grn-posting.c rb-grn-expression.c rb-grn-hash.c
|
109
|
+
OBJS = rb-grn-procedure.o rb-grn-column.o rb-grn-index-column.o rb-grn-encoding-support.o rb-grn-variable.o rb-grn-table.o rb-grn-hash-cursor.o rb-grn-table-cursor-key-support.o rb-grn-object.o rb-grn-view-accessor.o rb-grn-table-key-support.o rb-grn-array.o rb-grn-patricia-trie.o rb-grn-utils.o rb-grn-record.o rb-grn-query.o rb-groonga.o rb-grn-exception.o rb-grn-variable-size-column.o rb-grn-encoding.o rb-grn-expression-builder.o rb-grn-operator.o rb-grn-snippet.o rb-grn-array-cursor.o rb-grn-type.o rb-grn-table-cursor.o rb-grn-fix-size-column.o rb-grn-view-cursor.o rb-grn-logger.o rb-grn-plugin.o rb-grn-database.o rb-grn-view-record.o rb-grn-patricia-trie-cursor.o rb-grn-index-cursor.o rb-grn-view.o rb-grn-accessor.o rb-grn-context.o rb-grn-posting.o rb-grn-expression.o rb-grn-hash.o
|
110
110
|
TARGET = groonga
|
111
111
|
DLLIB = $(TARGET).so
|
112
112
|
EXTSTATIC =
|
@@ -154,36 +154,31 @@ install-rb: pre-install-rb install-rb-default
|
|
154
154
|
install-rb-default: pre-install-rb-default
|
155
155
|
pre-install-rb: Makefile
|
156
156
|
pre-install-rb-default: Makefile
|
157
|
-
pre-install-rb: $(RUBYLIBDIR)
|
158
|
-
install-rb: $(RUBYLIBDIR)/groonga.rb
|
159
|
-
$(RUBYLIBDIR)/groonga.rb: $(srcdir)/../../lib/groonga.rb
|
160
|
-
@-$(MAKEDIRS) $(@D)
|
161
|
-
$(INSTALL_DATA) $(srcdir)/../../lib/groonga.rb $(@D)
|
162
157
|
pre-install-rb: $(RUBYLIBDIR)/groonga
|
163
|
-
install-rb: $(RUBYLIBDIR)/groonga/
|
164
|
-
$(RUBYLIBDIR)/groonga/
|
158
|
+
install-rb: $(RUBYLIBDIR)/groonga/schema.rb
|
159
|
+
$(RUBYLIBDIR)/groonga/schema.rb: $(srcdir)/../../lib/groonga/schema.rb
|
165
160
|
@-$(MAKEDIRS) $(@D)
|
166
|
-
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/
|
161
|
+
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/schema.rb $(@D)
|
167
162
|
install-rb: $(RUBYLIBDIR)/groonga/pagination.rb
|
168
163
|
$(RUBYLIBDIR)/groonga/pagination.rb: $(srcdir)/../../lib/groonga/pagination.rb
|
169
164
|
@-$(MAKEDIRS) $(@D)
|
170
165
|
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/pagination.rb $(@D)
|
171
|
-
install-rb: $(RUBYLIBDIR)/groonga/
|
172
|
-
$(RUBYLIBDIR)/groonga/
|
173
|
-
@-$(MAKEDIRS) $(@D)
|
174
|
-
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/schema.rb $(@D)
|
175
|
-
install-rb: $(RUBYLIBDIR)/groonga/expression-builder.rb
|
176
|
-
$(RUBYLIBDIR)/groonga/expression-builder.rb: $(srcdir)/../../lib/groonga/expression-builder.rb
|
166
|
+
install-rb: $(RUBYLIBDIR)/groonga/view-record.rb
|
167
|
+
$(RUBYLIBDIR)/groonga/view-record.rb: $(srcdir)/../../lib/groonga/view-record.rb
|
177
168
|
@-$(MAKEDIRS) $(@D)
|
178
|
-
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/
|
169
|
+
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/view-record.rb $(@D)
|
179
170
|
install-rb: $(RUBYLIBDIR)/groonga/patricia-trie.rb
|
180
171
|
$(RUBYLIBDIR)/groonga/patricia-trie.rb: $(srcdir)/../../lib/groonga/patricia-trie.rb
|
181
172
|
@-$(MAKEDIRS) $(@D)
|
182
173
|
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/patricia-trie.rb $(@D)
|
183
|
-
install-rb: $(RUBYLIBDIR)/groonga/
|
184
|
-
$(RUBYLIBDIR)/groonga/
|
174
|
+
install-rb: $(RUBYLIBDIR)/groonga/dumper.rb
|
175
|
+
$(RUBYLIBDIR)/groonga/dumper.rb: $(srcdir)/../../lib/groonga/dumper.rb
|
185
176
|
@-$(MAKEDIRS) $(@D)
|
186
|
-
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/
|
177
|
+
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/dumper.rb $(@D)
|
178
|
+
install-rb: $(RUBYLIBDIR)/groonga/posting.rb
|
179
|
+
$(RUBYLIBDIR)/groonga/posting.rb: $(srcdir)/../../lib/groonga/posting.rb
|
180
|
+
@-$(MAKEDIRS) $(@D)
|
181
|
+
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/posting.rb $(@D)
|
187
182
|
install-rb: $(RUBYLIBDIR)/groonga/context.rb
|
188
183
|
$(RUBYLIBDIR)/groonga/context.rb: $(srcdir)/../../lib/groonga/context.rb
|
189
184
|
@-$(MAKEDIRS) $(@D)
|
@@ -192,16 +187,21 @@ install-rb: $(RUBYLIBDIR)/groonga/record.rb
|
|
192
187
|
$(RUBYLIBDIR)/groonga/record.rb: $(srcdir)/../../lib/groonga/record.rb
|
193
188
|
@-$(MAKEDIRS) $(@D)
|
194
189
|
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/record.rb $(@D)
|
195
|
-
install-rb: $(RUBYLIBDIR)/groonga/
|
196
|
-
$(RUBYLIBDIR)/groonga/
|
190
|
+
install-rb: $(RUBYLIBDIR)/groonga/expression-builder.rb
|
191
|
+
$(RUBYLIBDIR)/groonga/expression-builder.rb: $(srcdir)/../../lib/groonga/expression-builder.rb
|
197
192
|
@-$(MAKEDIRS) $(@D)
|
198
|
-
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/
|
193
|
+
$(INSTALL_DATA) $(srcdir)/../../lib/groonga/expression-builder.rb $(@D)
|
194
|
+
pre-install-rb: $(RUBYLIBDIR)
|
195
|
+
install-rb: $(RUBYLIBDIR)/groonga.rb
|
196
|
+
$(RUBYLIBDIR)/groonga.rb: $(srcdir)/../../lib/groonga.rb
|
197
|
+
@-$(MAKEDIRS) $(@D)
|
198
|
+
$(INSTALL_DATA) $(srcdir)/../../lib/groonga.rb $(@D)
|
199
199
|
$(RUBYARCHDIR):
|
200
200
|
$(MAKEDIRS) $@
|
201
|
-
$(RUBYLIBDIR):
|
202
|
-
$(MAKEDIRS) $@
|
203
201
|
$(RUBYLIBDIR)/groonga:
|
204
202
|
$(MAKEDIRS) $@
|
203
|
+
$(RUBYLIBDIR):
|
204
|
+
$(MAKEDIRS) $@
|
205
205
|
|
206
206
|
site-install: site-install-so site-install-rb
|
207
207
|
site-install-so: install-so
|
data/ext/groonga/extconf.rb
CHANGED
@@ -61,6 +61,77 @@ checking_for(checking_message("Win32 OS")) do
|
|
61
61
|
win32
|
62
62
|
end
|
63
63
|
|
64
|
+
def install_groonga_locally(major, minor, micro)
|
65
|
+
require 'open-uri'
|
66
|
+
require 'shellwords'
|
67
|
+
|
68
|
+
tar_gz = "groonga-#{major}.#{minor}.#{micro}.tar.gz"
|
69
|
+
FileUtils.mkdir_p(local_groonga_base_dir)
|
70
|
+
|
71
|
+
install_dir = local_groonga_install_dir
|
72
|
+
Dir.chdir(local_groonga_base_dir) do
|
73
|
+
url = "http://packages.groonga.org/source/groonga/#{tar_gz}"
|
74
|
+
message("downloading %s...", url)
|
75
|
+
open(url, "rb") do |input|
|
76
|
+
File.open(tar_gz, "wb") do |output|
|
77
|
+
while (buffer = input.read(1024))
|
78
|
+
output.print(buffer)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
message(" done\n")
|
83
|
+
|
84
|
+
message("extracting...")
|
85
|
+
if xsystem("tar xfz #{tar_gz}")
|
86
|
+
message(" done\n")
|
87
|
+
else
|
88
|
+
message(" failed\n")
|
89
|
+
exit 1
|
90
|
+
end
|
91
|
+
|
92
|
+
groonga_source_dir = "groonga-#{major}.#{minor}.#{micro}"
|
93
|
+
Dir.chdir(groonga_source_dir) do
|
94
|
+
message("configuring...")
|
95
|
+
prefix = Shellwords.escape(install_dir)
|
96
|
+
if xsystem("./configure CFLAGS='-g -O0' --prefix=#{prefix}")
|
97
|
+
message(" done\n")
|
98
|
+
else
|
99
|
+
message(" failed\n")
|
100
|
+
exit 1
|
101
|
+
end
|
102
|
+
|
103
|
+
message("building (maybe long time)...")
|
104
|
+
if xsystem("make")
|
105
|
+
message(" done\n")
|
106
|
+
else
|
107
|
+
message(" failed\n")
|
108
|
+
exit 1
|
109
|
+
end
|
110
|
+
|
111
|
+
message("installing...")
|
112
|
+
if [major, minor, micro] == [0, 1, 6]
|
113
|
+
make_install_args = " MKDIR_P='mkdir -p --'"
|
114
|
+
else
|
115
|
+
make_install_args = ""
|
116
|
+
end
|
117
|
+
if xsystem("make install#{make_install_args}")
|
118
|
+
message(" done\n")
|
119
|
+
else
|
120
|
+
message(" failed\n")
|
121
|
+
exit 1
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
prepend_pkg_config_path_for_local_groonga
|
127
|
+
end
|
128
|
+
|
129
|
+
unless PKGConfig.have_package(package_name, major, minor, micro)
|
130
|
+
unless have_local_groonga?(package_name, major, minor, micro)
|
131
|
+
install_groonga_locally(major, minor, micro)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
64
135
|
unless PKGConfig.have_package(package_name, major, minor, micro)
|
65
136
|
have_local_groonga?(package_name, major, minor, micro) or exit 1
|
66
137
|
add_rpath_for_local_groonga
|
data/ext/groonga/rb-grn.h
CHANGED
data/extconf.rb
CHANGED
@@ -18,96 +18,9 @@
|
|
18
18
|
require 'English'
|
19
19
|
require 'pathname'
|
20
20
|
require 'fileutils'
|
21
|
-
|
22
|
-
begin
|
23
|
-
require 'pkg-config'
|
24
|
-
rescue LoadError
|
25
|
-
require 'rubygems'
|
26
|
-
require 'pkg-config'
|
27
|
-
end
|
21
|
+
require 'mkmf'
|
28
22
|
|
29
23
|
base_dir = Pathname(__FILE__).dirname.realpath
|
30
|
-
$LOAD_PATH.unshift(base_dir.to_s)
|
31
|
-
|
32
|
-
require 'rroonga-build'
|
33
|
-
|
34
|
-
include RroongaBuild
|
35
|
-
|
36
|
-
package_name = "groonga"
|
37
|
-
module_name = "groonga"
|
38
|
-
major, minor, micro = RequiredGroongaVersion::VERSION
|
39
|
-
|
40
|
-
def install_groonga_locally(major, minor, micro)
|
41
|
-
require 'open-uri'
|
42
|
-
require 'shellwords'
|
43
|
-
|
44
|
-
tar_gz = "groonga-#{major}.#{minor}.#{micro}.tar.gz"
|
45
|
-
FileUtils.mkdir_p(local_groonga_base_dir)
|
46
|
-
|
47
|
-
install_dir = local_groonga_install_dir
|
48
|
-
Dir.chdir(local_groonga_base_dir) do
|
49
|
-
url = "http://packages.groonga.org/source/groonga/#{tar_gz}"
|
50
|
-
message("downloading %s...", url)
|
51
|
-
open(url, "rb") do |input|
|
52
|
-
File.open(tar_gz, "wb") do |output|
|
53
|
-
while (buffer = input.read(1024))
|
54
|
-
output.print(buffer)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
message(" done\n")
|
59
|
-
|
60
|
-
message("extracting...")
|
61
|
-
if xsystem("tar xfz #{tar_gz}")
|
62
|
-
message(" done\n")
|
63
|
-
else
|
64
|
-
message(" failed\n")
|
65
|
-
exit 1
|
66
|
-
end
|
67
|
-
|
68
|
-
groonga_source_dir = "groonga-#{major}.#{minor}.#{micro}"
|
69
|
-
Dir.chdir(groonga_source_dir) do
|
70
|
-
message("configuring...")
|
71
|
-
prefix = Shellwords.escape(install_dir)
|
72
|
-
if xsystem("./configure CFLAGS='-g -O0' --prefix=#{prefix}")
|
73
|
-
message(" done\n")
|
74
|
-
else
|
75
|
-
message(" failed\n")
|
76
|
-
exit 1
|
77
|
-
end
|
78
|
-
|
79
|
-
message("building (maybe long time)...")
|
80
|
-
if xsystem("make")
|
81
|
-
message(" done\n")
|
82
|
-
else
|
83
|
-
message(" failed\n")
|
84
|
-
exit 1
|
85
|
-
end
|
86
|
-
|
87
|
-
message("installing...")
|
88
|
-
if [major, minor, micro] == [0, 1, 6]
|
89
|
-
make_install_args = " MKDIR_P='mkdir -p --'"
|
90
|
-
else
|
91
|
-
make_install_args = ""
|
92
|
-
end
|
93
|
-
if xsystem("make install#{make_install_args}")
|
94
|
-
message(" done\n")
|
95
|
-
else
|
96
|
-
message(" failed\n")
|
97
|
-
exit 1
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
prepend_pkg_config_path_for_local_groonga
|
103
|
-
end
|
104
|
-
|
105
|
-
unless PKGConfig.have_package(package_name, major, minor, micro)
|
106
|
-
unless have_local_groonga?(package_name, major, minor, micro)
|
107
|
-
install_groonga_locally(major, minor, micro)
|
108
|
-
PKGConfig.have_package(package_name, major, minor, micro) or exit 1
|
109
|
-
end
|
110
|
-
end
|
111
24
|
|
112
25
|
source_ext_dir = Pathname("ext") + "groonga"
|
113
26
|
FileUtils.mkdir_p(source_ext_dir.to_s)
|
data/rroonga-build.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rroonga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 4
|
10
|
+
version: 1.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kouhei Sutou
|
@@ -19,10 +19,106 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2011-06-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
date: 2011-06-29 00:00:00 Z
|
23
|
+
dependencies:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
31
|
+
segments:
|
32
|
+
- 0
|
33
|
+
version: "0"
|
34
|
+
name: pkg-config
|
35
|
+
prerelease: false
|
36
|
+
type: :runtime
|
37
|
+
requirement: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
|
+
name: test-unit
|
49
|
+
prerelease: false
|
50
|
+
type: :development
|
51
|
+
requirement: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
name: test-unit-notify
|
63
|
+
prerelease: false
|
64
|
+
type: :development
|
65
|
+
requirement: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
76
|
+
name: rake
|
77
|
+
prerelease: false
|
78
|
+
type: :development
|
79
|
+
requirement: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 3
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
90
|
+
name: rake-compiler
|
91
|
+
prerelease: false
|
92
|
+
type: :development
|
93
|
+
requirement: *id005
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
104
|
+
name: jeweler
|
105
|
+
prerelease: false
|
106
|
+
type: :development
|
107
|
+
requirement: *id006
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
118
|
+
name: yard
|
119
|
+
prerelease: false
|
120
|
+
type: :development
|
121
|
+
requirement: *id007
|
26
122
|
description: |-
|
27
123
|
rroonga is an extension library to use groonga's DB-API
|
28
124
|
layer. rroonga provides Rubyish readable and writable API
|
@@ -47,6 +143,8 @@ files:
|
|
47
143
|
- benchmark/select.rb
|
48
144
|
- benchmark/write-many-small-items.rb
|
49
145
|
- bin/grndump
|
146
|
+
- bug.rb
|
147
|
+
- crash.rb
|
50
148
|
- example/bookmark.rb
|
51
149
|
- example/index-html.rb
|
52
150
|
- ext/groonga/Makefile
|
@@ -108,53 +206,52 @@ files:
|
|
108
206
|
- rroonga-build.rb
|
109
207
|
- README.textile
|
110
208
|
- TODO
|
111
|
-
- test/test-
|
112
|
-
- test/test-array.rb
|
113
|
-
- test/test-table-offset-and-limit.rb
|
209
|
+
- test/groonga-test-utils.rb
|
114
210
|
- test/run-test.rb
|
115
|
-
- test/test-
|
116
|
-
- test/test-
|
117
|
-
- test/test-
|
118
|
-
- test/test-
|
211
|
+
- test/test-accessor.rb
|
212
|
+
- test/test-array.rb
|
213
|
+
- test/test-column.rb
|
214
|
+
- test/test-context-select.rb
|
215
|
+
- test/test-context.rb
|
216
|
+
- test/test-database-dumper.rb
|
217
|
+
- test/test-database.rb
|
119
218
|
- test/test-encoding.rb
|
120
|
-
- test/test-type.rb
|
121
|
-
- test/test-table.rb
|
122
|
-
- test/test-query.rb
|
123
|
-
- test/test-table-select-weight.rb
|
124
|
-
- test/test-expression-builder.rb
|
125
219
|
- test/test-exception.rb
|
220
|
+
- test/test-expression-builder.rb
|
221
|
+
- test/test-expression.rb
|
222
|
+
- test/test-fix-size-column.rb
|
223
|
+
- test/test-gqtp.rb
|
224
|
+
- test/test-hash.rb
|
225
|
+
- test/test-index-column.rb
|
226
|
+
- test/test-index-cursor.rb
|
227
|
+
- test/test-logger.rb
|
228
|
+
- test/test-pagination.rb
|
229
|
+
- test/test-patricia-trie.rb
|
126
230
|
- test/test-plugin.rb
|
127
|
-
- test/test-schema-view.rb
|
128
231
|
- test/test-procedure.rb
|
232
|
+
- test/test-query.rb
|
233
|
+
- test/test-record.rb
|
234
|
+
- test/test-remote.rb
|
235
|
+
- test/test-schema-create-table.rb
|
236
|
+
- test/test-schema-dumper.rb
|
237
|
+
- test/test-schema-type.rb
|
238
|
+
- test/test-schema-view.rb
|
239
|
+
- test/test-schema.rb
|
129
240
|
- test/test-snippet.rb
|
130
|
-
- test/
|
241
|
+
- test/test-table-cursor.rb
|
242
|
+
- test/test-table-dumper.rb
|
243
|
+
- test/test-table-offset-and-limit.rb
|
244
|
+
- test/test-table-select-mecab.rb
|
245
|
+
- test/test-table-select-normalize.rb
|
246
|
+
- test/test-table-select-weight.rb
|
247
|
+
- test/test-table-select.rb
|
248
|
+
- test/test-table.rb
|
249
|
+
- test/test-type.rb
|
131
250
|
- test/test-variable-size-column.rb
|
132
|
-
- test/test-database-dumper.rb
|
133
|
-
- test/test-pagination.rb
|
134
251
|
- test/test-variable.rb
|
135
|
-
- test/test-version.rb
|
136
|
-
- test/test-table-dumper.rb
|
137
252
|
- test/test-vector-column.rb
|
138
|
-
- test/test-
|
139
|
-
- test/test-hash.rb
|
140
|
-
- test/test-logger.rb
|
253
|
+
- test/test-version.rb
|
141
254
|
- test/test-view.rb
|
142
|
-
- test/test-schema.rb
|
143
|
-
- test/test-accessor.rb
|
144
|
-
- test/test-table-select-mecab.rb
|
145
|
-
- test/test-table-select-normalize.rb
|
146
|
-
- test/test-index-cursor.rb
|
147
|
-
- test/test-fix-size-column.rb
|
148
|
-
- test/test-schema-create-table.rb
|
149
|
-
- test/test-context-select.rb
|
150
|
-
- test/test-expression.rb
|
151
|
-
- test/test-gqtp.rb
|
152
|
-
- test/test-context.rb
|
153
|
-
- test/test-record.rb
|
154
|
-
- test/test-column.rb
|
155
|
-
- test/test-index-column.rb
|
156
|
-
- test/test-patricia-trie.rb
|
157
|
-
has_rdoc: true
|
158
255
|
homepage: http://groonga.rubyforge.org/
|
159
256
|
licenses:
|
160
257
|
- LGPLv2
|
@@ -184,54 +281,54 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
281
|
requirements: []
|
185
282
|
|
186
283
|
rubyforge_project: groonga
|
187
|
-
rubygems_version: 1.
|
284
|
+
rubygems_version: 1.7.2
|
188
285
|
signing_key:
|
189
286
|
specification_version: 3
|
190
287
|
summary: Ruby bindings for groonga that provide full text search and column store features.
|
191
288
|
test_files:
|
192
|
-
- test/test-
|
193
|
-
- test/test-array.rb
|
194
|
-
- test/test-table-offset-and-limit.rb
|
289
|
+
- test/groonga-test-utils.rb
|
195
290
|
- test/run-test.rb
|
196
|
-
- test/test-
|
197
|
-
- test/test-
|
198
|
-
- test/test-
|
199
|
-
- test/test-
|
291
|
+
- test/test-accessor.rb
|
292
|
+
- test/test-array.rb
|
293
|
+
- test/test-column.rb
|
294
|
+
- test/test-context-select.rb
|
295
|
+
- test/test-context.rb
|
296
|
+
- test/test-database-dumper.rb
|
297
|
+
- test/test-database.rb
|
200
298
|
- test/test-encoding.rb
|
201
|
-
- test/test-type.rb
|
202
|
-
- test/test-table.rb
|
203
|
-
- test/test-query.rb
|
204
|
-
- test/test-table-select-weight.rb
|
205
|
-
- test/test-expression-builder.rb
|
206
299
|
- test/test-exception.rb
|
300
|
+
- test/test-expression-builder.rb
|
301
|
+
- test/test-expression.rb
|
302
|
+
- test/test-fix-size-column.rb
|
303
|
+
- test/test-gqtp.rb
|
304
|
+
- test/test-hash.rb
|
305
|
+
- test/test-index-column.rb
|
306
|
+
- test/test-index-cursor.rb
|
307
|
+
- test/test-logger.rb
|
308
|
+
- test/test-pagination.rb
|
309
|
+
- test/test-patricia-trie.rb
|
207
310
|
- test/test-plugin.rb
|
208
|
-
- test/test-schema-view.rb
|
209
311
|
- test/test-procedure.rb
|
312
|
+
- test/test-query.rb
|
313
|
+
- test/test-record.rb
|
314
|
+
- test/test-remote.rb
|
315
|
+
- test/test-schema-create-table.rb
|
316
|
+
- test/test-schema-dumper.rb
|
317
|
+
- test/test-schema-type.rb
|
318
|
+
- test/test-schema-view.rb
|
319
|
+
- test/test-schema.rb
|
210
320
|
- test/test-snippet.rb
|
211
|
-
- test/
|
321
|
+
- test/test-table-cursor.rb
|
322
|
+
- test/test-table-dumper.rb
|
323
|
+
- test/test-table-offset-and-limit.rb
|
324
|
+
- test/test-table-select-mecab.rb
|
325
|
+
- test/test-table-select-normalize.rb
|
326
|
+
- test/test-table-select-weight.rb
|
327
|
+
- test/test-table-select.rb
|
328
|
+
- test/test-table.rb
|
329
|
+
- test/test-type.rb
|
212
330
|
- test/test-variable-size-column.rb
|
213
|
-
- test/test-database-dumper.rb
|
214
|
-
- test/test-pagination.rb
|
215
331
|
- test/test-variable.rb
|
216
|
-
- test/test-version.rb
|
217
|
-
- test/test-table-dumper.rb
|
218
332
|
- test/test-vector-column.rb
|
219
|
-
- test/test-
|
220
|
-
- test/test-hash.rb
|
221
|
-
- test/test-logger.rb
|
333
|
+
- test/test-version.rb
|
222
334
|
- test/test-view.rb
|
223
|
-
- test/test-schema.rb
|
224
|
-
- test/test-accessor.rb
|
225
|
-
- test/test-table-select-mecab.rb
|
226
|
-
- test/test-table-select-normalize.rb
|
227
|
-
- test/test-index-cursor.rb
|
228
|
-
- test/test-fix-size-column.rb
|
229
|
-
- test/test-schema-create-table.rb
|
230
|
-
- test/test-context-select.rb
|
231
|
-
- test/test-expression.rb
|
232
|
-
- test/test-gqtp.rb
|
233
|
-
- test/test-context.rb
|
234
|
-
- test/test-record.rb
|
235
|
-
- test/test-column.rb
|
236
|
-
- test/test-index-column.rb
|
237
|
-
- test/test-patricia-trie.rb
|