将源码包制作成RPM包 1、素材 nginx-1.8.0.tar.gz nginx.service 2、安装打包工具 [root@vh01 ~]# yum install -y rpm-build 3、生成工作目录 [root@vh01 ~]# vim nginx.spec #直接存盘退出 [root@vh01 ~]# rpmbuild -ba nginx.spec #出现任何错误,忽略,运行完后,生成了rpmbuild目录 4、把素材放到正确目录 [root@vh01 ~]# mv nginx-1.8.0.tar.gz rpmbuild/SOURCES/ [root@vh01 ~]# mv nginx.s* rpmbuild/SPECS/ 5、修改说明文件 [root@vh01 ~]# vim rpmbuild/SPECS/nginx.spec 6、安装依赖包 [root@vh01 ~]# yum install -y gcc openssl-devel zlib-devel pcre-devel 7、生成rpm包 [root@vh01 ~]# rpmbuild -ba rpmbuild/SPECS/nginx.spec 8、验证 [root@vh01 ~]# ls rpmbuild/RPMS/x86_64/ [root@vh01 ~]# rpm -q nginx [root@vh01 ~]# rpm -ihv rpmbuild/RPMS/x86_64/nginx-1.8.0-1.el7.x86_64.rpm [root@vh01 ~]# rpm -q nginx [root@vh01 ~]# yum info nginx [root@vh01 ~]# systemctl start nginx.service [root@vh01 ~]# systemctl status nginx.service