导读 今天小编跟大家讲解下有关制作nginx的RPM包教程 ,相信小伙伴们对这个话题应该也很关注吧,小编也收集到了有关制作nginx的RPM包教程 的相
今天小编跟大家讲解下有关制作nginx的RPM包教程 ,相信小伙伴们对这个话题应该也很关注吧,小编也收集到了有关制作nginx的RPM包教程 的相关资料,希望小伙伴会喜欢也能够帮助大家。
本文讲述了制作nginx的RPM包的方法,实例如下:
1. 下载nginx源码,直接运行命令:
cd /rootwget http://nginx.org/download/nginx-1.7.1.tar.gz在拿到源码包之后,解压,并进入目录:
tar zxvf nginx-1.7.1.tar.gzcd nginx-1.7.12. 编写SPEC文件
文件名为:nginx.spec
Summary: High Performance Web ServerName: nginxVersion: 1.7.1Release: el5License: GPLGroup: Applications/ServerSource: http://nginx.org/download/nginx-%{version}.tar.gzURL: http://nginx.org/Distribution: LinuxPackager: yunjianfei <yunjianfei1987@gmail.com>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}%define srcdir /root/nginx-1.7.1%descriptionnginx [engine x] is a HTTP and reverse proxy server, as well as a mail proxy server%prep%buildcd %{srcdir}./configure --prefix=/usr/local/nginxmake -j8%installcd %{srcdir}make DESTDIR=%{buildroot} install%preunif [ -z"`ps aux | grep nginx | grep -v grep`"];then killall nginx >/dev/null exit 0fi%files/usr/local/nginx3. 最后执行rpmbuild命令,打rpm包
rpmbuild -bb nginx.spec至此,执行完毕之后,rpm包就打包完成了。
来源:爱蒂网