checkinstall的安装与使用

checkinstall的安装与使用

介绍:checkinstall 是一款可以讲源代码包根据自己需求编译为我们自己需要的二进制包的一个软件

一、checkinstall的安装

1、源代码安装:由于过程相当复杂,而且小工具没必要浪费太多时间,不推荐

可以按下面的方式下载安装。

#wget http://asic-linux.com.mx/~izto/checkinstall/files/source/checkinstall-1.6.2.tar.gz

#tar zxvf checkinstall-1.6.2.tar.gz

#cd checkinstall-1.6.2

#make && make install

不过我在centos6.5 X64上安装时,并不像上面写的那么简单就可以使用,在安装过程中可能会遇到如下的问题,需要解决。

问题1、make时msgfmt报错

报错内容为:

/bin/sh: line 5: msgfmt: command not found

make: *** [all] Error 1

这里可以通过安装gettext包解决:

[root@localhost ~]#yum install gettext

[root@localhost ~]# rpm -qf /usr/bin/msgfmt

gettext-0.17-16.el6.x86_64

问题2、make时installwatch报错

报错内容如下:

代码如下复制代码

[root@localhost checkinstall-1.6.2]# make

for file in locale/checkinstall-*.po ; do

            case ${file} in 

                    locale/checkinstall-template.po)  ;; 

                    *) 

                            out=`echo $file | sed -s 's/po/mo/'` ; 

                            msgfmt -o ${out} ${file} ; 

                            if [ $? != 0 ] ; then 

                                    exit 1 ; 

                            fi ; 

                    ;; 

            esac ; 

    done

make -C installwatch

make[1]: Entering directory `/usr/local/src/checkinstall-1.6.2/installwatch’

gcc -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION=“0.7.0beta7” installwatch.c

installwatch.c:2942: error: conflicting types for ‘readlink’

/usr/include/unistd.h:828: note: previous declaration of ‘readlink’ was here

installwatch.c:3080: error: conflicting types for ‘scandir’

/usr/include/dirent.h:252: note: previous declaration of ‘scandir’ was here

make[1]: *** [installwatch.o] Error 1

make[1]: Leaving directory `/usr/local/src/checkinstall-1.6.2/installwatch’

make: *** [all] Error 2

出现该错误需要修改installwatch/installwatch.c文件,具体需要修改的部分如下:

将101行处修改

static int (*true_scandir)( const char *,struct dirent ***,

int (*)(const struct dirent *),

int (*)(const void *,const void *));

改为:

static int (*true_scandir)( const char *,struct dirent ***,

int (*)(const struct dirent *),

int (*)(const struct dirent **,const struct dirent **));

将121行处修改:

static int (*true_scandir64)( const char *,struct dirent64 ***,

int (*)(const struct dirent64 *),

int (*)(const void *,const void *));

改为:

static int (*true_scandir64)( const char *,struct dirent64 ***,

int (*)(const struct dirent64 *),

int (*)(const struct dirent64 **,const struct dirent64 **));

将2941行修改:

#if (GLIBC_MINOR <= 4)

改为

#if (0)

将3080行修改:

int scandir( const char *dir,struct dirent ***namelist,

int (*select)(const struct dirent *),

int (*compar)(const void *,const void *) ) {

改为:

int scandir( const char *dir,struct dirent ***namelist,

int (*select)(const struct dirent *),

int (*compar)(const struct dirent **,const struct dirent **) ) {

将3692行修改:

int scandir64( const char *dir,struct dirent64 ***namelist,

int (*select)(const struct dirent64 *),

int (*compar)(const void *,const void *) ) {

改为:

int scandir64( const char *dir,struct dirent64 ***namelist,

int (*select)(const struct dirent64 *),

int (*compar)(const struct dirent64 **,const struct dirent64 **) ) {

完成后再进行make即可。

在ubuntu上安装时,由于可以直接使用apt进行安装,所以没有遇到上面所说的问题。

二、checkinstall使用

编译自己要编译的源码之后使用checkinstall代替makeinstall命令,按照提示操作。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值