This article describes the method of making nginx RPM package. The examples are as follows:
1. Download the nginx source code and run the command directly:
cd /root wget http://nginx.org/download/nginx-1.7.1.tar.gz
After getting the source code package, unzip it and enter the directory:
tar zxvf nginx-1.7.1.tar.gz cd nginx-1.7.1
2. Write the SPEC file
The file name is: 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. Finally execute the rpmbuild command and create the rpm package
rpmbuild -bb nginx.spec
At this point, after the execution is completed, the rpm package is packaged.
For more articles related to the RPM package tutorial for making nginx, please pay attention to the PHP Chinese website!