grnplum 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ ACLOCAL_AMFLAGS = -I m4
2
+
3
+ SUBDIRS = \
4
+ <%= config[:plugin_name] %> \
5
+ test
@@ -0,0 +1,64 @@
1
+ # groonga-plugin-<%= config[:plugin_name] %>
2
+
3
+ TODO: Write description.
4
+
5
+ ## Prepare
6
+
7
+ ```sh
8
+ $ git clone git@github.com:[USERNAME]/groonga-plugin-<%= config[:plugin_name] %>.git
9
+ $ cd groonga-plugin-<%= config[:plugin_name] %>
10
+ $ ./autogen.sh
11
+ ```
12
+
13
+ ## Build
14
+
15
+ Groonga is installed in `/usr/local`:
16
+
17
+ ```sh
18
+ $ ./configure
19
+ $ make
20
+ ```
21
+
22
+ Groonga is installed in other directory (e.g.: `/tmp/local`):
23
+
24
+ ```sh
25
+ $ ./configure --prefix=/tmp/local
26
+ $ make
27
+ ```
28
+
29
+ ## Test
30
+
31
+ Using [grntest](https://github.com/groonga/grntest).
32
+
33
+ ```sh
34
+ $ test/run-test.sh
35
+ ```
36
+
37
+ ## Install
38
+
39
+ For system directory (e.g.: `/usr/local`):
40
+
41
+ ```sh
42
+ $ sudo make install
43
+ ```
44
+
45
+ For user directory (e.g.: `/tmp/local`):
46
+
47
+ ```sh
48
+ $ make install
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ TODO: Write usage.
54
+
55
+ ## Development
56
+
57
+ ### Add test
58
+
59
+ ```sh
60
+ $ vi test/suite/new_test.test
61
+ $ test/run-test.sh
62
+ $ cat test/suite/new_test.actual # Confirm result
63
+ $ mv test/suite/new_test.{actual,expected} # Rename confirmed test
64
+ ```
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+
3
+ mkdir -p m4
4
+ autoreconf -i
@@ -0,0 +1,69 @@
1
+ AC_PREREQ(2.59)
2
+ AC_INIT([groonga-plugin-<%= config[:plugin_name] %>], 0.0.1, [<%= config[:email] %>])
3
+
4
+ AC_CONFIG_MACRO_DIR([m4])
5
+ AC_CONFIG_SRCDIR([<%= config[:plugin_name] %>/<%= config[:plugin_name] %>.c])
6
+ AM_CONFIG_HEADER([config.h])
7
+
8
+ AM_INIT_AUTOMAKE(foreign)
9
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
+
11
+ AC_PROG_CXX
12
+
13
+ AC_PROG_LIBTOOL
14
+
15
+ if test "$GCC" = "yes"; then
16
+ CFLAGS="$CFLAGS -Wall -Wextra"
17
+ CFLAGS="$CFLAGS -Wmissing-declarations -Wmissing-prototypes"
18
+ fi
19
+
20
+ AC_ARG_ENABLE(debug,
21
+ [AS_HELP_STRING([--enable-debug],
22
+ [use debug flags (default=no)])],
23
+ [sample_debug="$enableval"],
24
+ [sample_debug="no"])
25
+ if test "x$sample_debug" != "xno"; then
26
+ if test "$CLANG" = "yes"; then
27
+ CFLAGS="$CFLAGS -O0 -g"
28
+ elif test "$GCC" = "yes"; then
29
+ CFLAGS="$CFLAGS -O0 -g3"
30
+ fi
31
+ fi
32
+
33
+ GROONGA_REQUIRED_VERSION=2.0.9
34
+ PKG_CHECK_MODULES([GROONGA], [groonga >= ${GROONGA_REQUIRED_VERSION}])
35
+
36
+ _PKG_CONFIG(GROONGA_PLUGINS_DIR, [variable=pluginsdir], [groonga])
37
+ _PKG_CONFIG(GROONGA, [variable=groonga], [groonga])
38
+ _PKG_CONFIG(GROONGA_HTTPD, [variable=groonga_httpd], [groonga])
39
+
40
+ GROONGA_PLUGINS_DIR="${pkg_cv_GROONGA_PLUGINS_DIR}"
41
+ GROONGA="${pkg_cv_GROONGA}"
42
+ GROONGA_HTTPD="${pkg_cv_GROONGA_HTTPD}"
43
+
44
+ AC_SUBST(GROONGA_PLUGINS_DIR)
45
+ AC_SUBST(GROONGA)
46
+ AC_SUBST(GROONGA_HTTPD)
47
+
48
+ <%= config[:plugin_name] %>_pluginsdir="\${GROONGA_PLUGINS_DIR}/<%= config[:plugin_name] %>"
49
+ AC_SUBST(<%= config[:plugin_name] %>_pluginsdir)
50
+
51
+ AC_CONFIG_FILES([
52
+ Makefile
53
+ <%= config[:plugin_name] %>/Makefile
54
+ test/Makefile
55
+ ])
56
+
57
+ AC_OUTPUT
58
+
59
+ echo "$PACKAGE_NAME $PACKAGE_VERSION configuration:"
60
+ echo "-----------------------"
61
+ echo " Compiler: ${CC}"
62
+ echo " CFLAGS: ${CFLAGS}"
63
+ echo " CXXFLAGS: ${CXXFLAGS}"
64
+ echo " Libraries: ${LIBS}"
65
+ echo
66
+ echo "groonga-<%= config[:plugin_name] %>"
67
+ echo " CFLAGS: ${GROONGA_CFLAGS}"
68
+ echo " Libraries: ${GROONGA_LIBS}"
69
+ echo " install directory: ${<%= config[:plugin_name] %>_pluginsdir}"
@@ -0,0 +1,14 @@
1
+ AM_CFLAGS = \
2
+ $(GROONGA_CFLAGS)
3
+
4
+ AM_LDFLAGS = \
5
+ -avoid-version \
6
+ -module \
7
+ -no-undefined
8
+
9
+ LIBS = \
10
+ $(GROONGA_LIBS)
11
+
12
+ <%= config[:plugin_name] %>_plugins_LTLIBRARIES = <%= config[:plugin_name] %>.la
13
+
14
+ include sources.am
@@ -0,0 +1,47 @@
1
+ /*
2
+ Copyright(C) <%= Time.now.year %> <%= config[:author] %> <<%= config[:email] %>>
3
+
4
+ This library is free software; you can redistribute it and/or
5
+ modify it under the terms of the GNU Lesser General Public
6
+ License version 2.1 as published by the Free Software Foundation.
7
+
8
+ This library is distributed in the hope that it will be useful,
9
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ Lesser General Public License for more details.
12
+
13
+ You should have received a copy of the GNU Lesser General Public
14
+ License along with this library; if not, write to the Free Software
15
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+ */
17
+
18
+ #include <groonga/plugin.h>
19
+
20
+ static grn_obj *
21
+ command_<%= config[:plugin_name] %>(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
22
+ {
23
+ grn_ctx_output_bool(ctx, GRN_FALSE);
24
+ return NULL;
25
+ }
26
+
27
+ grn_rc
28
+ GRN_PLUGIN_INIT(grn_ctx *ctx)
29
+ {
30
+ return GRN_SUCCESS;
31
+ }
32
+
33
+ grn_rc
34
+ GRN_PLUGIN_REGISTER(grn_ctx *ctx)
35
+ {
36
+ grn_expr_var vars[0];
37
+
38
+ grn_plugin_command_create(ctx, "<%= config[:plugin_name] %>", -1, command_<%= config[:plugin_name] %>, 0, vars);
39
+
40
+ return ctx->rc;
41
+ }
42
+
43
+ grn_rc
44
+ GRN_PLUGIN_FIN(grn_ctx *ctx)
45
+ {
46
+ return GRN_SUCCESS;
47
+ }
@@ -0,0 +1,2 @@
1
+ <%= config[:plugin_name] %>_la_SOURCES = \
2
+ <%= config[:plugin_name] %>.c
@@ -0,0 +1,104 @@
1
+ #!/bin/bash
2
+
3
+ export BASE_DIR="`dirname $0`"
4
+ if test -z "$BUILD_DIR"; then
5
+ BUILD_DIR="$BASE_DIR"
6
+ fi
7
+ export BUILD_DIR
8
+
9
+ top_dir="$BUILD_DIR/.."
10
+ top_dir=$(cd -P "$top_dir" 2>/dev/null || cd "$top_dir"; pwd)
11
+
12
+ n_processors=1
13
+ case `uname` in
14
+ Linux)
15
+ n_processors="$(grep '^processor' /proc/cpuinfo | wc -l)"
16
+ ;;
17
+ Darwin)
18
+ n_processors="$(/usr/sbin/sysctl -n hw.ncpu)"
19
+ ;;
20
+ *)
21
+ :
22
+ ;;
23
+ esac
24
+
25
+ if test x"$NO_MAKE" != x"yes"; then
26
+ MAKE_ARGS=
27
+ if test $n_processors -gt 1; then
28
+ MAKE_ARGS="${MAKE_ARGS} -j${n_processors}"
29
+ fi
30
+ make -C $top_dir ${MAKE_ARGS} > /dev/null || exit 1
31
+ fi
32
+
33
+ if test -z "$GROONGA"; then
34
+ GROONGA="groonga"
35
+ fi
36
+ export GROONGA
37
+
38
+ GRN_PLUGINS_DIR="$top_dir"
39
+ export GRN_PLUGINS_DIR
40
+
41
+ case `uname` in
42
+ Darwin)
43
+ DYLD_LIBRARY_PATH="$top_dir/lib/.libs:$DYLD_LIBRARY_PATH"
44
+ export DYLD_LIBRARY_PATH
45
+ ;;
46
+ *)
47
+ :
48
+ ;;
49
+ esac
50
+
51
+ if ! type grntest > /dev/null; then
52
+ ruby -S gem install grntest
53
+ fi
54
+
55
+ have_targets="false"
56
+ use_gdb="false"
57
+ next_argument_is_long_option_value="false"
58
+ for argument in "$@"; do
59
+ case "$argument" in
60
+ --*=*)
61
+ ;;
62
+ --keep-database|--no-*|--version|--help)
63
+ # no argument options
64
+ ;;
65
+ --gdb)
66
+ # no argument options
67
+ use_gdb="true"
68
+ ;;
69
+ --*)
70
+ next_argument_is_long_option_value="true"
71
+ continue
72
+ ;;
73
+ -*)
74
+ ;;
75
+ *)
76
+ if test "$next_argument_is_long_option_value" != "true"; then
77
+ have_targets="true"
78
+ fi
79
+ ;;
80
+ esac
81
+ next_argument_is_long_option_value="false"
82
+ done
83
+
84
+ grntest_options=("$@")
85
+ if test "$use_gdb" != "true"; then
86
+ grntest_options=("--n-workers" "${n_processors}" "${grntest_options[@]}")
87
+ fi
88
+ if test "$CI" = "true"; then
89
+ grntest_options=("--reporter" "mark" "${grntest_options[@]}")
90
+ fi
91
+ if test "$have_targets" != "true"; then
92
+ grntest_options=("${grntest_options[@]}" "${BASE_DIR}/suite")
93
+ fi
94
+
95
+ tmpfs=/run/shm
96
+ if test -d $tmpfs -a -w $tmpfs; then
97
+ rm -rf "tmp"
98
+ ln -s $tmpfs "tmp"
99
+ fi
100
+
101
+ grntest \
102
+ --groonga "$GROONGA" \
103
+ --base-directory "$BASE_DIR" \
104
+ "${grntest_options[@]}"
@@ -0,0 +1,2 @@
1
+ plugin_register <%= config[:plugin_name] %>/<%= config[:plugin_name] %>
2
+ [[0,0.0,0.0],true]
@@ -0,0 +1 @@
1
+ plugin_register <%= config[:plugin_name] %>/<%= config[:plugin_name] %>
@@ -0,0 +1,3 @@
1
+ module Grnplum
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: grnplum
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Masafumi Yokoyama
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-12-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: test-unit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: A Groonga plugin manager.
70
+ email:
71
+ - myokoym@gmail.com
72
+ executables:
73
+ - grnplum
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".travis.yml"
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
85
+ - exe/grnplum
86
+ - grnplum.gemspec
87
+ - lib/grnplum.rb
88
+ - lib/grnplum/command.rb
89
+ - lib/grnplum/generator.rb
90
+ - lib/grnplum/generator/c.rb
91
+ - lib/grnplum/generator/templates/c/.gitignore
92
+ - lib/grnplum/generator/templates/c/LICENSE
93
+ - lib/grnplum/generator/templates/c/Makefile.am.tt
94
+ - lib/grnplum/generator/templates/c/README.md.tt
95
+ - lib/grnplum/generator/templates/c/autogen.sh
96
+ - lib/grnplum/generator/templates/c/configure.ac.tt
97
+ - lib/grnplum/generator/templates/c/plugin_name/Makefile.am.tt
98
+ - lib/grnplum/generator/templates/c/plugin_name/plugin_name.c.tt
99
+ - lib/grnplum/generator/templates/c/plugin_name/sources.am.tt
100
+ - lib/grnplum/generator/templates/c/test/Makefile.am
101
+ - lib/grnplum/generator/templates/c/test/run-test.sh
102
+ - lib/grnplum/generator/templates/c/test/suite/register.expected.tt
103
+ - lib/grnplum/generator/templates/c/test/suite/register.test.tt
104
+ - lib/grnplum/version.rb
105
+ homepage: https://github.com/myokoym/grnplum
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 2.5.0
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: A Groonga plugin manager.
129
+ test_files: []
130
+ has_rdoc: