Kouhei Sutou
null+****@clear*****
Mon Jun 26 00:00:29 JST 2017
Kouhei Sutou 2017-06-26 00:00:29 +0900 (Mon, 26 Jun 2017) New Revision: f75308722265c9690f32de15438f4d4d0890c919 https://github.com/pgroonga/pgroonga.github.io/commit/f75308722265c9690f32de15438f4d4d0890c919 Message: Add how to develop PGroonga Added files: _po/ja/development/index.po development/index.md ja/development/index.md Modified files: _config.yml _includes/navbar-content.en.html _includes/navbar-content.ja.html _po/ja/index.po index.md ja/index.md Modified: _config.yml (+2 -0) =================================================================== --- _config.yml 2017-06-20 20:57:22 +0900 (331eaef) +++ _config.yml 2017-06-26 00:00:29 +0900 (3c497e9) @@ -13,6 +13,8 @@ windows_postgresql_versions: - 9.6.2-3 freebsd_postgresql_version: 96 centos_groonga_release_version: 1.3.0-1 +#development_postgresql_version: 10beta1 +development_postgresql_version: 9.6.3 exclude: - "Rakefile" - "Gemfile" Modified: _includes/navbar-content.en.html (+1 -0) =================================================================== --- _includes/navbar-content.en.html 2017-06-20 20:57:22 +0900 (94d7981) +++ _includes/navbar-content.en.html 2017-06-26 00:00:29 +0900 (0d65194) @@ -30,6 +30,7 @@ <li><a href="/tutorial/">Tutorial</a></li> <li><a href="/how-to/">How to</a></li> <li><a href="/reference/">Reference manual</a></li> + <li><a href="/development/">Development</a></li> </ul> </li> <li><a href="/community/">Community</a></li> Modified: _includes/navbar-content.ja.html (+1 -0) =================================================================== --- _includes/navbar-content.ja.html 2017-06-20 20:57:22 +0900 (a4167d2) +++ _includes/navbar-content.ja.html 2017-06-26 00:00:29 +0900 (72e8577) @@ -30,6 +30,7 @@ <li><a href="/ja/tutorial/">チュートリアル</a></li> <li><a href="/ja/how-to/">ハウツー</a></li> <li><a href="/ja/reference/">リファレンスマニュアル</a></li> + <li><a href="/ja/development/">開発</a></li> </ul> </li> <li><a href="/ja/community/">コミュニティー</a></li> Added: _po/ja/development/index.po (+236 -0) 100644 =================================================================== --- /dev/null +++ _po/ja/development/index.po 2017-06-26 00:00:29 +0900 (6bd119d) @@ -0,0 +1,236 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2017-06-25 23:58+0900\n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +msgid "" +"---\n" +"title: Development\n" +"---" +msgstr "" +"---\n" +"title: 開発\n" +"---" + +msgid "# Development" +msgstr "# 開発" + +msgid "This document describes how to develop PGroonga." +msgstr "このドキュメントではPGroongaの開発方法を説明します。" + +msgid "## Build" +msgstr "## ビルド" + +msgid "" +"It's recommended that you build both PostgreSQL and PGroonga with debug option" +"s." +msgstr "PostgreSQLもPGroonaもどちらもデバッグオプション付きでビルドすることをオススメします。" + +msgid "" +"It's better that you [build Groonga][groonga-build] with debug options (Groong" +"a's `configure` provides `--enable-debug` option) too. If you use [packaged Gr" +"oonga][groonga-install], you need to install development package. It's `libgro" +"onga-dev` for Debian family distribution and `groonga-devel` for Red Hat famil" +"y distribution." +msgstr "" +"Groongaもデバッグオプション(Groongaの`configure`には`--enable-debug`オプションがある)で[ビルド][groonga" +"-build]した方が便利なことが多いです。[Groongaのパッケージ][groonga-install]を使う場合は、開発用パッケージをインストールする" +"必要があります。Debian系のディストリビューションでは`libgroonga-dev`で、Red Hat系のディストリビューションでは`groonga-" +"devel`です。" + +msgid "### How to build PostgreSQL" +msgstr "### PostgreSQLのビルド方法" + +msgid "" +"Download source from [the PostgreSQL site][postgresql-source-download]. Here a" +"re command lines to download the source of PostgreSQL {{ site.development_post" +"gresql_version }} and extract it:" +msgstr "" +"[PostgreSQLのサイト][postgresql-source-download]からソースをダウンロードします。以下はPostgreSQL {{ s" +"ite.development_postgresql_version }}のソースをダウンロードして展開するコマンドラインです。" + +msgid "" +"```console\n" +"% wget https://ftp.postgresql.org/pub/source/v{{ site.development_postgresql_v" +"ersion }}/postgresql-{{ site.development_postgresql_version }}.tar.bz2\n" +"% tar xf postgresql-{{ site.development_postgresql_version }}.tar.bz2\n" +"% cd postgresql-{{ site.development_postgresql_version }}\n" +"```" +msgstr "" + +msgid "" +"Run `configure` with `CFLAGS=\"-O0 -g3\"` argument. It enables debug build. `--p" +"refix=/tmp/local` is optional:" +msgstr "" +"`CFLAGS=\"-O0 -g3\"`引数付きで`configure`を実行します。これでデバッグビルドになります。`--prefix=/tmp/local`" +"は指定してもしなくてもどちらでもよいです。" + +msgid "" +"```console\n" +"% ./configure CFLAGS=\"-O0 -g3\" --prefix=/tmp/local\n" +"```" +msgstr "" + +msgid "Build and install PostgreSQL:" +msgstr "PostgreSQLをビルドしてインストールします。" + +msgid "" +"```console\n" +"% make -j8 > /dev/null\n" +"% make install > /dev/null\n" +"```" +msgstr "" + +msgid "Initialize and run PostgreSQL:" +msgstr "PostgreSQLを初期化して実行します。" + +msgid "" +"```console\n" +"% mkdir -p /tmp/local/var/lib\n" +"% /tmp/local/bin/initdb --locale C --encoding UTF-8 -D /tmp/local/var/lib/post" +"gresql\n" +"% /tmp/local/bin/postgres -D /tmp/local/var/lib/postgresql\n" +"```" +msgstr "" + +msgid "" +"The following one liner is useful to reset all PostgreSQL related data. You st" +"ore the one liner in your shell history, you can rerun the one linear quickly:" +msgstr "" +"以下のワンライナーはPostgreSQL関連のすべてのデータをリセットするときに便利です。このワンライナーをシェルのヒストリーに入れておけば、すぐにこのワン" +"ライナーを再実行できます。" + +msgid "" +"```console\n" +"% rm -rf /tmp/local/lib/postgresql && \\\n" +" mkdir -p /tmp/local/var/lib/postgresql &&\n" +" /tmp/local/bin/initdb \\\n" +" --locale C \\\n" +" --encoding UTF-8 \\\n" +" -D /tmp/local/var/lib/postgresql && \\\n" +" /tmp/local/bin/postgres -D /tmp/local/var/lib/postgresql\n" +"```" +msgstr "" + +msgid "### How to build and test PGroonga" +msgstr "### PGroongaのビルド・テスト方法" + +msgid "" +"It's recommended that you use the latest PGroonga instead of released PGroonga" +". Here are command lines to clone the latest PGroonga source:" +msgstr "リリース版のPGroongaではなく最新のPGroongaを使うことをオススメします。以下は最新のPGroongaのソースをクローンするコマンドラインです。" + +msgid "" +"```console\n" +"% git clone git �� github.com:pgroonga/pgroonga.git\n" +"% cd pgroonga\n" +"```" +msgstr "" + +msgid "PGroonga has two test types:" +msgstr "PGroongaのテストは2種類あります。" + +msgid " * SQL based regression tests" +msgstr " * SQLベースのリグレッションテスト" + +msgid " * Ruby and SQL based [`pgroonga_check`][pgroonga-check] tests" +msgstr " * RubyとSQLを使った[`pgroonga_check`][pgroonga-check]のテスト" + +msgid "" +"Normally, you only use the former. `test/run-sql-test.sh` is the test runner f" +"or the former. It builds and installs PGroonga and runs SQL based regression t" +"ests. `PATH=/tmp/local/bin:$PATH` is needed because PostgreSQL is built with `" +"--prefix=/tmp/local`. `pg_config` exists in `/tmp/local/bin`:" +msgstr "" +"通常、前者だけを使います。`test/run-sql-test.sh`は前者用のテストランナーです。このスクリプトはPGroongaをビルド・インストールし" +"、続けてSQLベースのリグレッションテストも実行します。`PATH=/tmp/local/bin:$PATH`が必要なのはPostgreSQLを`--pre" +"fix=/tmp/local`オプションを指定してビルドしたからです。この場合は`pg_config`は`/tmp/local/bin`にあります。" + +msgid "" +"```console\n" +"% PATH=/tmp/local/bin:$PATH test/run-sql-test.sh\n" +"```" +msgstr "" + +msgid "## Test" +msgstr "## テスト" + +msgid "" +"You should create a regression test when you implement a new feature or fix a " +"bug." +msgstr "新しい機能を実装した時・バグを直した時は、リグレッションテストを作ります。" + +msgid "### Summary" +msgstr "### 概要" + +msgid "" +"Regression tests exist under `sql/` directory. For example, `sql/full-text-sea" +"rch/text/single/match-v2/indexscan.sql` is a test for the following case:" +msgstr "" +"リグレッションテストは`sql/`ディレクトリー以下にあります。例えば、`sql/full-text-search/text/single/match-v2" +"/indexscan.sql`は次のケース用のテストです。" + +msgid " * Full text search" +msgstr " * 全文検索" + +msgid " * `text` type" +msgstr " * `text`型" + +msgid " * [`&@`][match-v2-operator] (v2 match operator)" +msgstr " * [`&@`][match-v2-operator](マッチ演算子v2)" + +msgid " * Index scan" +msgstr " * インデックススキャン" + +msgid "" +"The expected outputs exist under `expected/` directory. Directory structure is" +" the same as `sql/` but the expected outputs use `.out` extension such as `exp" +"ected/full-text-search/text/single/match-v2/indexscan.out`." +msgstr "" +"出力の期待値は`expected/`ディレクトリー以下にあります。ディレクトリー構造は`sql/`と同じですが、拡張子は`.out`になります。たとえば、`" +"expected/full-text-search/text/single/match-v2/indexscan.out`となります。" + +msgid "### How to create a regression test" +msgstr "### リグレッションテストの作成方法" + +msgid "" +"You create a new file under `sql/` and put test scenario in SQL into the file." +" Then, run the file like the following:" +msgstr "新しいファイルを`sql/`以下に作り、SQLで作ったテストシナリオをそのファイルに書きます。それからこのファイルを次のように実行します。" + +msgid "" +"```console\n" +"% PATH=/tmp/local/bin:$PATH test/run-sql-test.sh sql/.../XXX.sql\n" +"```" +msgstr "" + +msgid "" +"The newly created test is failed and `test/run-sql-test.sh` shows the output o" +"f the test scenario. If the output is correct, copy the output and paste it to" +" `expected/.../XXX.out`." +msgstr "" +"この新しく作ったテストは失敗します。`test/run-sql-test.sh`はこのテストシナリオの出力を表示します。出力が正しければ、出力をコピーして`" +"expected/.../XXX.out`に貼ります。" + +msgid "You should confirm the test is passed by updating `expected/.../XXX.out`:" +msgstr "`expected/.../XXX.out`を更新してテストがパスするようになったかを確認してください。" + +msgid "[postgresql-source-download]:https://www.postgresql.org/ftp/source/" +msgstr "" + +msgid "[groonga-build]:http://groonga.org/docs/install/others.html" +msgstr "[groonga-build]:http://groonga.org/ja/docs/install/others.html" + +msgid "[groonga-install]:http://groonga.org/docs/install.html" +msgstr "[groonga-install]:http://groonga.org/ja/docs/install.html" + +msgid "[pgroonga-check]:../reference/modules/pgroonga-check.html" +msgstr "" + +msgid "[match-v2]:../reference/operators/match-v2.html" +msgstr "" Modified: _po/ja/index.po (+4 -1) =================================================================== --- _po/ja/index.po 2017-06-20 20:57:22 +0900 (fd18cde) +++ _po/ja/index.po 2017-06-26 00:00:29 +0900 (016dfbf) @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2016-12-06 12:28+0900\n" +"PO-Revision-Date: 2017-06-26 00:00+0900\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -114,6 +114,9 @@ msgstr " * [コミュニティー](community/): PGroongaのコミュニティ msgid " * [Users](users/): It lists PGroonga users." msgstr " * [ユーザー](users/): PGroongaユーザー。" +msgid " * [Development](development/): It describes how to develop PGroonga." +msgstr " * [開発](development/): PGroongaの開発方法の説明。" + msgid "## License {#license}" msgstr "## ライセンス {#license}" Added: development/index.md (+121 -0) 100644 =================================================================== --- /dev/null +++ development/index.md 2017-06-26 00:00:29 +0900 (8c8f057) @@ -0,0 +1,121 @@ +--- +title: Development +--- + +# Development + +This document describes how to develop PGroonga. + +## Build + +It's recommended that you build both PostgreSQL and PGroonga with debug options. + +It's better that you [build Groonga][groonga-build] with debug options (Groonga's `configure` provides `--enable-debug` option) too. If you use [packaged Groonga][groonga-install], you need to install development package. It's `libgroonga-dev` for Debian family distribution and `groonga-devel` for Red Hat family distribution. + +### How to build PostgreSQL + +Download source from [the PostgreSQL site][postgresql-source-download]. Here are command lines to download the source of PostgreSQL {{ site.development_postgresql_version }} and extract it: + +```console +% wget https://ftp.postgresql.org/pub/source/v{{ site.development_postgresql_version }}/postgresql-{{ site.development_postgresql_version }}.tar.bz2 +% tar xf postgresql-{{ site.development_postgresql_version }}.tar.bz2 +% cd postgresql-{{ site.development_postgresql_version }} +``` + +Run `configure` with `CFLAGS="-O0 -g3"` argument. It enables debug build. `--prefix=/tmp/local` is optional: + +```console +% ./configure CFLAGS="-O0 -g3" --prefix=/tmp/local +``` + +Build and install PostgreSQL: + +```console +% make -j8 > /dev/null +% make install > /dev/null +``` + +Initialize and run PostgreSQL: + +```console +% mkdir -p /tmp/local/var/lib +% /tmp/local/bin/initdb --locale C --encoding UTF-8 -D /tmp/local/var/lib/postgresql +% /tmp/local/bin/postgres -D /tmp/local/var/lib/postgresql +``` + +The following one liner is useful to reset all PostgreSQL related data. You store the one liner in your shell history, you can rerun the one linear quickly: + +```console +% rm -rf /tmp/local/lib/postgresql && \ + mkdir -p /tmp/local/var/lib/postgresql && + /tmp/local/bin/initdb \ + --locale C \ + --encoding UTF-8 \ + -D /tmp/local/var/lib/postgresql && \ + /tmp/local/bin/postgres -D /tmp/local/var/lib/postgresql +``` + +### How to build and test PGroonga + +It's recommended that you use the latest PGroonga instead of released PGroonga. Here are command lines to clone the latest PGroonga source: + +```console +% git clone git �� github.com:pgroonga/pgroonga.git +% cd pgroonga +``` + +PGroonga has two test types: + + * SQL based regression tests + + * Ruby and SQL based [`pgroonga_check`][pgroonga-check] tests + +Normally, you only use the former. `test/run-sql-test.sh` is the test runner for the former. It builds and installs PGroonga and runs SQL based regression tests. `PATH=/tmp/local/bin:$PATH` is needed because PostgreSQL is built with `--prefix=/tmp/local`. `pg_config` exists in `/tmp/local/bin`: + +```console +% PATH=/tmp/local/bin:$PATH test/run-sql-test.sh +``` + +## Test + +You should create a regression test when you implement a new feature or fix a bug. + +### Summary + +Regression tests exist under `sql/` directory. For example, `sql/full-text-search/text/single/match-v2/indexscan.sql` is a test for the following case: + + * Full text search + + * `text` type + + * [`&@`][match-v2-operator] (v2 match operator) + + * Index scan + +The expected outputs exist under `expected/` directory. Directory structure is the same as `sql/` but the expected outputs use `.out` extension such as `expected/full-text-search/text/single/match-v2/indexscan.out`. + +### How to create a regression test + +You create a new file under `sql/` and put test scenario in SQL into the file. Then, run the file like the following: + +```console +% PATH=/tmp/local/bin:$PATH test/run-sql-test.sh sql/.../XXX.sql +``` + +The newly created test is failed and `test/run-sql-test.sh` shows the output of the test scenario. If the output is correct, copy the output and paste it to `expected/.../XXX.out`. + +You should confirm the test is passed by updating `expected/.../XXX.out`: + +```console +% PATH=/tmp/local/bin:$PATH test/run-sql-test.sh sql/.../XXX.sql +``` + +[postgresql-source-download]:https://www.postgresql.org/ftp/source/ + +[groonga-build]:http://groonga.org/docs/install/others.html + +[groonga-install]:http://groonga.org/docs/install.html + +[pgroonga-check]:../reference/modules/pgroonga-check.html + +[match-v2]:../reference/operators/match-v2.html Modified: index.md (+2 -0) =================================================================== --- index.md 2017-06-20 20:57:22 +0900 (7bd9ae6) +++ index.md 2017-06-26 00:00:29 +0900 (976b88d) @@ -51,6 +51,8 @@ PostgreSQL supports full text search against languages that use only alphabet an * [Users](users/): It lists PGroonga users. + * [Development](development/): It describes how to develop PGroonga. + ## License {#license} PGroonga is released under [PostgreSQL license](http://opensource.org/licenses/postgresql) that is similar to BSD license and MIT license. Added: ja/development/index.md (+121 -0) 100644 =================================================================== --- /dev/null +++ ja/development/index.md 2017-06-26 00:00:29 +0900 (1a4cb52) @@ -0,0 +1,121 @@ +--- +title: 開発 +--- + +# 開発 + +このドキュメントではPGroongaの開発方法を説明します。 + +## ビルド + +PostgreSQLもPGroonaもどちらもデバッグオプション付きでビルドすることをオススメします。 + +Groongaもデバッグオプション(Groongaの`configure`には`--enable-debug`オプションがある)で[ビルド][groonga-build]した方が便利なことが多いです。[Groongaのパッケージ][groonga-install]を使う場合は、開発用パッケージをインストールする必要があります。Debian系のディストリビューションでは`libgroonga-dev`で、Red Hat系のディストリビューションでは`groonga-devel`です。 + +### PostgreSQLのビルド方法 + +[PostgreSQLのサイト][postgresql-source-download]からソースをダウンロードします。以下はPostgreSQL {{ site.development_postgresql_version }}のソースをダウンロードして展開するコマンドラインです。 + +```console +% wget https://ftp.postgresql.org/pub/source/v{{ site.development_postgresql_version }}/postgresql-{{ site.development_postgresql_version }}.tar.bz2 +% tar xf postgresql-{{ site.development_postgresql_version }}.tar.bz2 +% cd postgresql-{{ site.development_postgresql_version }} +``` + +`CFLAGS="-O0 -g3"`引数付きで`configure`を実行します。これでデバッグビルドになります。`--prefix=/tmp/local`は指定してもしなくてもどちらでもよいです。 + +```console +% ./configure CFLAGS="-O0 -g3" --prefix=/tmp/local +``` + +PostgreSQLをビルドしてインストールします。 + +```console +% make -j8 > /dev/null +% make install > /dev/null +``` + +PostgreSQLを初期化して実行します。 + +```console +% mkdir -p /tmp/local/var/lib +% /tmp/local/bin/initdb --locale C --encoding UTF-8 -D /tmp/local/var/lib/postgresql +% /tmp/local/bin/postgres -D /tmp/local/var/lib/postgresql +``` + +以下のワンライナーはPostgreSQL関連のすべてのデータをリセットするときに便利です。このワンライナーをシェルのヒストリーに入れておけば、すぐにこのワンライナーを再実行できます。 + +```console +% rm -rf /tmp/local/lib/postgresql && \ + mkdir -p /tmp/local/var/lib/postgresql && + /tmp/local/bin/initdb \ + --locale C \ + --encoding UTF-8 \ + -D /tmp/local/var/lib/postgresql && \ + /tmp/local/bin/postgres -D /tmp/local/var/lib/postgresql +``` + +### PGroongaのビルド・テスト方法 + +リリース版のPGroongaではなく最新のPGroongaを使うことをオススメします。以下は最新のPGroongaのソースをクローンするコマンドラインです。 + +```console +% git clone git �� github.com:pgroonga/pgroonga.git +% cd pgroonga +``` + +PGroongaのテストは2種類あります。 + + * SQLベースのリグレッションテスト + + * RubyとSQLを使った[`pgroonga_check`][pgroonga-check]のテスト + +通常、前者だけを使います。`test/run-sql-test.sh`は前者用のテストランナーです。このスクリプトはPGroongaをビルド・インストールし、続けてSQLベースのリグレッションテストも実行します。`PATH=/tmp/local/bin:$PATH`が必要なのはPostgreSQLを`--prefix=/tmp/local`オプションを指定してビルドしたからです。この場合は`pg_config`は`/tmp/local/bin`にあります。 + +```console +% PATH=/tmp/local/bin:$PATH test/run-sql-test.sh +``` + +## テスト + +新しい機能を実装した時・バグを直した時は、リグレッションテストを作ります。 + +### 概要 + +リグレッションテストは`sql/`ディレクトリー以下にあります。例えば、`sql/full-text-search/text/single/match-v2/indexscan.sql`は次のケース用のテストです。 + + * 全文検索 + + * `text`型 + + * [`&@`][match-v2-operator](マッチ演算子v2) + + * インデックススキャン + +出力の期待値は`expected/`ディレクトリー以下にあります。ディレクトリー構造は`sql/`と同じですが、拡張子は`.out`になります。たとえば、`expected/full-text-search/text/single/match-v2/indexscan.out`となります。 + +### リグレッションテストの作成方法 + +新しいファイルを`sql/`以下に作り、SQLで作ったテストシナリオをそのファイルに書きます。それからこのファイルを次のように実行します。 + +```console +% PATH=/tmp/local/bin:$PATH test/run-sql-test.sh sql/.../XXX.sql +``` + +この新しく作ったテストは失敗します。`test/run-sql-test.sh`はこのテストシナリオの出力を表示します。出力が正しければ、出力をコピーして`expected/.../XXX.out`に貼ります。 + +`expected/.../XXX.out`を更新してテストがパスするようになったかを確認してください。 + +```console +% PATH=/tmp/local/bin:$PATH test/run-sql-test.sh sql/.../XXX.sql +``` + +[postgresql-source-download]:https://www.postgresql.org/ftp/source/ + +[groonga-build]:http://groonga.org/ja/docs/install/others.html + +[groonga-install]:http://groonga.org/ja/docs/install.html + +[pgroonga-check]:../reference/modules/pgroonga-check.html + +[match-v2]:../reference/operators/match-v2.html Modified: ja/index.md (+2 -0) =================================================================== --- ja/index.md 2017-06-20 20:57:22 +0900 (131c229) +++ ja/index.md 2017-06-26 00:00:29 +0900 (324e931) @@ -49,6 +49,8 @@ PostgreSQLはアルファベットと数値だけを使った言語の全文検 * [ユーザー](users/): PGroongaユーザー。 + * [開発](development/): PGroongaの開発方法の説明。 + ## ライセンス {#license} PGroongaのライセンスは[PostgreSQLライセンス](http://opensource.org/licenses/postgresql)です。PostgreSQLはBSDライセンス、MITライセンスと似たライセンスです -------------- next part -------------- HTML����������������������������...Download