checkinstall the correct way to install centos 6.9

First, unzip

    tar -zxvf checkinstall-1.6.2.tar.gz
    cd checkinstall-1.6.2

Two, make the compiler
  may appear the following error

            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
            installwatch.c:3692: error: conflicting types for 'scandir64'
            /usr/include/dirent.h:275: note: previous declaration of 'scandir64' was here

  Solution :() is to change the red part of the
  line 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安装

Three, checkinstall modify the source file in the folder
  
line 495:
checkinstallrc = $ {checkinstallrc: - $ {INSTALLDIR} /} checkinstallrc
changed
CHECKINSTALLRC = $ {CHECKINSTALLRC: - $ {INSTALLDIR} / lib / checkinstall / checkinstallrc}

            行2466:
        $RPMBUILD -bb ${RPM_TARGET_FLAG}${ARCHITECTURE} "$SPEC_PATH" &> ${TMP_DIR}/rpmbuild.log
            改成
        $RPMBUILD -bb ${RPM_TARGET_FLAG}${ARCHITECTURE} --buildroot $BROOTPATH "$SPEC_PATH" &> ${TMP_DIR}/rpmbuild.log

Fourth, and finally execute: make install

Guess you like

Origin blog.51cto.com/fanyk/2414590