可执行文件简单打包成rpm文件

来源:互联网 发布:录音制作手机软件知乎 编辑:程序博客网 时间:2024/06/05 11:38

操作环境:CentOS_6.7-Minimal
首先安装rpm环境:
yum install rpm-build
yum install rpm-devel
yum install rpmdevtools
生成rpm运行环境:
rpmdev-setuptree
这时在root目录下会有rpmbuild文件,进入/root/rpmbuild/SPECS/,编辑打包脚本test.spec

Name:           testVersion:        1.1.1Release:        0Summary:        testGroup:          System Environment/DaemonsLicense:        GPLVendor:         MySelf.com %description%pre    %preun %postun   %clean %files%defattr (-,root,root,0777)/usr/local/test/etc/init.d/testctl%postchmod +x /etc/init.d/testctl/sbin/chkconfig -add testctl/sbin/chkconfig testctl on

将要打包的文件复制到rpmbuild/BUILDROOT/test-1.1.1-0.x86_64/usr/local/test目录下,
然后执行
rpmbuild -ba test.spec
此时在rpmbuild/RPMS/x86_64/目录会生成rpm打包文件。

原创粉丝点击