[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:31442] Re: perl-5.14.2-x86_64-P3.txzについて



From: 山本 伸一 <beniya@xxxxxxxxxxxxxx>
Subject: [plamo:31441] Re: perl-5.14.2-x86_64-P3.txz について
Date: Sat, 08 Jun 2013 17:21:33 +0900

>> 直接インターネットにつながってない等で,perl だけを更新できればいいなら,
>> perl-5.14.2-x86_64-P3.txz に含まれているビルドスクリプトを使って,自前
>> の環境用にperlをビルドし直すのがてっとり早そう.
>> 
> 
> 時間が取れたので、とりあえず解凍してみたのですが、どれをどうしたものか、さっ
> ぱりわかりません。(^_^;)
> usr/bin/ の中の、どれかなんでしょうけど、すみませんが具体的にご教授いただ
> けませんでしょうか。<m(__)m>

Plamoの場合、ビルドスクリプトは /usr/share/doc/<パッケージ名>/ のディレ
クトリに収められています.perl-5.14.2 ならば /usr/share/doc/perl-5.14.2/ ですね.

作業用に適当なディレクトリを用意して,このディレクトリにあるビルドスク
リプトとパッチファイルをコピーし,展開しておきます.

$ mkdir work ; cd work
$ cp /usr/share/doc/perl-5.14.2/PlamoBuild.perl-5.14.2.gz .
$ cp /usr/share/doc/perl-5.14.2/*patch.gz .
$ gunzip *.gz

これで作業用のディレクトリには以下の3つのファイルがあるはず

$ ls
CVE-2013-1667.patch      perl-5.12.1-Configure_multilib-1.patch
PlamoBuild.perl-5.14.2*

必須ではありませんが,Plamoの公式ビルドとローカルビルドを区別するために,
PlamoBuild.perl-5.14.2 の build 行を適当に変更しておきます.

build=P3
=>
build=local

これでビルドの準備はできました.次に必要なソースコードをダウンロードします.
そのためには,ビルドスクリプトに download オプションを指定して実行します.

$ ./PlamoBuild.perl-5.14.2 download
--2013-06-08 21:28:40--  http://www.cpan.org/src/perl-5.14.2.tar.bz2
www.cpan.org (www.cpan.org) をDNSに問いあわせています... 2620:101:d000:8::140:1, 2a01:608:2:4::2, 212.117.177.118, ...
...
`perl-5.14.2.tar.bz2' に保存中

    [                    <=>                ] 7,958,954   1.48M/s              
2013-06-08 21:28:52 (1.21 MB/s) - `perl-5.14.2.tar.bz2' へ保存終了 [13226972]

perl-5.14.2/
perl-5.14.2/cygwin/
....
perl-5.14.2/vms/vmsish.h
perl-5.14.2/vms/genopt.com

ダウンロードしたソースコードは自動的に展開され,これで必要なファイルは
揃ったので,次に config オプションを指定してビルドスクリプトを実行します.

$ ./PlamoBuild.perl-5.14.2 config
patching file Configure
patching file ext/Hash-Util-FieldHash/t/10_hash.t
patching file hv.c
patching file t/op/hash.t
sh Configure -ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dpager=/bin/less -isR -Dlibpth=/usr/lib64 /lib64 /usr/local/lib64 -Dcc=gcc -isystem /usr/include -Dusethreads -Duseshrplib
...
Now you must run 'make'.

If you compile perl5 on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of
the policy defaults.

これで作業用ディレクトリのbuild以下に必要なパッチを適用したソースコード
が用意され,configure 処理まで終了したので,次に build オプションを指定
して実際のビルド作業を行います.

$ ./PlamoBuild.perl-5.14.2 build
`sh  cflags "optimize='-O2'" miniperlmain.o` -fPIC miniperlmain.c
`sh  cflags "optimize='-O2'" gv.o` -fPIC gv.c
....
	Everything is up to date. Type 'make test' to run test suite.

ビルドが終了すれば,packageオプションを指定して,パッケージ作業を行いま
す.この際,root 権限でパッケージを作成するかを尋ねられるので,実際にイ
ンストールするパッケージを作る時は y と答えてrootのパスワードを入力します.

$ ./PlamoBuild.perl-5.14.2 package
Do you want to package as root? [y/N] y
パスワード:
make install.perl install.man STRIPFLAGS= DESTDIR="/home/kojima/work/work"
make[1]: ディレクトリ `/home/kojima/work/build' に入ります
....
version:5.14.2
arch:x86_64
build:local
ext:txz

これで perl-5.14.2-x86_64_local.txz ができました.

$ ls -l perl*txz
-rw-r--r-- 1 root root 13,343,468  6月  8日  21:40 perl-5.14.2-x86_64-local.txz

後は root 権限で,このパッケージを updatepkg -f してやれば,既存のパッ
ケージを更新できるはず.

$ sudo updatepkg -f perl-5.14.2-x86_64-local.txz

より詳しくは,gihyo.jpにあげている「玩式草子」の連載記事を参照のこと :-)


---------
こじま



Follow-Ups
[plamo:31443] Re: perl-5.14.2-x86_64-P3.txz について, 山本 伸一
References
[plamo:31436] Re: perl-5.14.2-x86_64-P3.txz について, 山本 伸一
[plamo:31439] Re: perl-5.14.2-x86_64-P3.txzについて, KOJIMA Mitsuhiro
[plamo:31441] Re: perl-5.14.2-x86_64-P3.txz について, 山本 伸一

[検索ページ] [メール一覧]
Plamo ML 公開システム