%define _topdir /qihoo/Centos/
%define _specdir %{_topdir}/SPEC
%define _rpmdir %{_topdir}/
%define _srcrpmdir %{_topdir}/SRPMS
%define _sourcedir %{_topdir}/SOURCES
%define _tmppath %{_topdir}/tmp
%define _builddir %{_topdir}/BUILD
%define _prefix /usr/local/nginx
%define _docroot_dir /usr/local/nginx/html
Summary: qihoo custom nginx package
Name: qihoo-ops-nginx #生成rpm的名称叫什么
Version: 1.6.1
Release: 1_qihoo.el6
Vendor: gehailong <gehailong@360.cn>
Source: nginx-%{version}.tar.gz #source主要是引用一下自己定义好的脚本,配置文件之类的内容。
Source1: nginx.conf #nginx在主配置文件里面做了很多优化,包括cpu抢占,各种缓存策略,tcp,进程数等。
Source2: sysctl.conf
Source3: root.tar.gz
#Source4: nginx-module.tar.gz
Source5: nginx.logrotate #为了防止nginx日志文件逐渐增大,影响读写效率,对nginx日志定期进行切割。
Source6: nginx.init
Source7: fastcgi.conf
URL: http://w2.addops.bjt.qihoo.net:8360
License: GPL
Group: Applications/Internet
Buildroot:%{_tmppath}/%{name}-%{version}-root/
Requires: bash openssl-devel curl-develpcre pcre-devel openssl #主要定义了nginx依赖的一些rpm包。就是在yum装的时候依赖的包。
Autoreq: no
%description
qihoo custom nginx RPM
%prep
%setup -q -n nginx-%{version}
%build #这个阶段就是configure阶段。
./configure \
--prefix=%{_prefix} \
--with-http_stub_status_module \
--with-http_ssl_module \
make %{?_smp_mflags} #make阶段
%install #make install阶段
[ $RPM_BUILD_ROOT != "/" ]&& rm -rf $RPM_BUILD_ROOT