TAR から RPM を生成できる CheckInstall

2009-1-19 07:00
このエントリーをはてなブックマークに追加

tarball (tar アーカイブ)ファイルの中に .spec ファイルがあれば TAR ファイルから RPM を生成 の方法で RPM を自動生成できますが、.spec ファイルがなければどうしようもありません。

しかし、CheckInstall は、spec ファイルが無くても tarball から RPM を生成してくれるというツール。.spec ファイルがない場合でも、CheckInstall が SPEC ファイルを自動生成して、RPM を作成してくれます。これはすごい。

まず CheckInstall をインストール

CheckInstall の最新版は 1.6.1 です。CheckInstall 自体は tarball の他に、バイナリ RPM でも提供されています。prmb.pbone.net からディストリビューション・環境にあったものを選んでダウンロード、インストールしてください。CentOS ならば RHEL 用のパッケージが利用できます。このパッケージを入れればインストールは終了です。

  # rpm -ivh checkinstall-1.6.0-3.el4.rf.x86_64.rpm

※ただし、2009年1月時点では、RHEL 5 (CentOS 5) 用の x86_64 のパッケージはありません。また ソース RPM も無いようです。tarball からもビルドできないようです。CentOS5 の対処方法 (CheckInstall の RPM を作成)は別途掲載します。

CheckInstall を使ってみる

基本的な手順としては、使いたいパッケージを

  1. tarball を展開
  2. ./configure
  3. checkinsatll を実行

となります。make install しないで checkinstall を使えばよいようです。

使用例

ここでは SquidClamAV 3.9 の tarball を RPM に変換したときの例です。

  # wget http://www.samse.fr/GPL/squidclamav/squidclamav-3.9.tar.gz
  # tar xzf squidclamav-3.9.tar.gz
  # cd /usr/TAR/squidclamav-3.9/
  (出力結果は省略)
  # ./configure
  (出力結果は省略)
  # make
  (出力結果は省略)
  # checkinstall

途中でいくつか質問があります。英語ですが難しくありませんので、適切に答えてください。

  Should I create a default set of package docs?  [y]: y ← y を入力
  Please choose the packaging method you want to use.
  Slackware [S], RPM [R] or Debian [D]? R  ← R を入力

  Please write a description for the package.
  End your description with an empty line or EOF.
  >> SquidClamav - A Clamav Antivirus Redirector for Squid - ← パッケージの概要を入力

さらに、パッケージの詳細を入力できます。


**************************************
**** RPM package creation selected ***
**************************************

This package will be built according to these values:

1 -  Summary: [ SquidClamav - A Clamav Antivirus Redirector for Squid - ]
2 -  Name:    [ squidclamav ]
3 -  Version: [ 3.9 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ x86_64 ]
8 -  Source location: [ squidclamav-3.9 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ squidclamav ]

Enter a number to change any of them or press ENTER to continue

例えば、ここで、 Requires に squid や clamav などのパッケージ名を追加したい場合は、10 を入力します。

  Enter a number to change any of them or press ENTER to continue: 10
  Enter the additional requirements:
  >> squid

Enter を押すと、RPM の作成が始まります。エラーがなければ次のようなメッセージが出て、/usr/src/redhat/RPMS/ 以下のディレクトリに RPM が作成されます。

**********************************************************************

 Done. The new package has been saved to

 /usr/src/redhat/RPMS/x86_64/squidclamav-3.9-1.x86_64.rpm
 You can install it in your system anytime using:

      rpm -i squidclamav-3.9-1.x86_64.rpm

**********************************************************************

コメントはまだありません

No comments yet.

Sorry, the comment form is closed at this time.

33 queries. HTML convert time: 0.083 sec. Powered by WordPress. Valid XHTML
Copyright © 2003-2017 @ futuremix.org ログイン