制作nginx的RPM包教程

发布时间:2022-04-24 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了制作nginx的RPM包教程脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

本文讲述了制作nginx的rpm包的方法,实例如下:

1. 下载nginx码,直接运行命令:

cd /root
wget http://nginx.org/download/nginx-1.7.1.tar.gz

在拿到源码包之后,解压,并进入目录:

tar zxvf nginx-1.7.1.tar.gz
cd nginx-1.7.1

2. 编写SPEC文件

文件名为:nginx.spec

Summary: High Performance Web Server
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}
%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

3. 最后执行rpmbuild命令,打rpm包

rpmbuild -bb nginx.spec

至此,执行完毕之后,rpm包就打包完成了。

脚本宝典总结

以上是脚本宝典为你收集整理的制作nginx的RPM包教程全部内容,希望文章能够帮你解决制作nginx的RPM包教程所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:制作制作