This article describes the method for making nginx RPM packages, examples are as follows:
1. Download Nginx source, direct operation command:
Cd/root
wget http://nginx.org/download/nginx-1.7.1.tar.gz
After you get the source package, unpack and enter the directory:
Tar zxvf nginx-1.7.1.tar.gz
CD nginx-1.7.1
2. Prepare Spec Documents
File name: 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 OK 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 executes the Rpmbuild command, hits the RPM package
At this point, after the execution, the RPM package is finished.