用Checkinstall制作你自己的RPM
很简单。
1 搜索checkinstall,到主页下载1.6beta3的源码(rpm对FC无效,要打补丁) 2 补丁在此 --- checkinstall-1.6.0beta3/installwatch-0.7.0beta3/installwatch.c 2003-12-26 02:30:42.000000000 -0500 +++ checkinstall-1.6.0beta3.mine/installwatch-0.7.0beta3/installwatch.c 2004-05-21 23:25:16.353557696 -0400 @@ -273,8 +273,10 @@ */ static void *libc_handle=NULL; +static void initialize(void) { + if (libc_handle) + return; -void _init(void) { #ifdef BROKEN_RTLD_NEXT // printf ("RTLD_LAZY"); libc_handle = dlopen(LIBC_VERSION, RTLD_LAZY); @@ -328,6 +330,10 @@ if(instw_init()) exit(-1); } +void _init(void) { + initialize(); +} + void _fini(void) { instw_fini(); } @@ -2043,6 +2049,9 @@ time_t time (time_t *timer) { TIMECOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"time\n"); #endif @@ -2059,6 +2068,9 @@ instw_t instw; int status; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"chdir(%s)n",pathname); #endif @@ -2093,6 +2105,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"chmod(%s,mode)\n",path); #endif @@ -2129,6 +2144,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"chown(%s,owner,group)\n",path); #endif @@ -2165,6 +2183,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"chroot(%s)\n",path); #endif @@ -2186,6 +2207,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"creat(%s,mode)\n",pathname); #endif @@ -2220,6 +2244,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"fchmod\n"); #endif @@ -2234,6 +2261,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"fchown\n"); #endif @@ -2250,6 +2280,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"fopen(%s,%s)\n",pathname,mode); #endif @@ -2299,6 +2332,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"ftruncate\n"); #endif @@ -2314,6 +2350,9 @@ char *wptr; size_t wsize; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"getcwd(%p,%ld)\n",buffer,(long int)size); #endif @@ -2363,6 +2402,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"lchown(%s,owner,group)\n",path); #endif @@ -2400,6 +2442,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"link(%s,%s)\n",oldpath,newpath); #endif @@ -2441,6 +2486,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"mkdir(%s,mode)\n",pathname); #endif @@ -2475,6 +2523,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"mknod(%s,mode,dev)\n",pathname); #endif @@ -2514,6 +2565,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"open(%s,%d,mode)\n",pathname,flags); #endif @@ -2563,6 +2617,9 @@ DIR *result; instw_t instw; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"opendir(%s)\n",dirname); #endif @@ -2592,6 +2649,9 @@ struct dirent *readdir(DIR *dir) { struct dirent *result; + if (!libc_handle) + initialize(); + #if DEBUG debug(3,"readdir(%p)\n",dir); #endif @@ -2617,6 +2677,9 @@ instw_t instw; int status; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"readlink(\"%s\",%p,%ld)\n",path,buf,(long int)bufsiz); #endif @@ -2649,6 +2712,9 @@ char *realpath(const char *file_name,char *resolved_name) { char *result; + if (!libc_handle) + initialize(); + /* We were asked to work in "real" mode */ if( !(__instw.gstatus & INSTW_INITIALIZED) || !(__instw.gstatus & INSTW_OKWRAP) ) { @@ -2668,6 +2734,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"rename(\"%s\",\"%s\")\n",oldpath,newpath); #endif @@ -2709,6 +2778,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"rmdir(%s)\n",pathname); #endif @@ -2739,6 +2811,9 @@ int (*compar)(const void *,const void *) ) { int result; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"scandir(%s,%p,%p,%p)\n",dir,namelist,select,compar); #endif @@ -2760,6 +2835,9 @@ instw_t instw; int status; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"stat(%s,%p)\n",pathname,info); #endif @@ -2799,6 +2877,9 @@ instw_t instw; int status; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"lstat(%s,%p)\n",pathname,info); #endif @@ -2840,6 +2921,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"symlink(%s,%s)\n",pathname,slink); #endif @@ -2880,6 +2964,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"truncate(%s,length)\n",path); #endif @@ -2916,6 +3003,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"unlink(%s)\n",pathname); #endif @@ -2949,6 +3039,9 @@ int result; instw_t instw; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"utime(%s,newtimes)\n",pathname); #endif @@ -2987,6 +3080,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"creat64(%s,mode)\n",pathname); #endif @@ -3021,6 +3117,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"ftruncate64\n"); #endif @@ -3037,6 +3136,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"fopen64(%s,%s)\n",pathname,mode); #endif @@ -3089,6 +3191,9 @@ REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"open64(%s,%d,mode)\n",pathname,flags); #endif @@ -3138,6 +3243,9 @@ struct dirent64 *readdir64(DIR *dir) { struct dirent64 *result; + if (!libc_handle) + initialize(); + #if DEBUG debug(3,"readdir64(%p)\n",dir); #endif @@ -3163,6 +3271,9 @@ int (*compar)(const void *,const void *) ) { int result; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"scandir64(%s,%p,%p,%p)\n",dir,namelist,select,compar); #endif @@ -3261,8 +3372,14 @@ int result; instw_t instw; + if (!libc_handle) + initialize(); + REFCOUNT; + if (!libc_handle) + initialize(); + #if DEBUG debug(2,"truncate64(%s,length)\n",path); #endif 把上面的补丁拷贝到一个文本中,取名 abc.patch 3 解压源码包,把补丁放到里面,然后命令: cat abc.patch | patch -p1 2> out 4 make 5 以root的身分运行 make install checkinstall安装好了 以后安装软件: ./configure make su - (注意后面有"-") 输入密码 回到你编译的目录 checkintall 回答几个问题,第一个回答是y 最后会告诉你RPM已经制作好了,放在哪里。 自己做RPM的好处是:自由灵活,方便管理,没有倚赖。 用这种方法我自己为FC3制作了scim和scim-chinese的rpm。 SCIM已经在使用中了。 |
|