Debian lenny にはデフォルトで「
lha」パッケージが導入されていなかった。
で、apt-get でインストールしようとしたら、
リポジトリに存在してないよ~んということでインストール出来ず。
しかたないので、ソースファイルからコンパイルしてインストールすることにした。
ソースファイルのダウンロード
まず
SourceForge.JP http://sourceforge.jp/ にて lha をダウンロード。
(lha-1.14i-ac20050924p1.tar.gz のダウンロードページは
http://sourceforge.jp/projects/lha/downloads/22231/lha-1.14i-ac20050924p1.tar.gz/)
ソースファイルのコンパイル
コンパイルからのインストールってほとんど経験ないのですが、基本的に
$./configure && make
$su
#make install
|
をやればよいらしい。
が、素人ゆえつまずいた。
「
make」と「
gcc」がシステムにインストールされていなかったのがつまずいた原因だったのだが、その途中経過のメモを残しておくことにする。
./configure && make
まずソースファイルを展開したディレクトリに移動してから「./configure && make」を実行。
$ ./configure && make
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
$
|
実はこの時点でErrorが出ていたんですが全然気づかず「make install」に進みました。
$ su
# make install
bash: make: command not found
|
・・・
「make」が見つからんとな。
この時点で「make」がインストールされていなかったのに気づき、apt-getでインストール。
# apt-get install make
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
・
・
略
・
・
(.../make_3.81-5_amd64.deb から) make を展開しています...
man-db のトリガを処理しています ...
make (3.81-5) を設定しています ...
#
|
これでmakeのインストール完了。
では「./configure && make」のやり直しから。
# exit
$ ./configure && make
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
$
|
で、「make install」。
$ su
# make install
make: *** ターゲット `install' を make するルールがありません. 中止.
|
となる。
うおーい、これは何だ?
ということで「make: *** ターゲット `install' を make するルールがありません. 中止.」でいろいろ検索かけてみると、「
gcc」がインストールされていない例があったので自分も確認してみたら該当していた。
・
・
$ ./configure && make
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
・
・
|
「./configure && make」にちゃんとエラーが出ていたと。
「・・・C
compiler found in $PATH」
「
コンパイラが見つかんねぇ」と言ってくれてたんですな。すいません。
なので今度は「gcc」をapt-getでインストール。
# apt-get install gcc
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下の特別パッケージがインストールされます:
binutils gcc-4.3 libc6-dev linux-libc-dev
提案パッケージ:
・
・
略
・
・
gcc (4:4.3.2-2) を設定しています ...
linux-libc-dev (2.6.26-21lenny4) を設定しています ...
libc6-dev (2.7-18lenny2) を設定しています ...
#
|
これで「gcc」のインストールが完了。
ということではじめからやり直す。
ソースファイルからのインストール (本番)
まずソースファイルを展開したディレクトリに移動してから「./configure && make」を実行。
$ ./configure && make
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
・
・
略
・
・
Makefile:317: 警告: ターゲット `lha-test' へのコマンドを置き換えます
Makefile:190: 警告: ターゲット `lha-test' への古いコマンドは無視されます
make[2]: `all' に対して行うべき事はありません.
make[2]: ディレクトリ `/opt/lha-1.14i-ac20050924p1/tests' から出ます
make[2]: ディレクトリ `/opt/lha-1.14i-ac20050924p1' に入ります
make[2]: `all-am' に対して行うべき事はありません.
make[2]: ディレクトリ `/opt/lha-1.14i-ac20050924p1' から出ます
make[1]: ディレクトリ `/opt/lha-1.14i-ac20050924p1' から出ます
$
|
次に管理者権限になって、「make install」を実行。
$ su
# make install
Making install in man
make[1]: ディレクトリ `/opt/lha-1.14i-ac20050924p1/man' に入ります
・
・
略
・
・
make[2]: `install-data-am' に対して行うべき事はありません.
make[2]: ディレクトリ `/opt/lha-1.14i-ac20050924p1' から出ます
make[1]: ディレクトリ `/opt/lha-1.14i-ac20050924p1' から出ます
#
|
これでインストールが完了!
おまけ : lhaでのlzhファイル解凍
「lha e filename」でファイルを解凍できます。
例)
いやはや素人ですいません。
ソースファイルからのインストールの作法とかが系統的に理解できるいい書籍とかあったら、どなたか紹介してくださいな。
参考
「Linux 上での解凍・圧縮方法」
http://uguisu.skr.jp/Windows/tar.html
「Linux で *.lzh」
http://blog.goo.ne.jp/nobody123/e/84644c8ab36f9f66d0b2cf4c7cec4092
apt-getについては
debianパッケージ 入門 技術評論社
が参考になると思います。