使用checkinstall 生成rpm報錯

1編譯報 msgfmt not found,解決方法

 此問題的解決方法:只需要安裝gettext包即可

2 make報錯

  1. installwatch.c:2942: error: conflicting types for 'readlink'  

  2. /usr/include/unistd.h:828: note: previous declaration of 'readlink' was here  

  3. installwatch.c:3080: error: conflicting types for 'scandir'  

  4. /usr/include/dirent.h:252: note: previous declaration of 'scandir' was here  

  5. installwatch.c:3692: error: conflicting types for 'scandir64'  

  6. /usr/include/dirent.h:275: note: previous declaration of 'scandir64' was here  


vim installwatch/installwatch.c


at line 101, change:
static int (*true_scandir)( const char *,struct dirent ***,
   int (*)(const struct dirent *),
   int (*)(const void *,const void *));

to:
static int (*true_scandir)( const char *,struct dirent ***,
   int (*)(const struct dirent *),
   int (*)(const struct dirent **,const struct dirent **));



at line 121, change:
static int (*true_scandir64)( const char *,struct dirent64 ***,
   int (*)(const struct dirent64 *),
   int (*)(const void *,const void *));

to:
static int (*true_scandir64)( const char *,struct dirent64 ***,
   int (*)(const struct dirent64 *),
   int (*)(const struct dirent64 **,const struct dirent64 **));

at line 2941, change:
#if (GLIBC_MINOR <= 4)
to:
#if (0)
at line 3080, change:
int scandir( const char *dir,struct dirent ***namelist,
 int (*select)(const struct dirent *),
 int (*compar)(const void *,const void *) ) {

to:
int scandir( const char *dir,struct dirent ***namelist,
 int (*select)(const struct dirent *),
 int (*compar)(const struct dirent **,const struct dirent **) ) {

at line 3692, change:
int scandir64( const char *dir,struct dirent64 ***namelist,
 int (*select)(const struct dirent64 *),
 int (*compar)(const void *,const void *) ) {

to:
int scandir64( const char *dir,struct dirent64 ***namelist,
 int (*select)(const struct dirent64 *),
 int (*compar)(const struct dirent64 **,const struct dirent64 **) ) {
完成後make
直接make install 雖然不會報錯但是在使用checkinstall 的時候,會報錯
“checkinstall error: File not found: /root/rpmbuild/BUILDROOT/”這種蛋疼的錯誤;

vim checkinstall
at line 495, change: CHECKINSTALLRC=${CHECKINSTALLRC:-${INSTALLDIR}/checkinstallrc}
to:
CHECKINSTALLRC=${CHECKINSTALLRC:-${INSTALLDIR}/lib/checkinstall/checkinstallrc}

at line 2466, change: $RPMBUILD -bb ${RPM_TARGET_FLAG}${ARCHITECTURE} "$SPEC_PATH" &> ${TMP_DIR}/rpmbuild.log
to:
$RPMBUILD -bb ${RPM_TARGET_FLAG}${ARCHITECTURE} --buildroot $BROOTPATH "$SPEC_PATH" &> ${TMP_DIR}/rpmbuild.log
Now, as root, run:
make install

在使用makeinstall 的時候如果報“/root/rpmbuild has no SOURCES driectory”的錯誤,執行mkdir -p /root/rpmbuild/SOURCES命令;

轉載:http://thinkman.blog.51cto.com/4217028/1135049

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章