Unix へのインストール

ApplixWare has an ODBC database interface supported on at least some platforms. ApplixWare v4.4.1 has been demonstrated under Linux with Postgres v6.4 using the psqlODBC driver contained in the Postgres distribution.

ApplixWareODBC データベースインタフェースを持っており、それは幾つかの プラットホームでサポートされています。 ApplixWare v4.4.1 は、Linux上で 動作する PostgreSQL v6.4 で、 PostgreSQL に元々含まれている psqlODBC ドライバを使用して、動作が 確認されています。

ドライバの構築

The first thing to note about the psqlODBC driver (or any ODBC driver) is that there must exist a driver manager on the system where the ODBC driver is to be used. There exists a freeware ODBC driver for Unix called iodbc which can be obtained from various locations on the Net, including at AS200. Instructions for installing iodbc are beyond the scope of this document, but there is a README that can be found inside the iodbc compressed .shar file that should explain how to get it up and running.

まず第一に psqlODBC (あるいは他の ODBCドライバでも同様ですが)について 注意しなければいけないことは、ODBC ドライバが 使われるはずのシステムの上に、ドライバマネージャーが存在して いなければならないということです。 Unix用に存在するフリーな ODBC ドライバは iodbc と呼ばれ、インターネット上のいろいろな場所からそれを手に入れること ができますが、 AS200 もそのうちの一つです。 iodbc をインストールするための説明は このドキュメントの範疇を越えていますが、 iodbc の .shar 形式圧縮ファイルの 中にある README ファイルでそれを参照する ことができます。

Having said that, any driver manager that you can find for your platform should support the psqlODBC driver or any ODBC driver.

つまり、psqlODBC ドライバや他の ODBC ドライバ等、あなたのプラットフォームで 動作する色々なドライバマネージャを入手することができます。

The Unix configuration files for psqlODBC have recently been extensively reworked to allow for easy building on supported platforms as well as to allow for support of other Unix platforms in the future. The new configuration and build files for the driver should make it a simple process to build the driver on the supported platforms. Currently these include Linux and FreeBSD but we are hoping other users will contribute the necessary information to quickly expand the number of platforms for which the driver can be built.

最近、psqlODBC の UNIX 用 コンフィギュレーションファイルは、将来他のUNIXプラットホームでも 容易に構築可能なように広範囲にわたって書きなおされました。 この新しいコンフィギュレーションファイルとビルドファイルを使えば、 サポート済みプラットフォームでドライバーを簡単に構築することが 出来るようになっています。 現在これには Linux と FreeBSD を 含んでいますが、我々はドライバを構築可能なプラットフォームの数を 早く増やすために、他のプラットフォームを使用しているユーザーから 必要な情報の提供を希望しています。

There are actually two separate methods to build the driver depending on how you received it and these differences come down to only where and how to run configure and make. The driver can be built in a standalone, client-only installation, or can be built as a part of the main Postgres distribution. The standalone installation is convenient if you have ODBC client applications on multiple, heterogeneous platforms. The integrated installation is convenient when the target client is the same as the server, or when the client and server have similar runtime configurations.

ドライバを構築する際、実際には2つの異なった方法が有り、それはあなた がどのようにそれを受け取り、そしてどのように configuremake を実行するのかによります。 このドライバは、スタンドアローン、 クライアントのみのインストール、 あるいはPostgreSQL システムの一部として 構築(訳注:後述する統合インストレーションのこと)することができます。 スタンドアローンインストレーションは、多数の異なったプラットフォーム 上に ODBC クライアントアプリケーションを持って いる場合に向いています。 統合インストレーションは、目的の クライアントがそのサーバーと同じ時、あるいはクライアントと サーバーが同類のランタイム形式を持っている場合に向いています。

Specifically if you have received the psqlODBC driver as part of the Postgres distribution (from now on referred to as an "integrated" build) then you will configure and make the ODBC driver from the top level source directory of the Postgres distribution along with the rest of its libraries. If you received the driver as a standalone package than you will run configure and make from the directory in which you unpacked the driver source.

特に、PostgreSQL の配布の 一部としてこの psqlODBC ドライバを 受け取った場合(今から統合的な構築についてを言及します)、 他のライブラリと一緒に PostgreSQL のソースディレクトリで ODBC ドライバの configure と make を実行してください。 もし、スタンドアローンパッケージとしてそのドライバを受け取った場合、 解凍したドライバソースのディレクトリで configure とmake を実行してください。

統合インストレーション

This installation procedure is appropriate for an integrated installation.

以下のインストール手順は統合インストールに適合します。

  1. Specify the --with-odbc command-line argument for src/configure:

    --with-odbc というコマンドライン引数を src/configure 実行時に指定してください:

    % ./configure --with-odbc
    % make

  2. Rebuild the Postgres distribution:

    PostgreSQL を再構築します:

    % make install

Once configured, the ODBC driver will be built and installed into the areas defined for the other components of the Postgres system. The installation-wide ODBC configuration file will be placed into the top directory of the Postgres target tree (POSTGRESDIR). This can be overridden from the make command-line as

一度この設定を行えば、ODBC ドライバは他の PostgreSQL システムコンポーネントと 同じ指定の場所へインストールされます。 インストールされた システム全体で ODBC コンフィギュレーション・ファイルは その PostgreSQL ターゲットツリー(POSTGRESDIR) の一番上のディレクトリの中に配置されます。 これは以下のような make 時の コマンドライン引数で無効にすることが出来ます。

% make ODBCINST=filename install

v6.4 以前の統合インストレーション

If you have a Postgres installation older than v6.4, you have the original source tree available, and you want to use the newest version of the ODBC driver, then you may want to try this form of installation.

もし v6.4 より古い PostgreSQL 持っており、 そのオリジナルソースが有る場合に、最新バージョンの ODBC ドライバを使用してみたければ、 以下のインストール方法を試してみてもいいかもしれません。

  1. Copy the output tar file to your target system and unpack it into a clean directory.

    ターゲットシステムに tar ファイルのコピーし、新規ディレクトリに それを解凍します。

  2. From the directory containing the sources, type:

    ソースを含んでいるディレクトリ(訳注:一般的には /usr/local/src/pgsql/postgresql-6.5.x/src)で、以下のように入力します:

    % ./configure
    % make
    % make POSTGRESDIR=PostgresTopDir install

  3. If you would like to install components into different trees, then you can specify various destinations explicitly:

    もし他のディレクトリツリーにPostgreSQLのコンポーネントを インストールしたい場合、明示的に多数の宛先を指定することができます:

    % make BINDIR=bindir  LIBDIR=libdir  HEADERDIR=headerdir ODBCINST=instfile install

スタンドアローン インストレーション

A standalone installation is not integrated with or built on the normal Postgres distribution. It should be best suited for building the ODBC driver for multiple, heterogeneous clients who do not have a locally-installed Postgres source tree.

スタンドアローン インストレーションは、通常の Postgresディストリビューションに 統合されているわけではなく、またそのディストリビューション上で 構築されたものでもありません。 この方法は PostgreSQL のソースファイルを 持っていない場合、あるいは複数の異機種クライアントのための ODBC ドライバを構築する場合に最適です。

The default location for libraries and headers for the standalone installation is /usr/local/lib and /usr/local/include/iodbc, respectively. There is another system wide configuration file that gets installed as /share/odbcinst.ini (if /share exists) or as /etc/odbcinst.ini (if /share does not exist).

スタンドアローン インストレーションにおけるライブラリとヘッダーの デフォルトの位置は、それぞれ /usr/local/lib/usr/local/include/iodbc です。 さらにもう1つ、システム全体に対する設定ファイルがあります。 これは/shareが存在すれば /share/odbcinst.iniとして、存在しなければ /etc/odbcinst.iniとしてインストールされます。

Note: Installation of files into /share or /etc requires system root privileges. Most installation steps for Postgres do not have this requirement, and you can choose another destination which is writable by your non-root Postgres superuser account instead.

/share あるいは /etc の 中へのファイルのインストールは root権限 を必要とします。 通常の PostgreSQL インストール作業には root権限 は必要は有りません。 その代わり、root 以外の PostgreSQL 用の スーパーユーザアカウント (訳注:通常 postgres ) によって 書き込み可能なディレクトリを選択することができます。

  1. The standalone installation distribution can be built from the Postgres distribution or may be obtained from Insight Distributors, the current maintainers of the non-Unix sources.

    スタンドアローンインストール用の配布ファイルは PostgreSQL 配布ソースから構築すること もできますし、あるいは現在UNIX環境以外のソースを保守している Insight Distributors から手に入れる事ができます。

    Copy the zip or gzipped tarfile to an empty directory. If using the zip package unzip it with the command

    空のディレクトリに zip あるいは gzip で圧縮された tar 形式ファイルをコピーします。 zip で圧縮されたパッケージファイルの場合、以下のコマンドでそれを解凍してください。

    % unzip -a packagename
    The -a option is necessary to get rid of DOS CR/LF pairs in the source files. -a オプションは、ソースファイルから DOS 形式の CR/LF を取り除くために必要です。

    If you have the gzipped tar package than simply run

    gzip で圧縮された tar 形式のパッケージファイルを持っているなら、単純に以下を実行します。

    tar -xzf packagename

    1. To create a tar file for a complete standalone installation from the main Postgres source tree:

      PostgreSQL のソースツリーから完全な スタンドアローンインストレーションの為の tar ファイルを作ります:

  2. Configure the main Postgres distribution.

    核となる PostgreSQL の設定をします。

  3. Create the tar file:

    以下の様に tar ファイルを作ります:

    % cd interfaces/odbc
    % make standalone

  4. Copy the output tar file to your target system. Be sure to transfer as a binary file if using ftp.

    ターゲットシステムにその tar ファイルをコピーします。 もし ftp を使う場合、ファイルをバイナリ形式で転送して下さい。

  5. Unpack the tar file into a clean directory.

    新しいディレクトリにその tar ファイルを解凍します。

  6. Configure the standalone installation:

    スタンドアローンインストレーション用の configure を実行します:

    % ./configure

    The configuration can be done with options:

    この時、いろいろなオプションを付ける事ができます:

    % ./configure --prefix=rootdir --with-odbc=inidir
    where --prefix installs the libraries and headers in the directories rootdir/lib and rootdir/include/iodbc, and --with-odbc installs odbcinst.ini in the specified directory. --prefix を指定すると、 rootdir/lib にライブラリファイルを、 rootdir/include/iodbcにヘッダーファイル をインスト−ルします。 --with-odbcを指定すると、odbcinst.ini を その場所にインストールします。

    Note that both of these options can also be used from the integrated build but be aware that when used in the integrated build --prefix will also apply to the rest of your Postgres installation. --with-odbc applies only to the configuration file odbcinst.ini.

    これらのオプションは、統合インストールの場合にも使用可能ですが、 これらが 統合インストールで使われる時には、 --prefix は 他の PostgreSQL のシステムコンポーネントのインストールにも適用されます。 --with-odbcodbcinst.ini のコンフィギュレーション・ファイルにだけ適用されます。

  7. Compile and link the source code:

    ソースをコンパイルし、リンクします:

    % make ODBCINST=instdir

    You can also override the default location for installation on the 'make' command line. This only applies to the installation of the library and header files. Since the driver needs to know the location of the odbcinst.ini file attempting to override the enviroment variable that specifies its installation directory will probably cause you headaches. It is safest simply to allow the driver to install the odbcinst.ini file in the default directory or the directory you specified on the './configure' command line with --with-odbc.

    同様に、make 実行時の引数でインストール先をデフォルトの位置から 変更することができます。 これはライブラリファイルとヘッダー ファイルのインストールにだけに当てはまります。 ドライバーは、 odbcinst.ini の場所を知っている必要があるので、デフォルトの 環境変数を変更してインストールするディレクトリを指定すると、 それは恐らくあなたの頭痛の種になります。 もっとも安全で簡単な 対策は、ドライバを標準のディレクトリか、あるいは './configure' 実行時に --with-odbc オプションで指定したディレクトリに odbcinst.ini ファイルをインストールすることです。

  8. Install the source code:

    ソースをコンパイルします:

    % make POSTGRESDIR=targettree install

    To override the library and header installation directories separately you need to pass the correct installation variables on the make install command line. These variables are LIBDIR, HEADERDIR and ODBCINST. Overriding POSTGRESDIR on the make command line will cause LIBDIR and HEADERDIR to be rooted at the new directory you specify. ODBCINST is independent of POSTGRESDIR.

    make install 時のコマンドラインにおいて、 LIBDIRHEADERDIR および ODBCINST という3つのインストール用環境変数を 正しく指定してやることにより、(デフォルトの)ライブラリと ヘッダーインストールディレクトリの指定を無効にすることもできます。 make 時のコマンドラインで POSTGRESDIR を指定すると、 LIBDIRHEADERDIR のベース ディレクトリは、あなたが指定した新しいディレクトリになります。 ODBCINSTPOSTGRESDIR から独立 しています。

    Here is how you would specify the various destinations explicitly:

    明示的にそれぞれのインストール先を指定するには以下のようにします:

    % make BINDIR=bindir 
    LIBDIR=libdir 
    HEADERDIR=headerdir install

    For example, typing

    例えば、以下のように入力します。

    % make POSTGRESDIR=/opt/psqlodbc install
    (after you've used ./configure and make) will cause the libraries and headers to be installed in the directories /opt/psqlodbc/lib and /opt/psqlodbc/include/iodbc respectively. ( ./configuremakeを実行した後で ) ライブラリとヘッダーはそれぞれ /opt/psqlodbc/lib/opt/psqlodbc/include/iodbcという ディレクトリにインストールされます。

    The command

    以下のコマンドは、ライブラリを/opt/psqlodbc/lib に、 ヘッダーを/usr/local/include/iodbc にインストールします。 もしこれが、期待通り動かない場合、PostgreSQL の保守を行っている グループに連絡を取ってください。

    % make POSTGRESDIR=/opt/psqlodbc HEADERDIR=/usr/local install
    should cause the libraries to be installed in /opt/psqlodbc/lib and the headers in /usr/local/include/iodbc. If this doesn't work as expected please contact one of the maintainers.