トップ 履歴 一覧 カテゴリ ソース 検索 ヘルプ RSS ログイン

ParlModule/CpanConfig

INDEX

CPANシェルの設定

CPANシェルの設定に関して。必要な設定がない場合(初回起動の場合やバージョンアップして設定項目が増えた場合)は、起動時に必要な項目を効いてくる。

また、改めて設定を(対話式の設定プログラムを使って)しなおす場合、CPANシェルで "o conf init" を実行する。

CPANシェルの初期設定

CPANシェルの初回起動の時には、起動後そのまま初期設定が行われる。設定項目が多いがほとんどの内容はデフォルト値で進めて問題ない。

※以下の内容は、CPAN Ver.1.7601 の時のもの

 初期起動

はじめてCPANシェルを起動した場合に対話式の設定プログラムが起動する。

# perl -MCPAN -e shell {enter}

/usr/libdata/perl5/CPAN/Config.pm initialized.


CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.

If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)

Are you ready for manual configuration? [yes] {enter}

手動設定を行ってよいか聞かれるので、そのままエンターキーを押下して進める。

 ワークディレクトリ

The following questions are intended to help you with the
configuration. The CPAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of CPAN files.
This may be a site-wide directory or a personal directory.

First of all, I'd like to create this directory. Where?

CPAN build and cache directory? [/root/.cpan] {enter}

CPANモジュールのキャッシュとビルドを行う(ワーク)ディレクトリ。デフォルトで進める。

If you want, I can keep the source files after a build in the cpan
home directory. If you choose so then future builds will take the
files from there. If you don't want to keep them, answer 0 to the
next question.


How big should the disk cache be for keeping the build directories
with all the intermediate files?

Cache size for build directory (in MB)? [10] {enter}

先に設定した(ワーク)ディレクトリのキャッシュサイズ。デフォルトで進める。

By default, each time the CPAN module is started, cache scanning
is performed to keep the cache size in sync. To prevent from this,
disable the cache scanning with 'never'.

Perform cache scanning (atstart or never)? [atstart] {enter}
To considerably speed up the initial CPAN shell startup, it is
possible to use Storable to create a cache of metadata. If Storable
is not available, the normal index mechanism will be used.

Cache metadata (yes/no)? [yes] {enter}

 ターミナルの設定

The next option deals with the charset your terminal supports. In
general CPAN is English speaking territory, thus the charset does not
matter much, but some of the aliens out there who upload their
software to CPAN bear names that are outside the ASCII range. If your
terminal supports UTF-8, you say no to the next question, if it
supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it
supports neither nor, your answer does not matter, you will not be
able to read the names of some authors anyway. If you answer no, names
will be output in UTF-8.

Your terminal expects ISO-8859-1 (yes/no)? [yes] {enter}

 ヒストリの設定

If you have one of the readline packages (Term::ReadLine::Perl,
Term::ReadLine::Gnu, possibly others) installed, the interactive CPAN
shell will have history support. The next two questions deal with the
filename of the history file and with its size. If you do not want to
set this variable, please hit SPACE RETURN to the following question.

File to save your history? [/root/.cpan/histfile] {enter}
Number of lines to save? [100] {enter}

 前提モジュールの処理

The CPAN module can detect when a module that which you are trying to
build depends on prerequisites. If this happens, it can build the
prerequisites for you automatically ('follow'), ask you for
confirmation ('ask'), or just ignore them ('ignore'). Please set your
policy to one of the three values.

Policy on building prerequisites (follow, ask or ignore)? [ask] {enter}

インストール時に、前提モジュールがある場合どうするか。デフォルトは"ask"(都度問い合わせ)。自動的に入れてよい場合は、"follow"にする。

 外部アプリケーションのパス

The CPAN module will need a few external programs to work properly.
Please correct me, if I guess the wrong path for a program. Don't
panic if you do not have some of them, just press ENTER for those. To
disable the use of a download program, you can type a space followed
by ENTER.

Where is your gzip program? [/usr/bin/gzip] {enter}
Where is your tar program? [/bin/tar] {enter}
Warning: unzip not found in PATH
Where is your unzip program? [] {enter}
Where is your make program? [/usr/bin/make] {enter}
Where is your lynx program? [/usr/bin/lynx] {enter}
Warning: wget not found in PATH
Where is your wget program? [] {enter}
Warning: ncftpget not found in PATH
Where is your ncftpget program? [] {enter}
Warning: ncftp not found in PATH
Where is your ncftp program? [] {enter}
Where is your ftp program? [/usr/bin/ftp] {enter}
Warning: gpg not found in PATH
Where is your gpg program? [] {enter}
What is your favorite pager program? [/usr/bin/less] {enter}
What is your favorite shell? [/bin/ksh] {enter}

関連外部アプリケーションのパスの設定。

基本的には、見つかったものに関してはデフォルトでセットされるのでデフォルトのまま。見つからない場合やパスが正しくない場合は、設定しなおす。

make コマンドは、「perl -V:make」が返すものを使用する。これは、Makefile.PL が「perl -V:make」が返す makeプログラムにあった Makefile を作るため。

Windows環境でパスに空白が含まれる場合は、空白の含まれない形(ショートパス)にした方が無難。

コンパイルのオプション

Every Makefile.PL is run by perl in a separate process. Likewise we
run 'make' and 'make install' in processes. If you have any
parameters (e.g. PREFIX, LIB, UNINST or the like) you want to pass
to the calls, please specify them here.

If you don't understand this question, just press ENTER.

Parameters for the 'perl Makefile.PL' command?
Typical frequently used settings:

    PREFIX=~/perl       non-root users (please see manual for more hints)

Your choice:  [] {enter}

オプション設定。デフォルトで進める。ただし、root以外で行う場合は、インストール先(PREFIX=〜)を指定する。

Parameters for the 'make' command?
Typical frequently used setting:

    -j3              dual processor system

Your choice:  [] {enter}
Parameters for the 'make install' command?
Typical frequently used setting:

    UNINST=1         to always uninstall potentially conflicting files

Your choice:  [] {enter}

 ネットワークの設定

Sometimes you may wish to leave the processes run by CPAN alone
without caring about them. As sometimes the Makefile.PL contains
question you're expected to answer, you can set a timer that will
kill a 'perl Makefile.PL' process after the specified time in seconds.

If you set this value to 0, these processes will wait forever. This is
the default and recommended setting.

Timeout for inactivity during Makefile.PL? [0] {enter}

タイムアウトの設定。デフォルトで進める。0以外の時は、タイムアウト時にalart関数が呼ばれる。ActivePerlは実装されてなくてエラーになる(らしい)。

If you're accessing the net via proxies, you can specify them in the
CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.

Your ftp_proxy? {enter}
Your ftp_proxy? {enter}
Your http_proxy? {enter}
Your no_proxy? {enter}

ftp, http プロキシの設定。プロキシを利用する場合は設定する。

 アクセスサーバの設定

You have no /root/.cpan/sources/MIRRORED.BY
  I'm trying to fetch one
LWP not available
CPAN: Net::FTP loaded ok
Fetching with Net::FTP:
  ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
Couldn't fetch MIRRORED.BY from ftp.perl.org
Fetching with Net::FTP
  ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.gz
Couldn't fetch MIRRORED.BY.gz from ftp.perl.org

Trying with "/usr/bin/lynx -source" to get
    ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY


Now we need to know where your favorite CPAN sites are located. Push
a few sites onto the array (just in case the first on the array won't
work). If you are mirroring CPAN to your local workstation, specify a
file: URL.

First, pick a nearby continent and country (you can pick several of
each, separated by spaces, or none if you just want to keep your
existing selections). Then, you will be presented with a list of URLs
of CPAN mirrors in the countries you selected, along with previously
selected URLs. Select some of those URLs, or just keep the old list.
Finally, you will be prompted for any extra URLs -- file:, ftp:, or
http: -- that host a CPAN mirror.

(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America
Select your continent (or several nearby continents) [] 2 {enter}
Sorry! since you don't have any existing picks, you must make a
geographic selection.

(1) China
(2) Hong Kong
(3) India
(4) Indonesia
(5) Iran
(6) Israel
(7) Japan
(8) Malaysia
(9) Philippines
(10) Republic of Korea
(11) Russian Federation
(12) Saudi Arabia
(13) Singapore
(14) Taiwan
(15) Thailand
(16) Turkey
Select your country (or several nearby countries) [] 7 {enter}
Sorry! since you don't have any existing picks, you must make a
geographic selection.

(1) ftp://ftp.dti.ad.jp/pub/lang/CPAN/
(2) ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
(3) ftp://ftp.kddilabs.jp/CPAN/
(4) ftp://ftp.nara.wide.ad.jp/pub/CPAN/
(5) ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
(6) ftp://ftp.u-aizu.ac.jp/pub/CPAN
(7) ftp://ftp.yz.yamagata-u.ac.jp/pub/lang/cpan/
(8) http://ftp.cpan.jp/
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. '1 4 5' [] 1 4 3 {enter}

Enter another URL or RETURN to quit: []
New set of picks:
  ftp://ftp.dti.ad.jp/pub/lang/CPAN/
  ftp://ftp.nara.wide.ad.jp/pub/CPAN/
  ftp://ftp.kddilabs.jp/CPAN/

使用するサーバの設定。地域、国を選択、その国内にあるサーバリストから使用するものを選択する。地域はAsia、国はJapanに相当する番号を、サーバは適当に(近い場所がベスト?)

 終わり

commit: wrote /usr/libdata/perl5/CPAN/Config.pm
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7601)
ReadLine support available (try 'install Bundle::CPAN')

cpan>

CPANシェルの設定

 設定項目の内容確認

設定項目は o conf コマンドで確認できる。

cpan> o conf
$CPAN::Config options from '/usr/libdata/perl5/CPAN/Config.pm':
:

 すべての設定項目の変更

初期設定と同様に対話式ですべて設定しなおす場合、init オプションを使う。

cpan> o conf init

 設定項目の変更

個別の設定項目を変更する場合は、項目名 値 の書式で入力する。

cpan> o conf wget /usr/local/bin/wget
    wget               /usr/local/bin/wget

ただし、urllist (サーバリスト) は、次のように shift, unshift, push, pop オプションを使う。使用するサーバのURLは、http://www.cpan.org/SITES.html から日本のミラーサイト(ネットワーク的に近いところ)を指定する。

# リストの先頭のURLを削除する
cpan> o conf urllist shift
# リストの先頭に指定したURLを追加する
cpan> o conf urllist unshift ftp://ftp.ayamura.org/pub/CPAN/
# リストの最後のURLを削除する
cpan> o conf urllist pop
# リストの最後に指定したURLを追加する
cpan> o conf urllist push ftp://ftp.ayamura.org/pub/CPAN/

 設定項目の確定と取消

変更した内容は、そのままでは終了した時に破棄される。変更内容を永続させる場合は、commitする。

cpan> o conf commit
commit: wrote '/usr/libdata/perl5/CPAN/Config.pm'

逆に変更内容を戻す場合は、defaults オプションで読み直す。

cpan> o conf defaults
'/usr/libdata/perl5/CPAN/Config.pm' reread

 urllist のローカルディレクトリの指定

urllist には、RFC 1738に従ったURLで指定し、file URLも可能。

file://localhost/home/ftp/pub/CPAN/
file:///home/ftp/pub/CPAN/

また、リストに file URL がある場合、CPANはそこから取得しようと試み処理を行う。そのため、CDROMなどローカルのものを使用する場合、urllist の最後に file URL を追加する。よって、urllistの先頭のCPANサイトからインデックス・ファイルを取得し、最新のバージョンがローカルにあるかチェックする。

cpan> o conf urllist push file://localhost/cdrom/CPAN/

さらに、urllist は、最後に正常に取得できたサイトの優先順位を上げる。よって、以降の要求では、最初にそのサイトが対象となる。

最終更新時間:2008年11月14日 16時44分00秒 指摘や意見などあればSandBoxのBBSへ。