RPM包制作方法
最近有同学问我制作RPM包相关的问题,我发现我以前做过,但是忘记记录了,现在记录一下:
以打包nginx并带有nginx-rtmp的工程为rpm为例:
首先,需要安装一个rpmbuild:
点击(此处)折叠或打开
安装完成之后,系统中可以使用rpmbuild命令
然后下载nginx与nginx-rtmp,当然,做包的前提是我们手动能够编译,安装nginx+nginx-rtmp
接下来就可以开始写spec,因为打包rpm时,rpmbuild会根据spec来进行操作,将源码包解压,然后按照我们的手动操作的步骤进行操作,最后打包成rpm
所以,关键要把spec写好:
点击(此处)折叠或打开
spec写完后,将源码包放在SOURCE目录下即可,一般是在/root/rpmbuild下面
点击(此处)折叠或打开
然后rpmbuild -ba 刚刚生成的nginx.spec即可
输出如下
点击(此处)折叠或打开
然后即可看到生成的rpm包
点击(此处)折叠或打开
文件生成完毕