LUPA首页 | 资讯 | 教程 | 下载 | 求职 | 方案 | 博客 | 交易 | 英文版
LUPA论坛


 
标题: 实例说明:利用工具方便、快捷的生成RPM与DEB包
本帖已经被作者加入个人空间
zhull1052
开源主力军
Rank: 3Rank: 3



UID 73681
精华 0
积分 1441
帖子 117
LUPA币 1382 点
阅读权限 30
注册 2007-10-19
发表于 2008-5-11 17:11  资料 个人空间 短消息 
实例说明:利用工具方便、快捷的生成RPM与DEB包

操作1:工具包的下载
下载地址:
http://asic-linux.com.mx/~izto/checkinstall/files/rpm/checkinstall-1.6.1-1.i386.rpm
操作2:安装工具包
[root@localhost home]#rpm –ivh checkinstall-1.6.1-1.i386.rpm
操作3:源码文件内容
[root@localhost hello]# ls
aclocal.m4      configure       description-pak  Makefile.am    pics
autom4te.cache  configure.in    hello.c          Makefile.in
autoscan.log    configure.scan  hello.h          missing
config.h.in     depcomp         install-sh       mkinstalldirs

操作4:配置源码文件
[root@localhost hello]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands

操作5:编译源码
[root@localhost hello]# make
make  all-am
make[1]: Entering directory `/home/hello'
source='hello.c' object='hello.o' libtool=no \
depfile='.deps/hello.Po' tmpdepfile='.deps/hello.TPo' \
depmode=gcc3 /bin/sh ./depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c `test -f 'hello.c' || echo './'`hello.c
gcc  -g -O2   -o hello  hello.o
make[1]: Leaving directory `/home/hello'

操作6:生成RPM包或DEB包
[root@localhost hello]# checkinstall        #此处也可以输入命令checkinstall -R直接生成RPM

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

The checkinstallrc file was not found at:
/usr/local/lib/checkinstall/checkinstallrc

Assuming default values.

The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs?  [y]: y     

准备软件包的文档……OK

*** No known documentation files were found. The new package
*** won't include a documentation directory.

Please choose the packaging method you want to use.
Slackware [S], RPM [R] 还是 Debian [D]?R        #R表示生成RPM包,D表示生成DEB包


**************************************
**** RPM package creation selected ***
**************************************

This package will be built according to these values:

1 -  Summary: [ hello-1.0-3.tar.gz ]
2 -  Name:    [ hello ]
3 -  Version: [ 1.0 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ i386 ]
8 -  Source location: [ hello ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ hello ]

输入一个数字来改变它们,或按回车键继续:1        

#此为输入要修改的行号,如1表示设置summary内容
Enter new summary:
>> hello for linux提    #输入设置或修改的内容

This package will be built according to these values:

1 -  Summary: [ hello for linux ]
2 -  Name:    [ hello ]
3 -  Version: [ 1.0 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ i386 ]
8 -  Source location: [ hello ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ hello ]

输入一个数字来改变它们,或按回车键继续:4
Enter new release number:
>> 3

This package will be built according to these values:

1 -  Summary: [ hello for linux ]
2 -  Name:    [ hello ]
3 -  Version: [ 1.0 ]
4 -  Release: [ 3 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ i386 ]
8 -  Source location: [ hello ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ hello ]

输入一个数字来改变它们,或按回车键继续:

Installing with make install...

========================= Installation results ===========================
make[1]: Entering directory `/home/hello'
/bin/sh ./mkinstalldirs /usr/local/bin
  /usr/bin/install -c hello /usr/local/bin/hello
make[1]: Nothing to be done for `install-data-am'.
make[1]: Leaving directory `/home/hello'

======================== Installation successful ==========================
cp:是否覆盖‘//var/tmp/LolgSDErNJnkWFcigqHAF/newfiles’? y

把文件拷贝到临时目录……OK

Striping ELF 二进制文件……OK

压缩 man 手册页……OK

创建文件列表……rm:是否删除一般文件‘/var/tmp/LolgSDErNJnkWFcigqHAF/newfiles’? y
OK
mv:是否覆盖‘/var/tmp/LolgSDErNJnkWFcigqHAF/newfiles.tmp’? y

创建 RPM 包……OK

NOTE: The package will not be installed

删除临时文件……OK

删除 doc-pak 目录……OK

生成备份包……OK

删除临时目录……OK


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

Done. The new package has been saved to

/usr/src/redhat/RPMS/i386/hello-1.0-3.i386.rpm
You can install it in your system anytime using:

      rpm -i hello-1.0-3.i386.rpm
#此时就生成了rpm包了
**********************************************************************

顶部
[广告] 推荐个超酷的web2.0相册
 


当前时区 GMT+8, 现在时间是 2008-7-21 02:51
浙ICP备06002895号

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.035481 second(s), 7 queries , Gzip enabled

清除 Cookies - 联系我们 - LUPA开源社区 - Archiver - WAP