【TIPS】checkinstall:ソースからインストールしたものをRPMなどのパッケージにしてくれるソフト

スポンサーリンク

自宅サーバのx27d(CentOS 5.8,64bit版)に新しいrubyを入れようと思って色々試したのでメモメモ。

rubyのダウンロードとインストール

最近の作業から、rubyは更新が早そうなのでインストール&アンインストールが簡単なほうが良さそう。一番良いのはソース(tar.gz)からSRPMなりRPMを作ってそれで管理することだけど、ソースからSRPMを自力で作るのはなかなかハードルが高そう。

ソースからRPMを作るのをある程度自動でざーっとしてくれるソフトがないかなぁ、と探したら@IT:ソースファイルからRPMファイルを作成するにはの記事で「checkinstall」というソフトで出来そうな感じがしたので、ためしにインストール

checkinstallのダウンロードとインストール

CentOS 5.8のepelやdagレポジトリにはないです。なので公式CheckInstall Homepageから「checkinstall-1.6.2.tar.gz」をダウンロードして実行。以下、一般ユーザでホームディレクトリにworkというディレクトリを作り、そこで作業してます。

$ cd
$ cd work
$ wget http://asic-linux.com.mx/%7Eizto/checkinstall/files/source/checkinstall-1.6.2.tar.gz 
$ tar xvzf checkinstall-1.6.2.tar.gz 
$ make
$ sudo make install

数回ほど質問されますが、最初のはそのままEnter,次はRを入力しEnterで良いみたい。

$ sudo /usr/local/sbin/checkinstall
checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.
The checkinstallrc file was not found at:
/usr/local/sbin/../checkinstallrc
Assuming default values.
The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs?  [y]: y
Preparing package documentation...OK
Please choose the packaging method you want to use.
Slackware [S], RPM [R] or Debian [D]? R
**************************************
**** RPM package creation selected ***
**************************************
This package will be built according to these values:
1 -  Summary: [ CheckInstall installations tracker, version 1.6.2 ]
2 -  Name:    [ checkinstall ]
3 -  Version: [ 1.6.2 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ x86_64 ]
8 -  Source location: [ checkinstall-1.6.2 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ checkinstall ]
Enter a number to change any of them or press ENTER to continue:
**********************************************************************
(中略)
**********************************************************************

 Done. The new package has been saved to

 /home/hogehoge/rpm/RPMS/x86_64/checkinstall-1.6.2-1.x86_64.rpm
 You can install it in your system anytime using:

      rpm -i checkinstall-1.6.2-1.x86_64.rpm

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

その後出来たcheckinstallのrpmをrpmコマンドでインストールするとOKみたい

$ sudo rpm -ivh /home/nasunasu/rpm/RPMS/x86_64/checkinstall-1.6.2-1.x86_64.rpm

以下のブログがとても参考になりました。ありがとうございます。
genteel.org » CentOS 5.5にcheckinstallをインストール