rroonga 0.9.2-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. data/AUTHORS +5 -0
  2. data/NEWS.ja.rdoc +114 -0
  3. data/NEWS.rdoc +116 -0
  4. data/README.ja.rdoc +65 -0
  5. data/README.rdoc +66 -0
  6. data/Rakefile +217 -0
  7. data/benchmark/common.rb +49 -0
  8. data/benchmark/read-write-many-small-items.rb +144 -0
  9. data/benchmark/write-many-small-items.rb +135 -0
  10. data/example/bookmark.rb +161 -0
  11. data/example/index-html.rb +89 -0
  12. data/example/search/config.ru +211 -0
  13. data/example/search/public/css/groonga.css +122 -0
  14. data/ext/.gitignore +2 -0
  15. data/ext/libruby-groonga.a +0 -0
  16. data/ext/rb-grn-accessor.c +52 -0
  17. data/ext/rb-grn-array-cursor.c +36 -0
  18. data/ext/rb-grn-array.c +210 -0
  19. data/ext/rb-grn-column.c +573 -0
  20. data/ext/rb-grn-context.c +655 -0
  21. data/ext/rb-grn-database.c +472 -0
  22. data/ext/rb-grn-encoding-support.c +64 -0
  23. data/ext/rb-grn-encoding.c +257 -0
  24. data/ext/rb-grn-exception.c +1110 -0
  25. data/ext/rb-grn-expression-builder.c +75 -0
  26. data/ext/rb-grn-expression.c +735 -0
  27. data/ext/rb-grn-fix-size-column.c +166 -0
  28. data/ext/rb-grn-hash-cursor.c +38 -0
  29. data/ext/rb-grn-hash.c +294 -0
  30. data/ext/rb-grn-index-column.c +488 -0
  31. data/ext/rb-grn-logger.c +504 -0
  32. data/ext/rb-grn-object.c +1369 -0
  33. data/ext/rb-grn-operation.c +198 -0
  34. data/ext/rb-grn-patricia-trie-cursor.c +39 -0
  35. data/ext/rb-grn-patricia-trie.c +488 -0
  36. data/ext/rb-grn-procedure.c +52 -0
  37. data/ext/rb-grn-query.c +260 -0
  38. data/ext/rb-grn-record.c +40 -0
  39. data/ext/rb-grn-snippet.c +334 -0
  40. data/ext/rb-grn-table-cursor-key-support.c +69 -0
  41. data/ext/rb-grn-table-cursor.c +247 -0
  42. data/ext/rb-grn-table-key-support.c +731 -0
  43. data/ext/rb-grn-table.c +2141 -0
  44. data/ext/rb-grn-type.c +181 -0
  45. data/ext/rb-grn-utils.c +769 -0
  46. data/ext/rb-grn-variable-size-column.c +36 -0
  47. data/ext/rb-grn-variable.c +108 -0
  48. data/ext/rb-grn-view-accessor.c +53 -0
  49. data/ext/rb-grn-view-cursor.c +35 -0
  50. data/ext/rb-grn-view-record.c +41 -0
  51. data/ext/rb-grn-view.c +421 -0
  52. data/ext/rb-grn.h +700 -0
  53. data/ext/rb-groonga.c +117 -0
  54. data/extconf.rb +266 -0
  55. data/html/bar.svg +153 -0
  56. data/html/developer.html +117 -0
  57. data/html/developer.svg +469 -0
  58. data/html/download.svg +253 -0
  59. data/html/favicon.ico +0 -0
  60. data/html/favicon.xcf +0 -0
  61. data/html/footer.html.erb +28 -0
  62. data/html/head.html.erb +4 -0
  63. data/html/header.html.erb +17 -0
  64. data/html/index.html +147 -0
  65. data/html/install.svg +636 -0
  66. data/html/logo.xcf +0 -0
  67. data/html/ranguba.css +250 -0
  68. data/html/tutorial.svg +559 -0
  69. data/lib/groonga.rb +90 -0
  70. data/lib/groonga/context.rb +184 -0
  71. data/lib/groonga/expression-builder.rb +285 -0
  72. data/lib/groonga/patricia-trie.rb +53 -0
  73. data/lib/groonga/record.rb +311 -0
  74. data/lib/groonga/schema.rb +1191 -0
  75. data/lib/groonga/view-record.rb +56 -0
  76. data/license/GPL +340 -0
  77. data/license/LGPL +504 -0
  78. data/license/RUBY +59 -0
  79. data/misc/grnop2ruby.rb +49 -0
  80. data/pkg-config.rb +333 -0
  81. data/test-unit/Rakefile +40 -0
  82. data/test-unit/TODO +5 -0
  83. data/test-unit/bin/testrb +5 -0
  84. data/test-unit/html/classic.html +15 -0
  85. data/test-unit/html/index.html +25 -0
  86. data/test-unit/html/index.html.ja +27 -0
  87. data/test-unit/lib/test/unit.rb +323 -0
  88. data/test-unit/lib/test/unit/assertionfailederror.rb +25 -0
  89. data/test-unit/lib/test/unit/assertions.rb +1230 -0
  90. data/test-unit/lib/test/unit/attribute.rb +125 -0
  91. data/test-unit/lib/test/unit/autorunner.rb +360 -0
  92. data/test-unit/lib/test/unit/collector.rb +36 -0
  93. data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
  94. data/test-unit/lib/test/unit/collector/dir.rb +108 -0
  95. data/test-unit/lib/test/unit/collector/load.rb +136 -0
  96. data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
  97. data/test-unit/lib/test/unit/color-scheme.rb +102 -0
  98. data/test-unit/lib/test/unit/color.rb +96 -0
  99. data/test-unit/lib/test/unit/diff.rb +724 -0
  100. data/test-unit/lib/test/unit/error.rb +130 -0
  101. data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
  102. data/test-unit/lib/test/unit/failure.rb +136 -0
  103. data/test-unit/lib/test/unit/fixture.rb +176 -0
  104. data/test-unit/lib/test/unit/notification.rb +129 -0
  105. data/test-unit/lib/test/unit/omission.rb +191 -0
  106. data/test-unit/lib/test/unit/pending.rb +150 -0
  107. data/test-unit/lib/test/unit/priority.rb +180 -0
  108. data/test-unit/lib/test/unit/runner/console.rb +52 -0
  109. data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
  110. data/test-unit/lib/test/unit/runner/tap.rb +8 -0
  111. data/test-unit/lib/test/unit/testcase.rb +476 -0
  112. data/test-unit/lib/test/unit/testresult.rb +89 -0
  113. data/test-unit/lib/test/unit/testsuite.rb +110 -0
  114. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
  115. data/test-unit/lib/test/unit/ui/console/testrunner.rb +466 -0
  116. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +63 -0
  117. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +92 -0
  118. data/test-unit/lib/test/unit/ui/testrunner.rb +28 -0
  119. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
  120. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
  121. data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
  122. data/test-unit/lib/test/unit/util/method-owner-finder.rb +28 -0
  123. data/test-unit/lib/test/unit/util/observable.rb +90 -0
  124. data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
  125. data/test-unit/lib/test/unit/version.rb +7 -0
  126. data/test-unit/sample/adder.rb +13 -0
  127. data/test-unit/sample/subtracter.rb +12 -0
  128. data/test-unit/sample/test_adder.rb +20 -0
  129. data/test-unit/sample/test_subtracter.rb +20 -0
  130. data/test-unit/sample/test_user.rb +23 -0
  131. data/test-unit/test/collector/test-descendant.rb +133 -0
  132. data/test-unit/test/collector/test-load.rb +348 -0
  133. data/test-unit/test/collector/test_dir.rb +406 -0
  134. data/test-unit/test/collector/test_objectspace.rb +100 -0
  135. data/test-unit/test/run-test.rb +15 -0
  136. data/test-unit/test/test-attribute.rb +86 -0
  137. data/test-unit/test/test-color-scheme.rb +67 -0
  138. data/test-unit/test/test-color.rb +47 -0
  139. data/test-unit/test/test-diff.rb +518 -0
  140. data/test-unit/test/test-emacs-runner.rb +60 -0
  141. data/test-unit/test/test-fixture.rb +287 -0
  142. data/test-unit/test/test-notification.rb +33 -0
  143. data/test-unit/test/test-omission.rb +81 -0
  144. data/test-unit/test/test-pending.rb +70 -0
  145. data/test-unit/test/test-priority.rb +119 -0
  146. data/test-unit/test/test-testcase.rb +544 -0
  147. data/test-unit/test/test_assertions.rb +1151 -0
  148. data/test-unit/test/test_error.rb +26 -0
  149. data/test-unit/test/test_failure.rb +33 -0
  150. data/test-unit/test/test_testresult.rb +113 -0
  151. data/test-unit/test/test_testsuite.rb +129 -0
  152. data/test-unit/test/testunit-test-util.rb +14 -0
  153. data/test-unit/test/ui/test_testrunmediator.rb +20 -0
  154. data/test-unit/test/util/test-method-owner-finder.rb +38 -0
  155. data/test-unit/test/util/test_backtracefilter.rb +41 -0
  156. data/test-unit/test/util/test_observable.rb +102 -0
  157. data/test-unit/test/util/test_procwrapper.rb +36 -0
  158. data/test/.gitignore +1 -0
  159. data/test/groonga-test-utils.rb +133 -0
  160. data/test/run-test.rb +58 -0
  161. data/test/test-array.rb +97 -0
  162. data/test/test-column.rb +316 -0
  163. data/test/test-context-select.rb +93 -0
  164. data/test/test-context.rb +73 -0
  165. data/test/test-database.rb +113 -0
  166. data/test/test-encoding.rb +33 -0
  167. data/test/test-exception.rb +93 -0
  168. data/test/test-expression-builder.rb +156 -0
  169. data/test/test-expression.rb +134 -0
  170. data/test/test-fix-size-column.rb +65 -0
  171. data/test/test-gqtp.rb +72 -0
  172. data/test/test-hash.rb +312 -0
  173. data/test/test-index-column.rb +81 -0
  174. data/test/test-logger.rb +37 -0
  175. data/test/test-patricia-trie.rb +189 -0
  176. data/test/test-procedure.rb +37 -0
  177. data/test/test-query.rb +22 -0
  178. data/test/test-record.rb +279 -0
  179. data/test/test-remote.rb +54 -0
  180. data/test/test-schema-view.rb +90 -0
  181. data/test/test-schema.rb +459 -0
  182. data/test/test-snippet.rb +130 -0
  183. data/test/test-table-cursor.rb +153 -0
  184. data/test/test-table-offset-and-limit.rb +102 -0
  185. data/test/test-table-select-normalize.rb +53 -0
  186. data/test/test-table-select.rb +150 -0
  187. data/test/test-table.rb +690 -0
  188. data/test/test-type.rb +71 -0
  189. data/test/test-variable-size-column.rb +98 -0
  190. data/test/test-variable.rb +28 -0
  191. data/test/test-vector-column.rb +76 -0
  192. data/test/test-version.rb +31 -0
  193. data/test/test-view.rb +72 -0
  194. data/text/TUTORIAL.ja.rdoc +392 -0
  195. data/text/expression.rdoc +284 -0
  196. data/vendor/local/bin/grntest.exe +0 -0
  197. data/vendor/local/bin/groonga.exe +0 -0
  198. data/vendor/local/bin/libgroonga.dll +0 -0
  199. data/vendor/local/bin/libmecab.dll +0 -0
  200. data/vendor/local/include/groonga.h +2285 -0
  201. data/vendor/local/lib/libgroonga.lib +0 -0
  202. metadata +280 -0
data/ext/rb-groonga.c ADDED
@@ -0,0 +1,117 @@
1
+ /* -*- c-file-style: "ruby" -*- */
2
+ /*
3
+ Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
4
+
5
+ This library is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU Lesser General Public
7
+ License version 2.1 as published by the Free Software Foundation.
8
+
9
+ This library is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public
15
+ License along with this library; if not, write to the Free Software
16
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+ */
18
+
19
+ #include "rb-grn.h"
20
+
21
+ rb_grn_boolean rb_grn_exited = RB_GRN_FALSE;
22
+ extern grn_ctx grn_gctx;
23
+
24
+ static VALUE
25
+ finish_groonga (VALUE self, VALUE object_id)
26
+ {
27
+ #ifndef WIN32
28
+ grn_ctx *context = grn_gctx.next;
29
+
30
+ debug("finish\n");
31
+ while (context && context != &grn_gctx) {
32
+ rb_grn_context_fin(context);
33
+ context = context->next;
34
+ }
35
+ grn_fin();
36
+ debug("finish: done\n");
37
+ #endif
38
+ rb_grn_exited = RB_GRN_TRUE;
39
+
40
+ return Qnil;
41
+ }
42
+
43
+ void
44
+ Init_groonga (void)
45
+ {
46
+ VALUE mGrn;
47
+ VALUE cGrnBuildVersion, cGrnBindingsVersion;
48
+ VALUE groonga_finalizer, groonga_finalizer_keeper;
49
+
50
+ mGrn = rb_define_module("Groonga");
51
+
52
+ groonga_finalizer = rb_funcall(rb_cObject, rb_intern("new"), 0);
53
+ rb_define_singleton_method(groonga_finalizer, "call", finish_groonga, 1);
54
+ groonga_finalizer_keeper = rb_funcall(rb_cObject, rb_intern("new"), 0);
55
+ rb_funcall(rb_const_get(rb_cObject, rb_intern("ObjectSpace")),
56
+ rb_intern("define_finalizer"),
57
+ 2, groonga_finalizer_keeper, groonga_finalizer);
58
+ rb_iv_set(mGrn, "finalizer", groonga_finalizer_keeper);
59
+
60
+ cGrnBuildVersion = rb_ary_new3(3,
61
+ INT2NUM(GRN_MAJOR_VERSION),
62
+ INT2NUM(GRN_MINOR_VERSION),
63
+ INT2NUM(GRN_MICRO_VERSION));
64
+ rb_obj_freeze(cGrnBuildVersion);
65
+ /*
66
+ * ビルドしたgroongaのバージョン。<tt>[メジャーバージョン,
67
+ * マイナーバージョン, マイクロバージョン]</tt>の配列。
68
+ */
69
+ rb_define_const(mGrn, "BUILD_VERSION", cGrnBuildVersion);
70
+
71
+ /* FIXME: API to get runtime groonga version doesn't exist */
72
+
73
+ /*
74
+ * 利用しているgroongaのバージョン(にしたい。現在は
75
+ * BUILD_VERSIONと同じ)。<tt>[メジャーバージョ
76
+ * ン, マイナーバージョン, マイクロバージョン]</tt>の配列。
77
+ */
78
+ rb_define_const(mGrn, "VERSION", cGrnBuildVersion);
79
+
80
+ cGrnBindingsVersion = rb_ary_new3(3,
81
+ INT2NUM(RB_GRN_MAJOR_VERSION),
82
+ INT2NUM(RB_GRN_MINOR_VERSION),
83
+ INT2NUM(RB_GRN_MICRO_VERSION));
84
+ rb_obj_freeze(cGrnBindingsVersion);
85
+ /*
86
+ * Ruby/groongaのバージョン。<tt>[メジャーバージョン, マ
87
+ * イナーバージョン, マイクロバージョン]</tt>の配列。
88
+ */
89
+ rb_define_const(mGrn, "BINDINGS_VERSION", cGrnBindingsVersion);
90
+
91
+ rb_grn_init_exception(mGrn);
92
+
93
+ rb_grn_rc_check(grn_init(), Qnil);
94
+
95
+ rb_grn_init_utils(mGrn);
96
+ rb_grn_init_encoding(mGrn);
97
+ rb_grn_init_encoding_support(mGrn);
98
+ rb_grn_init_context(mGrn);
99
+ rb_grn_init_object(mGrn);
100
+ rb_grn_init_database(mGrn);
101
+ rb_grn_init_table(mGrn);
102
+ rb_grn_init_table_cursor(mGrn);
103
+ rb_grn_init_type(mGrn);
104
+ rb_grn_init_procedure(mGrn);
105
+ rb_grn_init_column(mGrn);
106
+ rb_grn_init_accessor(mGrn);
107
+ rb_grn_init_view_accessor(mGrn);
108
+ rb_grn_init_record(mGrn);
109
+ rb_grn_init_view_record(mGrn);
110
+ rb_grn_init_query(mGrn);
111
+ rb_grn_init_variable(mGrn);
112
+ rb_grn_init_operation(mGrn);
113
+ rb_grn_init_expression(mGrn);
114
+ rb_grn_init_expression_builder(mGrn);
115
+ rb_grn_init_logger(mGrn);
116
+ rb_grn_init_snippet(mGrn);
117
+ }
data/extconf.rb ADDED
@@ -0,0 +1,266 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License version 2.1 as published by the Free Software Foundation.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+
18
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
19
+
20
+ require 'English'
21
+ require 'mkmf'
22
+ require 'pkg-config'
23
+ require 'fileutils'
24
+ require 'shellwords'
25
+
26
+ package_name = "groonga"
27
+ module_name = "groonga"
28
+ ext_dir_name = "ext"
29
+ src_dir = File.join(File.expand_path(File.dirname(__FILE__)), ext_dir_name)
30
+ major, minor, micro = 0, 1, 8
31
+ win32 = false
32
+ wine = false
33
+
34
+ def local_groonga_base_dir
35
+ File.join(File.dirname(__FILE__), "vendor")
36
+ end
37
+
38
+ def local_groonga_install_dir
39
+ File.expand_path(File.join(local_groonga_base_dir, "local"))
40
+ end
41
+
42
+ def have_local_groonga?(package_name, major, minor, micro)
43
+ return false unless File.exist?(File.join(local_groonga_install_dir, "lib"))
44
+
45
+ prepend_pkg_config_path_for_local_groonga
46
+ PKGConfig.have_package(package_name, major, minor, micro)
47
+ end
48
+
49
+ def prepend_pkg_config_path_for_local_groonga
50
+ pkg_config_dir = File.join(local_groonga_install_dir, "lib", "pkgconfig")
51
+ PackageConfig.prepend_default_path(pkg_config_dir)
52
+
53
+ lib_dir = File.join(local_groonga_install_dir, "lib")
54
+ original_LDFLAGS = $LDFLAGS
55
+ checking_for(checking_message("-Wl,-rpath is available")) do
56
+ $LDFLAGS += " -Wl,-rpath,#{Shellwords.escape(lib_dir)}"
57
+ available = try_compile("int main() {return 0;}")
58
+ $LDFLAGS = original_LDFLAGS unless available
59
+ available
60
+ end
61
+ end
62
+
63
+ def install_groonga_locally(major, minor, micro)
64
+ require 'open-uri'
65
+ require 'shellwords'
66
+
67
+ tar_gz = "groonga-#{major}.#{minor}.#{micro}.tar.gz"
68
+ FileUtils.mkdir_p(local_groonga_base_dir)
69
+
70
+ install_dir = local_groonga_install_dir
71
+ Dir.chdir(local_groonga_base_dir) do
72
+ url = "http://groonga.org/files/groonga/#{tar_gz}"
73
+ message("downloading %s...", url)
74
+ open(url, "rb") do |input|
75
+ File.open(tar_gz, "wb") do |output|
76
+ while (buffer = input.read(1024))
77
+ output.print(buffer)
78
+ end
79
+ end
80
+ end
81
+ message(" done\n")
82
+
83
+ message("extracting...")
84
+ if xsystem("tar xfz #{tar_gz}")
85
+ message(" done\n")
86
+ else
87
+ message(" failed\n")
88
+ exit 1
89
+ end
90
+
91
+ groonga_source_dir = "groonga-#{major}.#{minor}.#{micro}"
92
+ Dir.chdir(groonga_source_dir) do
93
+ message("configuring...")
94
+ prefix = Shellwords.escape(install_dir)
95
+ if xsystem("./configure CFLAGS='-g -O0' --prefix=#{prefix}")
96
+ message(" done\n")
97
+ else
98
+ message(" failed\n")
99
+ exit 1
100
+ end
101
+
102
+ message("building (maybe long time)...")
103
+ if xsystem("make")
104
+ message(" done\n")
105
+ else
106
+ message(" failed\n")
107
+ exit 1
108
+ end
109
+
110
+ message("installing...")
111
+ if [major, minor, micro] == [0, 1, 6]
112
+ make_install_args = " MKDIR_P='mkdir -p --'"
113
+ else
114
+ make_install_args = ""
115
+ end
116
+ if xsystem("make install#{make_install_args}")
117
+ message(" done\n")
118
+ else
119
+ message(" failed\n")
120
+ exit 1
121
+ end
122
+ end
123
+ end
124
+
125
+ prepend_pkg_config_path_for_local_groonga
126
+ end
127
+
128
+ def check_win32
129
+ checking_for(checking_message("Win32 OS")) do
130
+ win32 = /cygwin|mingw|mswin32/ =~ RUBY_PLATFORM
131
+ $defs << "-DRB_GRN_PLATFORM_WIN32" if win32
132
+ win32
133
+ end
134
+ end
135
+
136
+ def set_output_lib(module_name, directory)
137
+ case RUBY_PLATFORM
138
+ when /cygwin|mingw/
139
+ filename = File.join(*([directory, "libruby-#{module_name}.a"].compact))
140
+ $DLDFLAGS << " -Wl,--out-implib=#{filename}"
141
+ $cleanfiles << filename
142
+ end
143
+ end
144
+
145
+ win32 = check_win32
146
+ if win32
147
+ $CFLAGS += " -I#{local_groonga_install_dir}/include"
148
+ $libs += " #{local_groonga_install_dir}/lib/libgroonga.lib"
149
+
150
+ set_output_lib(module_name, ext_dir_name)
151
+
152
+ real_major, real_minor, real_micro = major, minor, micro
153
+
154
+ checking_for(checking_message("Wine")) do
155
+ wine = with_config("wine")
156
+ end
157
+ else
158
+ checking_for(checking_message("GCC")) do
159
+ if macro_defined?("__GNUC__", "")
160
+ $CFLAGS += ' -Wall'
161
+ true
162
+ else
163
+ false
164
+ end
165
+ end
166
+
167
+ unless PKGConfig.have_package(package_name, major, minor, micro)
168
+ unless have_local_groonga?(package_name, major, minor, micro)
169
+ install_groonga_locally(major, minor, micro)
170
+ PKGConfig.have_package(package_name, major, minor, micro) or exit 1
171
+ end
172
+ end
173
+
174
+ real_version = PKGConfig.modversion(package_name)
175
+ real_major, real_minor, real_micro = real_version.split(/\./)
176
+ end
177
+
178
+ $defs << "-DRB_GRN_COMPILATION"
179
+
180
+ $defs << "-DGRN_MAJOR_VERSION=#{real_major}"
181
+ $defs << "-DGRN_MINOR_VERSION=#{real_minor}"
182
+ $defs << "-DGRN_MICRO_VERSION=#{real_micro}"
183
+
184
+ unless wine
185
+ have_header("ruby/st.h") unless have_macro("HAVE_RUBY_ST_H", "ruby.h")
186
+ have_func("rb_errinfo", "ruby.h")
187
+ have_type("enum ruby_value_type", "ruby.h")
188
+ end
189
+
190
+ checking_for(checking_message("debug flag")) do
191
+ debug = with_config("debug")
192
+ if debug
193
+ debug_flag = "-DRB_GRN_DEBUG"
194
+ $defs << debug_flag unless $defs.include?(debug_flag)
195
+ end
196
+ debug
197
+ end
198
+
199
+ $INSTALLFILES ||= []
200
+ $INSTALLFILES << ["../lib/**/*.rb", "$(RUBYLIBDIR)", "../lib"]
201
+
202
+ create_makefile(module_name, src_dir)
203
+
204
+ makefile = File.read("Makefile")
205
+ File.open("Makefile", "w") do |f|
206
+ objs = []
207
+ co = nil
208
+ dllib = nil
209
+ makefile.each_line do |line|
210
+ if wine
211
+ line.gsub!(/\s+gcc\b/, " i586-mingw32msvc-gcc")
212
+ line.gsub!(/C:/, "$(HOME)/.wine/drive_c")
213
+ line.gsub!(/Z:/, "")
214
+ end
215
+
216
+ case line
217
+ when /^DLLIB\s*=\s*/
218
+ raw_dllib = $POSTMATCH
219
+ dllib = raw_dllib.chomp
220
+ f.puts("DLLIB = #{ext_dir_name}/#{raw_dllib}")
221
+ f.puts("IMPLIB = #{ext_dir_name}/libruby-#{dllib.gsub(/\..+?$/, '.lib')}")
222
+ when /^(SRCS)\s*=\s*/
223
+ name = $1
224
+ vars = $POSTMATCH.split.collect {|var| "$(srcdir)/#{var}"}.join(" ")
225
+ f.puts("#{name} = #{vars}")
226
+ when /^(OBJS|CLEANLIBS|CLEANOBJS)\s*=\s*/
227
+ name = $1
228
+ vars = $POSTMATCH.split.collect {|var| "#{ext_dir_name}/#{var}"}
229
+ objs = vars if name == "OBJS"
230
+ vars = vars.join(" ")
231
+ f.puts("#{name} = #{vars}")
232
+ when /^\t\$\(CC\)/
233
+ if PKGConfig.msvc?
234
+ output_option = "-Fo"
235
+ else
236
+ output_option = "-o"
237
+ end
238
+ unless /#{Regexp.escape(output_option)}/ =~ line
239
+ line = "#{line.chomp} #{output_option}$@"
240
+ end
241
+ co = line
242
+ f.puts(line)
243
+ else
244
+ if dllib
245
+ line = line.gsub(/\$\(RUBYARCHDIR\)\/\$\(DLLIB\)/,
246
+ "$(RUBYARCHDIR)/#{dllib}")
247
+ end
248
+ f.puts(line)
249
+ end
250
+ end
251
+
252
+ if co and !objs.empty?
253
+ f.puts
254
+ if PKGConfig.msvc?
255
+ f.puts "{$(srcdir)}.c{#{ext_dir_name}}.obj:"
256
+ f.puts co
257
+ else
258
+ objs.each do |obj|
259
+ f.puts "#{obj}: $(srcdir)/#{File.basename(obj).sub(/\..+?$/, '.c')}"
260
+ f.puts co
261
+ end
262
+ end
263
+ end
264
+ end
265
+
266
+ FileUtils.mkdir_p(ext_dir_name)
data/html/bar.svg ADDED
@@ -0,0 +1,153 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+ <svg
4
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
5
+ xmlns:cc="http://creativecommons.org/ns#"
6
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
7
+ xmlns:svg="http://www.w3.org/2000/svg"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlns:xlink="http://www.w3.org/1999/xlink"
10
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ width="22.25"
13
+ height="48"
14
+ id="svg10194"
15
+ sodipodi:version="0.32"
16
+ inkscape:version="0.46"
17
+ version="1.0"
18
+ sodipodi:docname="bar.svg"
19
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
20
+ inkscape:export-filename="/home/kou/work/c/milter-manager/html/bar.png"
21
+ inkscape:export-xdpi="72"
22
+ inkscape:export-ydpi="72">
23
+ <defs
24
+ id="defs10196">
25
+ <filter
26
+ inkscape:collect="always"
27
+ id="filter10190"
28
+ x="-0.0042679603"
29
+ width="1.0085359"
30
+ y="-0.26376387"
31
+ height="1.5275277">
32
+ <feGaussianBlur
33
+ inkscape:collect="always"
34
+ stdDeviation="1.331093"
35
+ id="feGaussianBlur10192" />
36
+ </filter>
37
+ <linearGradient
38
+ id="linearGradient10136"
39
+ inkscape:collect="always">
40
+ <stop
41
+ id="stop10138"
42
+ offset="0"
43
+ style="stop-color:#f57900;stop-opacity:1;" />
44
+ <stop
45
+ id="stop10140"
46
+ offset="1"
47
+ style="stop-color:#fcaf3e;stop-opacity:1" />
48
+ </linearGradient>
49
+ <linearGradient
50
+ inkscape:collect="always"
51
+ xlink:href="#linearGradient10136"
52
+ id="linearGradient10134"
53
+ x1="316.17773"
54
+ y1="89.416435"
55
+ x2="316.17773"
56
+ y2="82.569916"
57
+ gradientUnits="userSpaceOnUse"
58
+ gradientTransform="matrix(3e-2,0,0,3,358.91588,-160.60243)" />
59
+ <linearGradient
60
+ id="linearGradient10152"
61
+ inkscape:collect="always">
62
+ <stop
63
+ id="stop10154"
64
+ offset="0"
65
+ style="stop-color:#ffffff;stop-opacity:1;" />
66
+ <stop
67
+ id="stop10156"
68
+ offset="1"
69
+ style="stop-color:#ffffff;stop-opacity:0;" />
70
+ </linearGradient>
71
+ <inkscape:perspective
72
+ sodipodi:type="inkscape:persp3d"
73
+ inkscape:vp_x="0 : 526.18109 : 1"
74
+ inkscape:vp_y="0 : 1000 : 0"
75
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
76
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
77
+ id="perspective10202" />
78
+ <linearGradient
79
+ inkscape:collect="always"
80
+ xlink:href="#linearGradient10152"
81
+ id="linearGradient10230"
82
+ gradientUnits="userSpaceOnUse"
83
+ gradientTransform="matrix(3.0006411e-2,0,0,2.7421563,358.91357,-137.86823)"
84
+ x1="306.39508"
85
+ y1="83.499619"
86
+ x2="306.39508"
87
+ y2="97.729294" />
88
+ </defs>
89
+ <sodipodi:namedview
90
+ id="base"
91
+ pagecolor="#ffffff"
92
+ bordercolor="#666666"
93
+ borderopacity="1.0"
94
+ gridtolerance="10000"
95
+ guidetolerance="10"
96
+ objecttolerance="10"
97
+ inkscape:pageopacity="0.0"
98
+ inkscape:pageshadow="2"
99
+ inkscape:zoom="3.959798"
100
+ inkscape:cx="56.513145"
101
+ inkscape:cy="10.662903"
102
+ inkscape:document-units="px"
103
+ inkscape:current-layer="layer1"
104
+ showgrid="false"
105
+ inkscape:window-width="843"
106
+ inkscape:window-height="650"
107
+ inkscape:window-x="137"
108
+ inkscape:window-y="138" />
109
+ <metadata
110
+ id="metadata10199">
111
+ <rdf:RDF>
112
+ <cc:Work
113
+ rdf:about="">
114
+ <dc:format>image/svg+xml</dc:format>
115
+ <dc:type
116
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
117
+ </cc:Work>
118
+ </rdf:RDF>
119
+ </metadata>
120
+ <g
121
+ inkscape:label="Layer 1"
122
+ inkscape:groupmode="layer"
123
+ id="layer1"
124
+ transform="translate(-358.96534,-80.494781)">
125
+ <rect
126
+ y="87.256226"
127
+ x="-2.3278677"
128
+ height="11.111678"
129
+ width="747.51288"
130
+ id="rect10160"
131
+ style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter10190);enable-background:accumulate"
132
+ transform="matrix(3e-2,0,0,3,358.98571,-173.62413)" />
133
+ <rect
134
+ style="opacity:1;fill:url(#linearGradient10134);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
135
+ id="rect9356"
136
+ width="22.425388"
137
+ height="33.335033"
138
+ x="358.91583"
139
+ y="87.244781"
140
+ inkscape:export-xdpi="72"
141
+ inkscape:export-ydpi="72" />
142
+ <path
143
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ce5c00;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
144
+ d="M 358.91586,87.244781 L 381.34125,87.244781 M 381.34125,120.57982 L 358.91586,120.57982"
145
+ id="rect10220"
146
+ sodipodi:nodetypes="cccc" />
147
+ <path
148
+ style="opacity:0.33734945;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient10230);stroke-width:1.49652982;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
149
+ d="M 381.34378,119.14706 L 358.9136,119.14706 M 358.9136,88.677084 L 381.34378,88.677084"
150
+ id="rect10224"
151
+ sodipodi:nodetypes="cccc" />
152
+ </g>
153
+ </svg>