右往左往ブログ

日々よりみち

CentOS6にcheckinstallを導入する

ruby-2.2.0のrpmを作成したかったので、checkinstallをCentOS6 (64bit)に導入しました。

CheckInstallとは

ソースコードからmake, make installによってインストールするソフトウェアについて、rpmなどのパッケージングを自動で行ってくれるソフトです。
これがないと、specファイルを自分で書かなければならず、非常に手間がかかりますが、checkinstallによって比較的簡単にrpmパッケージを作成することができます。
(作成できるのはrpmパッケージだけではありませんが)

CheckInstall

導入手順

基本的に以下に従って導入しました。

CentOS 6.3 に checkinstall をインストールする - パンダのメモ帳
CentOSにcheckinstallをgitからインストールする - オープンソースこねこね

手順

基本的にrootユーザで実行しています。

必要パッケージ導入

# yum -y install git gcc make gettext rpm-build

CheckInstall導入前準備

# cd /var/tmp
# git clone http://checkinstall.izto.org/checkinstall.git
# cd checkinstall/
# sed -i 's:CONFDIR=$(PREFIX)/lib/checkinstall:CONFDIR=$(PREFIX):g' Makefile
# sed -i 's:EXCLUDE="":EXCLUDE="/selinux":g' checkinstallrc-dist
# sed -i 's:LIBDIR=$(PREFIX)/lib:LIBDIR=$(PREFIX)/lib64:g' installwatch/Makefile

CheckInstall rpmパッケージ作成

導入前に、CheckInstall自体のrpmパッケージを作成します。

# make 
# make install
# mkdir -p /root/rpmbuild/SOURCES
# checkinstall --install=no

途中でいろいろと質問がありますが、rpmを指定するくらいでほとんど気にする必要はありません。

checkinstall 1.6.3, Copyright 2010 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.

The checkinstallrc file was not found at:
/usr/local/lib/checkinstall/checkinstallrc

Assuming default values.


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: [ 20150207 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ x86_64 ]
8 -  Source location: [ checkinstall ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ checkinstall ]

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

Installing with make install...

========================= Installation results ===========================

中略

Copying files to the temporary directory...OK

Stripping ELF binaries...OK

Compressing man pages...OK

Building file list...OK

Building RPM package...OK

NOTE: The package will not be installed

Erasing temporary files...OK

Writing backup package...OK

Deleting temp dir...OK


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

 Done. The new package has been saved to

 /root/rpmbuild/RPMS/x86_64/checkinstall-20150207-1.x86_64.rpm
 You can install it in your system anytime using:

      rpm -i checkinstall-20150207-1.x86_64.rpm

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

CheckInstall導入

# cd /root/rpmbuild/RPMS/x86_64
# rpm -ivh checkinstall-20150207-1.x86_64.rpm
Preparing...                ########################################### [100%]
   1:checkinstall           ########################################### [100%]

インストールの確認

# rpm -qi checkinstall
Name        : checkinstall                 Relocations: (not relocatable)
Version     : 20150207                          Vendor: (none)
Release     : 1                             Build Date: Sat 07 Feb 2015 08:00:05 PM UTC
Install Date: Sat 07 Feb 2015 08:01:58 PM UTC      Build Host: localhost
Group       : Applications/System           Source RPM: checkinstall-20150207-1.src.rpm
Size        : 460811                           License: GPL
Signature   : (none)
Packager    : checkinstall-1.6.3
Summary     : CheckInstall installations tracker, version 1.6.2
Description :
CheckInstall installations tracker, version 1.6.2

CheckInstall  keeps  track of all the files created  or
modified  by your installation  script  ("make install"
"make install_modules",  "setup",   etc),   builds    a
standard   binary   package and  installs  it  in  your
system giving you the ability to uninstall it with your
distribution's  standard package management  utilities.

インストールできました。
次回、CheckInstallruby-2.2.0をrpm化してみます。