CheckInstall

ArticleCategory:

System Administration

AuthorImage: [Here we need a little image from you]

[Photo of the Author]

TranslationInfo:[Author + translation history. mailto: or http://homepage]

original in de Mario M. Knopf 

en to zh_CN.GB Wang Jun 

AboutTheAuthor:[A small biography about the author]

Mario ϲ����Linux������ͼ������ȫ����صĹ�����

Abstract:[Here you write a little summary]

Checkinstall ��һ���ܴ� tar.gz���Դ�����Զ�����RPM��Debian��Slackware��װ���ij�������ʹ�����ü������е� tar.gz ���Դ�������ɡ��ɾ����İ�װ����ж�ذ���

ArticleIllustration:[One image that will end up at the top of the article]

[CheckInstall Title]

ArticleBody:[The main part of the article]

���

�����������������⣺��������õij���ֻ�� tar.gz��Դ������ã�û���ṩ rpm ���� Debian��������������ֻ�����ػ�Դ���룬��ѹ��Ȼ���ֶ����롣��ĿǰΪֹ��һ��������Ȼ����������ɾ������ʱ���أ�

Makefile�ļ�ֻ�����˺�������µ�ж�����̡���Ȼ������԰ѳ���װ����ʱ�ļ��У�Ȼ����������ɳ������ɻ��޸ĵ��ļ������ɾ�����ǡ���������������Ҫ�������±��룬�������Ƿdz�ʹ��ģ�������Ҳ���൱��ġ� Felipe Eduardo��д�� CheckInstall [1] Sánchez Díaz Durán ������������������ġ�

һ��˵�������DZ��밲 װһ����GNU Autoconf���õij����Dz������µIJ��裺
./configure && make && make install.
��� configure �ű��ļ����������¡���һϵ��ϵͳ��صı�������Щ�������ں���ı������Ҫ�õ��ġ��������ϵͳ����ֵ�Ƿ��������Ҫ��Ȼ��ʹ����Щ�����ڳ������ÿ���ļ��������� Makefile �����⣬configure �ű��������������ļ��������ǣ�

configure�ű��ļ��ɹ�����֮��, �������make��������򣬵õ�����Ҫ�Ŀ�ִ���ļ�����Ҳ������make֮������ʹ��make check�����в��ԡ�������ֻ�ǿ�ѡ�IJ��裬��Ϊ����Ҫ����������֧�֡���� make�ɹ�������ˣ������ʹ��make install����װ��������ˡ��������ԣ�����ⲽ����ҪһЩ���Ȩ�ޡ�����װ���ˣ��������Դ������ļ���������make clean�������Щ���ɵĿ�ִ���ļ���Ŀ���ļ�������㻹��ɾ����configure���ɵ��ļ�����ô���� then typemake distclean��������ͬmake checkһ�����ǿ�ѡ�ģ�������ͨ���ǿ������ڿ����Ͳ��Խ׶���ʹ�ã�Ҳ���Ա�һ��ʹ����������ʡӲ�̿ռ���߱����ļ��еĽṹ������졣����make distcleanʹ�������ڲ�ͬ���͵ĵ����ϱ�������Ϊ���ܡ�

����GNU Autoconf����ϸ���Ͽ����������ĵ�[2]���ҵ����ڻ�������֮�⣬�����ͨ��д���Լ���configure�ű�����M4��̺ʹ����Լ��ĺ�ȷ�ʽ��ѧϰ�����й�GNU Build System��֪ʶ��

CheckInstall

ǰ���ᵽ�����Dz���GNU Autoconfͨ��һϵ������ָ�����������

./configure && make && make install

���ڸ��ǻ�һ�ַ�ʽ��ʱ���ˣ������ʹ��CheckInstall���������Լ���ָ��checkinstall������make install����������ָ�����������ǰһ������ˣ��������ָ������ʹ�� CheckInstall����ˣ�

./configure && make && checkinstall

ָ��checkinstall����Ĭ��������make install�����һ�������а�װ�����е�д������Ϊ�ˣ�CheckInstallʹ����Pancrazio de Mauro ��д�ij���Installwatch [3]����make install�ɹ����֮��CheckInstall�����һ��Slackware-, Debian- ��RPM- ��װ����Ȼ������������Ĭ�����ð�װ���򣬲��ڵ�ǰĿ¼�����׼��װ���洢Ŀ¼������һ�����ɵİ�װ��������,�����ͨ���޸ı���PAK_DIR���޸ı������Ŀ¼���������ɵİ�װ����װ�����������϶��������±��롪����Ȼ�����ÿ������������໥�����ԡ�

CheckInstall����ֻ��ʹ��make install,����������������װָ����Э�������磬�����װָ��Ϊsetup.sh����ô��װָ�����б��:

./configure && make && checkinstall setup.sh

���ǻ�������CheckInstall���źܶ�������С������������ʾ���п��õ��Ӳ�������Щ�Ӳ������·�Ϊ����װѡ�Install options��, �ű�����ѡ�Scripting options��, ��Ϣ��ʾѡ�Info display options��,��װ��ѡ�Package tuning options��,���ѡ�Cleanup options��������CheckInstall��About CheckInstall���ȡ�

# checkinstall -h

���CheckInstall������Щ�������У�����ʹ����Щ����ֵ�����������ļ�checkinstallrc����Ӧ��ֵ��

CheckInstallҲ���Լ��ľ���֮���������ܴ�����̬���ӵij�����Ϊ����Installwatch�Ͳ��ܼ�⵽��װ�������޸Ĺ��ļ��ˡ�����˵�������������ӿ⣺��̬�ĺ;�̬�ġ���Щ���ӿ�ͨ��include-ָ�����ϵ������С���̬���ӹ��ij����Ѿ�������������Ҫ�Ŀ��ļ�������ʱҲ�Ͳ���Ҫ�ٽ���Щ�������ڴ��С����ֳ����밲װ��ϵͳ�е����ӿ��޹أ���Ϊ��ν����������Linker���Ѿ��ڱ���ʱ����Щ�����õ���ִ�г������ˡ�

��װ

CheckInstall�Ѿ��ڴ�һЩ�ķ��а�ġ�����ء�(software pools)�д��ںܳ���ʱ���ˣ�����ͨ�����а�����ṩ�İ�װ��ʽ��װ����Ҳ��������ҳ[4]�����ظ���Ԥ����õİ�װ�����ߺ��ʵ�Դ�����

CheckInstall�İ�װ�dz��򵥣�ֻ��Ҫ���ٵIJ��衪����Ҫ�ɹ��İ�װCheckInstall���ƺ���Ҫ CheckInstall���ڱ�Ҫ��make install֮��������checkinstall���ͻ�ӱ���õij������ɺ��ʵĶ����ư�װ�������ڣ������ʹ����İ�װ���������������ɾ��ġ���װ����ж���ˡ���CheckInstall������װ��֮ǰ���㻹�ñ���ش�һ�����ڳ���װ�������������⣬���һ�Ҫ��������Ϣ����ȷ�ԡ���Щ��Ϣ����������Ժ����ɵİ�װ����ͷ����

���潫չʾ��װcheckinstall-1.6.0beta4.tgz��ȫ���̡���ᰲװ��CheckInstall��Installwatch��makepak������makepak��makepkg���޸İ档�������°汾�ĸĽ�����Ȥ����ο�Release Notes [5] ��/�� Changelog [6].

$ tar xzf checkinstall-1.6.0beta4.tgz
$ cd checkinstall-1.6.0beta4
checkinstall-1.6.0beta4 $ make
[...]
checkinstall-1.6.0beta4 $ su
Password:
checkinstall-1.6.0beta4 # make install
[...]
checkinstall-1.6.0beta4 # checkinstall

checkinstall 1.6.0beta4, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.

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.0beta4 ]
2 -  Name:     [ checkinstall ]
3 -  Version:  [ 1.6.0beta4 ]
4 -  Release:  [ 1 ]
5 -  License:  [ GPL ]
6 -  Group:    [ Applications/System ]
7 -  Architecture: [ i386 ]
8 -  Source location: [ checkinstall-1.6.0beta4 ]
9 -  Alternate source location: [  ]
10 - Provides: [ checkinstall ]
11 - Requires: [  ]

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

Installing with make install...

========================= Installation results =========================
[...]



========================= Installation successful ======================

Copying documentation directory...
./
./NLS_SUPPORT
./README
./FAQ
./TODO
./CREDITS
./INSTALL
./Changelog
./BUGS
./installwatch-0.7.0beta4/
./installwatch-0.7.0beta4/README
./installwatch-0.7.0beta4/TODO/usr/src/redhat/RPMS/i386/checkinstall-1.6.0beta4-1.i386.rpm
./installwatch-0.7.0beta4/VERSION
./installwatch-0.7.0beta4/INSTALL
./installwatch-0.7.0beta4/CHANGELOG
./installwatch-0.7.0beta4/BUGS
./installwatch-0.7.0beta4/COPYING
./RELNOTES
./COPYING

Copying files to the temporary directory...OK

Striping ELF binaries and libraries...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

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

��ɡ�
�µİ�װ�������� /usr/src/redhat/RPMS/i386/checkinstall-1.6.0beta4-1.i386.rpm
�������ϵͳ����ʱ��װ����
   rpm -i checkinstall-1.6.0beta4-1.i386.rpm

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

checkinstall-1.6.0beta4 # cd /usr/src/redhat/RPMS/i386/
i386 # rpm -i checkinstall-1.6.0beta4-1.i386.rpm
i386 #

Debian ���û�����ʹ��dpkg -i����װ�� Slackware�û��� installpkg���Դﵽͬ��Ŀ�ġ�

ʹ�ð���������IJ�ѯ��䣬����Լ�鰲װ�����ļ��Ƿ���ȫ�ڳ�����м�¼�ˣ������Բ鿴��װ��ͷ����һЩ������Ϣ���ڴˣ�ʹ�� RPM ��Ϊ���ӣ�

$ rpm -qi checkinstall
Name        : checkinstall            Relocations: (not relocatable)
Version     : 1.6.0beta4              Vendor     : (none)
Release     : 1                       Build Date : Mo 06 Dez 2004 17:05:45 CET
Install Date: Di 07 Dez 2004 01:41:49 Build Host : deimos.neo5k.lan
Group       : Applications/System     Source RPM : checkinstall-1.6.0beta4-1.src.rpm
Size        : 264621                  License    : GPL
Signature   : (none)
Packager    : checkinstall-1.6.0beta4
Summary     : CheckInstall installations tracker, version 1.6.0beta4
Description :
CheckInstall installations tracker, version 1.6.0beta4

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.

����

�����ͨ���޸��ļ�/usr/lib/local/checkinstall/checkinstallrcCheckInstall��Ĭ�����á�

����CheckInstallÿ�����ж���ѯ�����ɺ������Ͱ�װ�������ǵİ취�����ֹ��޸�/����INSTYPE��������������INSTALL��PAK_DIR��RPM_FLAGS����DPKG_FLAGSҲ��ֵ���Ƽ��ġ�����������������㶨��һЩ��ѡ�İ�װ��־��ͨ���޸�PAK_DIR�����ָ����װ���Ĵ洢Ŀ¼����INSTALL���������ֻ���ɰ�װ���ػ���һ����������ϰ�װ��

$ cat /usr/lib/local/checkinstall/checkinstallrc

####################################################################
                 #    CheckInstall configuration file   #
                 ########################################

####################################################################
# These are default settings for CheckInstall, modify them as you  #
# need. Remember that command line switches will override them.    #
####################################################################

# Debug level
#   0: No debug
#   1: Keep all temp files except the package's files
#   2: Keep the package's files too

DEBUG=0

# Location of the "installwatch" program
INSTALLWATCH_PREFIX="/usr/local"
INSTALLWATCH=${INSTALLWATCH_PREFIX}/bin/installwatch

# Location of the makepkg program. "makepak" is the default, and is
# included with checkinstall. If you want to use Slackware's native "makepkg"
# then set this to "makepkg"

MAKEPKG=/sbin/makepkg

# makepkg optional flags. These are recommended if running a newer Slackware
# version: "-l y -c n"

MAKEPKG_FLAGS="-l y -c n"

# Is MAKEPKG running interactively? If so, you might want
# to see what it's doing:

SHOW_MAKEPKG=0

# Where will we keep our temp files?
BASE_TMP_DIR=/var/tmp   ##  Don't set this to /tmp or / !!

# Where to place the installed document files
DOC_DIR=""

# Default architecture type (Leave it empty to allow auto-guessing)
ARCHITECTURE=""

# Default package type. Leave it empty to enable asking everytime
#   S : Slackware
#   R : RPM
#   D : Debian

INSTYPE="R"

# Storage directory for newly created packages
# By default they will be stored at the default
# location defined for the package type

PAK_DIR=""

# RPM optional flags
RPM_FLAGS=" --force --nodeps --replacepkgs "

# dpkg optional flags
DPKG_FLAGS=""


## These are boolean. Set them to 1 or 0

# Interactively show the results of the install command (i.e. "make install")?
# This is useful for interactive installation commands
SHOW_INSTALL=1

# Show Slackware package installation script while it runs? Again, useful if
# it's an interactive script
SHOW_SLACK_INSTALL=0

# Automatic deletion of "doc-pak" upon termination?
DEL_DOCPAK=1

# Automatic deletion of the spec file?
DEL_SPEC=1

# Automatic deletion of "description-pak"?
DEL_DESC=1

# Automatically strip all ELF binaries?
STRIP_ELF=1

# Automatically strip all ELF shared libraries?
# Note: this setting will automatically be set to "0" if STRIP_ELF=0
STRIP_SO_ELF=1

# Automatically search for shared libraries and add them to /etc/ld.so.conf?
# This is experimental and could mess up your dynamic loader configuration.
# Use it only if you know what you are doing.
ADD_SO=0

# Automatically compress all man pages?
COMPRESS_MAN=1

# Set the umask to this value
CKUMASK=0022

# Backup files overwritten or modified by your install command?
BACKUP=1 

# Write a doinst.sh file that installs your description (Slackware)?
AUTODOINST=1

# Are we going to use filesystem translation?
TRANSLATE=1            

# Reset the owner/group of all files to root.root?
RESET_UIDS=0

# Use the new (8.1+) Slackware description file format?
NEW_SLACK=1

# Comma delimited list of files/directories to be ignored
EXCLUDE=""

# Accept default values for all questions?
ACCEPT_DEFAULT=0

# Use "-U" flag in rpm by default when installing a rpm package
# This tells rpm to (U)pdate the package instead of (i)nstalling it.
RPM_IU=U

# Inspect the file list before creating the package
CK_INSPECT=0
      
# Review the .spec file before creating a .rpm
REVIEW_SPEC=0

# Review the control file before creating a .deb
REVIEW_CONTROL=0
      
# Install the package or just create it?
INSTALL=0

����

CheckInstall��һ�����������������ʹ�ù���Linux���ӷ��㡣�ر�����Դ����Ҫ�����ظ����������£�CheckInstall��������˿�����ƻ�ϵͳһ���Ե�ǰ������ȫ��ж�س������⣬�㻹����ʹ����Щ����õİ�װ��ֱ���������Ļ����ϰ�װ(���������±��룡)������Ȼ����ÿ������������໥�����ԣ�����������ͬ��Ļ�����һ�㲢����ʲô���⡣

Links

[1] http://asic-linux.com.mx/~izto/checkinstall/ [Home of CheckInstall]
[2] http://www.gnu.org/software/autoconf/manual/autoconf-2.57/autoconf.html [GNU Autoconf Online Manual]
�������ĵģ� http://littleone.go.nease.net/AutoConf.html[AutoConf �����ֲ�]
[3] http://asic-linux.com.mx/~izto/checkinstall/installwatch.html [Installwatch]
[4] http://asic-linux.com.mx/~izto/checkinstall/download.php [CheckInstall Downloads]
[5] http://asic-linux.com.mx/~izto/checkinstall/docs/RELNOTES [Release Notes]
[6] http://asic-linux.com.mx/~izto/checkinstall/docs/Changelog [Changelog]