本文讲述了制作nginx的RPM包的方法,实例如下:
1. 下载nginx源码,直接运行命令:
在拿到源码包之后,解压,并进入目录:
1 2 | tar zxvf nginx-1.7.1.tar.gz
cd nginx-1.7.1
|
Salin selepas log masuk
2. 编写SPEC文件
文件名为:nginx.spec
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | Summary: High Performance Web Server
Name: nginx
Version: 1.7.1
Release: el5
License: GPL
Group: Applications/Server
Source: http:
URL: http:
Distribution: Linux
Packager: yunjianfei <yunjianfei1987@gmail.com>
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
%define srcdir /root/nginx-1.7.1
%description
nginx [engine x] is a HTTP and reverse proxy server, as well as a mail proxy server
%prep
%build
cd %{srcdir}
./configure --prefix=/usr/local/nginx
make -j8
%install
cd %{srcdir}
make DESTDIR=%{buildroot} install
%preun
if [ -z "`ps aux | grep nginx | grep -v grep`" ];then
killall nginx >/dev/null
exit 0
fi
%files
/usr/local/nginx
|
Salin selepas log masuk
3. 最后执行rpmbuild命令,打rpm包
至此,执行完毕之后,rpm包就打包完成了。
更多制作nginx的RPM包教程相关文章请关注PHP中文网!