制作nginx的RPM包教程
本文讲述了制作nginx的RPM包的方法,实例如下:
1.下载nginx源码,直接运行命令:
cd/root wgethttp://nginx.org/download/nginx-1.7.1.tar.gz
在拿到源码包之后,解压,并进入目录:
tarzxvfnginx-1.7.1.tar.gz cdnginx-1.7.1
2.编写SPEC文件
文件名为:nginx.spec
Summary:HighPerformanceWebServer Name:nginx Version:1.7.1 Release:el5 License:GPL Group:Applications/Server Source:http://nginx.org/download/nginx-%{version}.tar.gz URL:http://nginx.org/ Distribution:Linux Packager:yunjianfei<yunjianfei1987@gmail.com> BuildRoot:%{_tmppath}/%{name}-%{version}-%{release} %definesrcdir/root/nginx-1.7.1 %description nginx[enginex]isaHTTPandreverseproxyserver,aswellasamailproxyserver %prep %build cd%{srcdir} ./configure--prefix=/usr/local/nginx make-j8 %install cd%{srcdir} makeDESTDIR=%{buildroot}install %preun if[-z"`psaux|grepnginx|grep-vgrep`"];then killallnginx>/dev/null exit0 fi %files /usr/local/nginx
3.最后执行rpmbuild命令,打rpm包
rpmbuild-bbnginx.spec
至此,执行完毕之后,rpm包就打包完成了。