LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4018|回复: 11

制作你自己的slackware软件包--checkinstall使用详解

[复制链接]
发表于 2003-10-19 21:45:13 | 显示全部楼层 |阅读模式


checkinstall的简介请看realhyg的帖子:
http://www.linuxsir.cn/forum.php?mod=viewthread&tid=67811

checkinstall现在的最新版本是1.6.0beta2,稳定版本是1.5.3,可以到
http://asic-linux.com.mx/~izto/checkinstall/download.php
下载pkg包。
下载下来的文件为checkinstall-1.5.3-i386-1.tgz,请用installpkg 安装。

下面以zhcon为例,说明制作的过程。


tar zxvf zhcon-0.2.3.tar
cd zhcon-0.2.3
./configure
make


上面这几步同从源代码编译安装一样,如果不用checkinstall制作slackware软件包,下一步该是make install了。我们要用checkinstall,所以用执行checkinstall代替。

在运行checkinstall之前,要在当前目录下创建一个对这个软件包的描述文件description-pak,但这个文件不是必须的。


cat > description-pak
zhcon-0.2.3
Zhcon is a fast Linux Console Chinese System which supports
framebuffer device.It can display Chinese, Japanese or Korean
double byte characters.Supported language encodings include:
GB2312, GBK, BIG5, JIS and KSC.


另外还可以在当前目录下创建4个特殊的脚本文件preinstall-pak, postinstall-pak, preremove-pak和postremove-pak。
preinstall-pak在被安装之前执行,postinstall-pak在被安装之后执行,preremove-pak在被删除之前执行,postremove-pak在被删除之后执行。同样,这4个脚本文件不是必须的。
如果要制作的软件有一些特殊的要求,比如创建一个特殊的用户或者组,这4个脚本就有作用了。

然后在当前目录下创建一个doc-pak的目录,这个目录是用来存放软件的相关文档的。比如说README, INSTALL, COPYING, Changelog, TODO, CREDITS等文件。这些文件在安装软件包时将被拷到/usr/doc/”软件包名称“目录下。如果你现在不创建,在生成软件包时将提醒你是否创建这个目录和拷贝相关文件,如果你再选择否,那么制作的软件包将没有文档。


下面开始用checkinstall创建软件包了,在执行之前确保你是root用户。执行checkinstall。


checkinstall


如果开始你没有创建doc-pak目录,此时将会提示你是否创建。


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


按y自动创建和拷贝,按n取消。
下面checkinstall将创建安装软件包,checkinstall默认安装命令是 make install,你得根据你的软件安装说明具体而定,有些软件的安装命令不是make install,而是其他,你则换成

  checkinstall make modules_install
  checkinstall install.sh
  checkinstall setup

等形式。这样,我们也可以把一些以二进制包发布的软件用checkinstall创建为slackware的软件包,只要再checkinstall后面加上安装指令作为参数即可。
下一步checkinstall将会询问创建什么软件包,


Please choose the packaging method you want to use.
Slackware [S], RPM [R] or Debian [D]?


选择s创建slackware的pkg软件包,选r创建redhat的rpm软件包,选d创建debian的deb软件包。我们选择s继续。


This package will be built according to these values:

1 -  Summary: [ zhcon-0.2.3 ]
2 -  Name:    [ zhcon ]
3 -  Version: [ 0.2.3 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ i386 ]
8 -  Source location: [ zhcon-0.2.3 ]
9 -  Alternate source location: [  ]

Enter a number to change any of them or press ENTER to continue:


checkinstall给出一个菜单让你选择修改软件包的一些属性,想修改就按对应的数字键,否则回车继续。我们按7修改软件包的系统平台,


Enter the architecture type:
>> i686

This package will be built according to these values:

1 -  Summary: [ zhcon-0.2.3 ]
2 -  Name:    [ zhcon ]
3 -  Version: [ 0.2.3 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ i686 ]
8 -  Source location: [ zhcon-0.2.3 ]
9 -  Alternate source location: [  ]

Enter a number to change any of them or press ENTER to continue:


然后回车继续,checkinstall将会在当前目录生成制作好的pkg软件包并安装它。
我们的软件包创建到此成功结束。
发表于 2003-12-25 19:42:20 | 显示全部楼层
makepkg
Creates a new Slackware compatible package. The program uses the contents of the current directory to create the package.
在官方网站上看到的,用这个命令可不可以啊?
发表于 2003-12-25 23:40:58 | 显示全部楼层
好像有些软件用checkinstall打包不大好~
makepkg没试过
 楼主| 发表于 2003-12-26 20:21:43 | 显示全部楼层
最初由 pingY 发表
makepkg
Creates a new Slackware compatible package. The program uses the contents of the current directory to create the package.
在官方网站上看到的,用这个命令可不可以啊?


checkinstall就是调用makepkg制作pkg包的。
发表于 2003-12-28 08:34:50 | 显示全部楼层
顶~~~
发表于 2004-5-26 07:26:12 | 显示全部楼层
楼顶兄弟能否把编译好的zhcon给我发过来??
我现在还没有slack,像再红旗下编译,可是make事老出错
也不知道是软件的问题,还是红旗的问题
拜托了,谢谢
发表于 2004-5-26 12:36:52 | 显示全部楼层
zhcon老有退出后黑屏的毛病,建议用cce,什么毛病都没有!
发表于 2004-5-26 13:45:28 | 显示全部楼层

cce老是有退出后黑屏

zhcon没有,在2.6.6内核上通过。
发表于 2004-5-26 15:56:33 | 显示全部楼层
晕:!!
发表于 2004-11-14 00:56:32 | 显示全部楼层
cce是什莫?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表