CVSup 経由でソースを取ってくる

An alternative to using anonymous CVS for retrieving the Postgres source tree is CVSup. CVSup was developed by John Polstra to distribute CVS repositories and other file trees for the FreeBSD project.

Postgres のソースツリーを取ってくるた めの匿名 CVS に代わる方法として CVSup があります。CVSup は、 FreeBSD プロジェクト において、CVS リポジトリやその他のファイルツリーを配布するために、 John Polstra によっ て開発されました。

A major advantage to using CVSup is that it can reliably replicate the entire CVS repository on your local system, allowing fast local access to cvs operations such as log and diff . Other advantages include fast synchronization to the Postgres server due to an efficient streaming transfer protocol which only sends the changes since the last update.

CVSup を使う主なメリットは、あなたの ローカルシステム上で CVS リポジトリ 全体 の 複製を作成してくれるので、ログdiff といった cvs 操作がローカルで高速に行えるようになると いうことです。

CVSup クライアントシステムの 準備

Two directory areas are required for CVSup to do it's job: a local CVS repository (or simply a directory area if you are fetching a snapshot rather than a repository; see below) and a local CVSup bookkeeping area. These can coexist in the same directory tree.

CVSup を動かすには2つのディレクトリ 領域が必要です。つまりローカルの CVS リポジトリ(もしくは、リポジトリではなくスナップショットを取得す るなら単なるディレクトリ領域。後述)とローカルの CVSup 作業エリアです。これらは同一のディレクトリツ リー内で共存させることも可能です。

Decide where you want to keep your local copy of the CVS repository. On one of our systems we recently set up a repository in /home/cvs/, but had formerly kept it under a Postgres development tree in /opt/postgres/cvs/. If you intend to keep your repository in /home/cvs/, then put

CVS リポジトリのローカルコピーをどこ に置くか決めます。私達のシステムのうちの1つでは、最近 /home/cvs/ というところにリポジトリを設定しましたが、 以前は /opt/postgres/cvs/ にある Postgres の開発ツリーの配下に置いてい ました。リポジトリを /home/cvs/ に置いてお くには、.cshrc ファイルに

setenv CVSROOT /home/cvs
    
in your .cshrc file, or a similar line in your .bashrc or .profile file, depending on your shell. と書いておくか、同じようなことを、あなたが使っているシェルに応じ て .bashrc とか .profile とかいうファイルに書いておきます。

The cvs repository area must be initialized. Once CVSROOT is set, then this can be done with a single command:

cvs のリポジトリ領域は、初期化してや る必要があります。いったん環境変数 CVSROOT がセッ トされると、単純に以下のコマンドで初期化できます:

$ cvs init
    
after which you should see at least a directory named CVSROOT when listing the CVSROOT directory: この後、環境変数 CVSROOT が指しているディレクトリ のリストを取ってみると、少なくとも CVSROOT という名前のディレクトリがあるはずです。
$ ls $CVSROOT
CVSROOT/
    

CVSup クライアントを動かす

Verify that cvsup is in your path; on most systems you can do this by typing

まず cvsup がパスに含まれているかどう かを確認します。ほとんどのシステムではこのようにタイプします:

which cvsup
    
Then, simply run cvsup using: その後、単にcvsup を起動します:
$ cvsup -L 2 postgres.cvsup
    
where -L 2 enables some status messages so you can monitor the progress of the update, and postgres.cvsup is the path and name you have given to your CVSup configuration file. -L 2 でいくつかのステータスメッセージが有効にな り、更新中の様子を見ることができます。また postgres.cvsup は、 実際にはあなたが CVSup の設定ファイル につけたパス名を指定します。

Here is a CVSup configuration file modified for a specific installation, and which maintains a full local CVS repository:

特定のシステム用に調整されたCVSup の設定ファイルを以下に示します。これは、ローカル全体の CVS リポジトリを保守するためのものです。

# This file represents the standard CVSup distribution file
# for the PostgreSQL ORDBMS project
# Modified by lockhart@alumni.caltech.edu 1997-08-28
# - Point to my local snapshot source tree
# - Pull the full CVS repository, not just the latest snapshot
#
# Defaults that apply to all the collections
*default host=postgresql.org
*default compress
*default release=cvs
*default delete use-rel-suffix
# enable the following line to get the latest snapshot
#*default tag=.
# enable the following line to get whatever was specified above or by default
# at the date specified below
#*default date=97.08.29.00.00.00

# base directory points to where CVSup will store its 'bookmarks' file(s)
# will create subdirectory sup/
#*default base=/opt/postgres # /usr/local/pgsql
*default base=/home/cvs

# prefix directory points to where CVSup will store the actual distribution(s)
*default prefix=/home/cvs

# complete distribution, including all below 
pgsql

# individual distributions vs 'the whole thing'
# pgsql-doc
# pgsql-perl5
# pgsql-src

   
# このファイルは PostgreSQL ORDBMS プロジェクトのために用意された、
# 標準の CVSup のディストリビューションファイルです。
# Modified by lockhart@alumni.caltech.edu 1997-08-28
# - Point to my local snapshot source tree
# - Pull the full CVS repository, not just the latest snapshot
#
# 集合物すべてに適用されるデフォルト値
*default host=postgresql.org
*default compress
*default release=cvs
*default delete use-rel-suffix
# 次の行を有効にすると、最新のスナップショットを取得します
#*default tag=.
# 次の行を有効にすると、指定された日付において、上記または
# デフォルトで指定されたものを取得します
# ☆ちと意味不明
# enable the following line to get whatever was specified above 
# or by default at the date specified below
#*default date=97.08.29.00.00.00

# CVSup がその「ブックマーク」ファイルを格納する位置を示すポイン
# タのベースディレクトリ。サブディレクトリ sup/ が作られます。
#*default base=/opt/postgres # /usr/local/pgsql
*default base=/home/cvs

# CVSup が実際の配布物を格納するための場所の前につける
# ディレクトリ名。
*default prefix=/home/cvs

# 以下のすべてを含む、配布物全体
pgsql

# 「配布物全体」に対する、個々の配布物
# pgsql-doc
# pgsql-perl5
# pgsql-src

   

The following is a suggested CVSup config file from the Postgres ftp site which will fetch the current snapshot only:

Postgres の ftp サイト から最新のスナップショットだけを 取り出すための CVSup 設定ファイルを 以下に示します: -

# This file represents the standard CVSup distribution file
# for the PostgreSQL ORDBMS project
#
# Defaults that apply to all the collections
*default host=postgresql.org
*default compress
*default release=cvs
*default delete use-rel-suffix
*default tag=.

# base directory points to where CVSup will store its 'bookmarks' file(s)
*default base=/usr/local/pgsql

# prefix directory points to where CVSup will store the actual distribution(s)
*default prefix=/usr/local/pgsql

# complete distribution, including all below 
pgsql

# individual distributions vs 'the whole thing'
# pgsql-doc
# pgsql-perl5
# pgsql-src

    
# このファイルは、PostgreSQL ORDBMS プロジェクトに関する標準の
# CVSup 配布ファイルに相当します。
# 収集するものすべてに適用されるデフォルト
*default host=postgresql.org
*default compress
*default release=cvs
*default delete use-rel-suffix
*default tag=.

# CVSup がその「ブックマーク」ファイルを格納するための場所の
# ベースとなるディレクトリ
*default base=/usr/local/pgsql

# CVSup が実際の配布物を格納するための場所の前につけられる
# ディレクトリ名
*default prefix=/usr/local/pgsql

# 以下のすべてを含む、配布物全体
pgsql

# 「配布物全体」に対する、個々の配布物
# pgsql-doc
# pgsql-perl5
# pgsql-src

    

CVSup をインストールする

CVSup is available as source, pre-built binaries, or Linux RPMs. It is far easier to use a binary than to build from source, primarily because the very capable, but voluminous, Modula-3 compiler is required for the build.

CVSup はソース、コンパイル済みバイナ リ、および Linux RPM として入手可能です。バイナリを使うほうがソ ースからコンパイルするよりもはるかに簡単です。これはコンパイル時 に、非常に高機能な、しかし雑多なバージョンが散在する Modula-3 コンパイラが必要となるからです。

CVSup をバイナリからインストールする

You can use pre-built binaries if you have a platform for which binaries are posted on the Postgres ftp site, or if you are running FreeBSD, for which CVSup is available as a port.

お使いのプラットフォーム用のバイナリが Postgres の ftp サイト に置いてある場合や、 CVSupが ports として用意されている FreeBSD をお使いの場合は、事前にコンパイルされたバイナリを使用 することができます。

Note: CVSup was originally developed as a tool for distributing the FreeBSD source tree. It is available as a "port", and for those running FreeBSD, if this is not sufficient to tell how to obtain and install it then please contribute a procedure here. ☆いまいち自信がありません。あまり重要なところではないのですが。

CVSup はもともと FreeBSD のソースツリーを配布するためのツールとして開発さ れたもので、FreeBSD をお使いの方であれば "port" という形で入手で きます。もし、ここで述べている内容だけでは入手やインストールする のに情報が不充分と思われる方は、ここで改善案をご提示いただけると 助かります。

At the time of writing, binaries are available for Alpha/Tru64, ix86/xBSD, HPPA/HPUX-10.20, MIPS/irix, ix86/linux-libc5, ix86/linux-glibc, Sparc/Solaris, and Sparc/SunOS.

この記事の執筆時点で入手可能なバイナリが用意されているプラットフ ォームには、Alpha/Tru64, ix86/xBSD, HPPA/HPUX-10.20, MIPS/irix, ix86/linux-libc5, ix86/linux-glibc, Sparc/Solaris, Sparc/SunOS があります。

  1. Retrieve the binary tar file for cvsup (cvsupd is not required to be a client) appropriate for your platform. ☆you(your machine) が to be a client なのかな? cvsupd はクライアント側には必要ないってことを言いたい?

    あなたのプラットフォームに合った cvsupcvsupd は(サーバですので)クライア ントになる場合は不要です)バイナリの tar ファイルを入手してください。

    1. If you are running FreeBSD, install the CVSup port.

      FreeBSD をお使いの場合は CVSup port をインストールしてください。

    2. If you have another platform, check for and download the appropriate binary from the Postgres ftp site.

      FreeBSD 以外のプラットフォームをお使いの場合は、 Postgres の ftp サイト から適切なバイナリをダウン ロードしてください。

  2. Check the tar file to verify the contents and directory structure, if any. For the linux tar file at least, the static binary and man page is included without any directory packaging.

    tar ファイルをチェックして、その内容とディレクトリ構造(もしあれ ば)を確認してください。少なくとも Linux 用の tar ファイルには、 スタティック(にリンクされた)バイナリと man ページが、ディレク トリ分けすることなく入っています。

    1. If the binary is in the top level of the tar file, then simply unpack the tar file into your target directory:

      バイナリが tar ファイルのトップディレクトリに入っていれば、単に それをあなたのインストール先ディレクトリに展開してやるだけですみ ます。

      $ cd /usr/local/bin
      $ tar zxvf /usr/local/src/cvsup-16.0-linux-i386.tar.gz
      $ mv cvsup.1 ../doc/man/man1/
          

    2. If there is a directory structure in the tar file, then unpack the tar file within /usr/local/src and move the binaries into the appropriate location as above.

      tar ファイルの中身がディレクトリ構造になっている場合は、/usr/local/src 配下で展開して、その後バイナリを適切な場所に移動してください。

  3. Ensure that the new binaries are in your path.

    新しいバイナリが、あなたのパスに反映されていることを確認して おきます。

    $ rehash
    $ which cvsup
    $ set path=(path to cvsup $path)
    $ which cvsup
    /usr/local/bin/cvsup
          

ソースからのインストール

Installing CVSup from sources is not entirely trivial, primarily because most systems will need to install a Modula-3 compiler first. This compiler is available as Linux RPM, FreeBSD package, or source code.

CVSup をソースからインストールするこ とは、そんなに簡単なことではありません。この主な理由は、ほとんど のシステムではまず Modula-3 コンパイラをインストールする必要があ るからです。このコンパイラはLinux RPM, FreeBSD package およびソースコードとして提供されています。

Note: A clean-source installation of Modula-3 takes roughly 200MB of disk space, which shrinks to roughly 50MB of space when the sources are removed.

Modula-3 をまっさらのソースからインストールするには 200MB 程度の ディスク領域を必要とします。(インストール後に)ソースを削除して しまえば 50MB ほど節約できます。

Linux でのインストール

  1. Install Modula-3.

    Modula-3 をインストールします。

    1. Pick up the Modula-3 distribution from Polytechnique Montr饌l, who are actively maintaining the code base ☆文字化け(フランス語?) originally developed by the DEC Systems Research Center. The "PM3" RPM distribution is roughly 30MB compressed. At the time of writing, the 1.1.10-1 release installed cleanly on RH-5.2, whereas the 1.1.11-1 release is apparently built for another release (RH-6.0?) and does not run on RH-5.2.

      Polytechnique Montreal, から Modula-3 の配布物を取ってきます。 ここは精力的にコードベースを保守しているところですが、オリジナル はthe DEC Systems Research Center で開発されました。 "PM3" RPM は圧縮後で約 30MB あります。執筆時点では 1.1.10-1 リリースが RH-5.2 上でまと もにインストールされています。1.1.11-1 は明らかに別のリリース (RH-6.0?) でビルドされているようで、RH-5.2 では動きません。

      Tip: This particular rpm packaging has many RPM files, so you will likely want to place them into a separate directory.

      この特定の rpm パッケージには たくさんの RPM ファイルがあるので、別々のディレ クトリに入れたくなることでしょう。

    2. Install the Modula-3 rpms:

      Modula-3 rpm をインストールします:

      # rpm -Uvh pm3*.rpm
          

  2. Unpack the cvsup distribution:

    cvsup の配布物を展開します:

    # cd /usr/local/src
    # tar zxf cvsup-16.0.tar.gz
          

  3. Build the cvsup distribution, suppressing the GUI interface feature to avoid requiring X11 libraries:

    cvsup の配布物をビルドします。X11 のライブラリを要求させないよう にするため、GUI インターフェース機能を使わないように指示します:

    # make M3FLAGS="-DNOGUI"
          
    and if you want to build a static binary to move to systems which may not have Modula-3 installed, try: また、Modula-3 がインストールされていないシステムに入れるために スタティックバイナリでビルドしたければ、以下のようにします:
    # make M3FLAGS="-DNOGUI -DSTATIC"
          

  4. Install the built binary:

    ビルドされたバイナリをインストールします:

    # make M3FLAGS="-DNOGUI -DSTATIC" install