%define nginx_user nginx %define nginx_group %{nginx_user} %define nginx_home %{_localstatedir}/lib/nginx %define nginx_home_tmp %{nginx_home}/tmp %define nginx_logdir %{_localstatedir}/log/nginx %define nginx_confdir %{_sysconfdir}/nginx %define nginx_datadir %{_datadir}/nginx %define nginx_webroot %{nginx_datadir}/html %define waf_version 2.8.0 %define libxml2_version 2.6.29 %define libxml2_build_path %{_tmppath}/libxml2-%{libxml2_version} Name: nginx Version: 1.6.2 Release: 23 Summary: Robust, small and high performance HTTP and reverse proxy server Group: System Environment/Daemons # BSD License (two clause) # http://www.freebsd.org/copyright/freebsd-license.html License: BSD URL: http://nginx.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pcre-devel,zlib-devel,openssl-devel,perl(ExtUtils::Embed) %if 0%{?fedora} > 6 BuildRequires: perl-devel %endif # Modsec BuildRequires: httpd-devel lua-devel curl-devel BuildRequires: libxslt-devel,GeoIP-devel,gd-devel #%if 0%{?el5} #BuildRequires: asl-libxml2-devel #%else BuildRequires: libxml2-devel #%endif %if 0%{?fedora} >= 18 BuildRequires: apr-util-devel %endif Requires: pcre,openssl,GeoIP,gd Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) # for /usr/sbin/useradd Requires(pre): shadow-utils Requires(post): chkconfig # for /sbin/service Requires(preun): chkconfig, initscripts Requires(postun): initscripts Provides: webserver Source0: http://sysoev.ru/nginx/nginx-%{version}.tar.gz Source1: %{name}.init Source2: %{name}.logrotate Source3: virtual.conf Source4: ssl.conf Source5: %{name}.sysconfig Source6: nginx.conf Source7: default.conf Source100: index.html Source101: atomicorp_logo.png Source102: nginx-logo.png Source103: 50x.html Source104: 404.html Source105: atomic_bg.png Source106: gradient_bg.png Source107: ngx_cache_purge-2.1.tar.gz Source108: modsecurity-%{waf_version}.tar.gz Source109: ngx_pagespeed-release-1.6.29.5-beta.tar.gz Source200: libxml2-%{libxml2_version}.tar.gz # removes -Werror in upstream build scripts. -Werror conflicts with # -D_FORTIFY_SOURCE=2 causing warnings to turn into errors. Patch0: nginx-auto-cc-gcc.patch Patch100: apache-2.2.3-version-2.8.0.patch %description Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server written by Igor Sysoev. %prep %setup -q %setup -T -D -a 107 -a 108 -a 109 %patch0 -p0 # RHEL5 is a pain %if 0%{?rhel} < 6 %patch100 -p0 tar xfvz %{SOURCE200} cd libxml2-%{libxml2_version} ./configure --prefix=%{libxml2_build_path} make make install %endif %build pushd modsecurity-%{waf_version} build mod_security library first %configure \ %if 0%{?rhel} < 6 --with-libxml=%{libxml2_build_path} \ %endif --enable-standalone-module --enable-pcre-match-limit=no --enable-pcre-match-limit-recursion=no make || : cd standalone make install-exec-hook || : popd # nginx does not utilize a standard configure script. It has its own # and the standard configure options cause the nginx configure script # to error out. This is is also the reason for the DESTDIR environment # variable. The configure script(s) have been patched (Patch1 and # Patch2) in order to support installing into a build environment. # Psol library is available binary only it appears #--add-module=%{_builddir}/nginx-%{version}/ngx_pagespeed-release-1.6.29.5-beta \ export DESTDIR=%{buildroot} ./configure \ --prefix=%{nginx_datadir} \ --sbin-path=%{_sbindir}/%{name} \ --conf-path=%{nginx_confdir}/%{name}.conf \ --error-log-path=%{nginx_logdir}/error.log \ --http-log-path=%{nginx_logdir}/access.log \ --http-client-body-temp-path=%{nginx_home_tmp}/client_body \ --http-proxy-temp-path=%{nginx_home_tmp}/proxy \ --http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \ --http-uwsgi-temp-path=%{nginx_home_tmp}/uwsgi \ --http-scgi-temp-path=%{nginx_home_tmp}/scgi \ --pid-path=%{_localstatedir}/run/%{name}.pid \ --lock-path=%{_localstatedir}/lock/subsys/%{name} \ --user=%{nginx_user} \ --group=%{nginx_group} \ --with-file-aio \ --with-ipv6 \ --with-http_ssl_module \ --with-http_spdy_module \ --with-http_realip_module \ --with-http_addition_module \ --with-http_xslt_module \ --with-http_image_filter_module \ --with-http_geoip_module \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_module \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-http_random_index_module \ --with-http_secure_link_module \ --with-http_degradation_module \ --with-http_stub_status_module \ --with-http_perl_module \ --with-mail \ --with-mail_ssl_module \ --with-pcre \ %if 0%{?with_gperftools} --with-google_perftools_module \ %endif --with-debug \ --add-module=%{_builddir}/nginx-%{version}/modsecurity-%{waf_version}/nginx/modsecurity \ --add-module=%{_builddir}/nginx-%{version}/ngx_cache_purge-2.1 \ --with-cc-opt="%{optflags} $(pcre-config --cflags)" \ --with-ld-opt="-Wl,-E" # so the perl module finds its symbols #make %{?_smp_mflags} make %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} INSTALLDIRS=vendor find %{buildroot} -type f -name .packlist -exec rm -f {} \; find %{buildroot} -type f -name perllocal.pod -exec rm -f {} \; find %{buildroot} -type f -empty -exec rm -f {} \; find %{buildroot} -type f -exec chmod 0644 {} \; find %{buildroot} -type f -name '*.so' -exec chmod 0755 {} \; chmod 0755 %{buildroot}%{_sbindir}/nginx %{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name} %{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} %{__install} -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/%{name} %{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d %{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE7} %{buildroot}%{nginx_confdir}/conf.d %{__install} -p -m 0644 %{SOURCE6} %{buildroot}%{nginx_confdir} %{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp} %{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir} %{__install} -p -d -m 0755 %{buildroot}%{nginx_webroot} %{__install} -p -m 0644 %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{SOURCE105} %{SOURCE106} %{buildroot}%{nginx_webroot} # ngx_cache_purge mv ngx_cache_purge-2.1/CHANGES ngx_cache_purge-2.1/CHANGES.ngx_cache_purge mv ngx_cache_purge-2.1/README.md ngx_cache_purge-2.1/README.ngx_cache_purge mv ngx_cache_purge-2.1/LICENSE ngx_cache_purge-2.1/LICENSE.ngx_cache_purge # convert to UTF-8 all files that give warnings. for textfile in CHANGES do mv $textfile $textfile.old iconv --from-code ISO8859-1 --to-code UTF-8 --output $textfile $textfile.old rm -f $textfile.old done %clean rm -rf %{buildroot} %if 0%{?rhel} == 5 rm -rf %{libxml2_build_path} %endif %pre if [ $1 == 1 ]; then %{_sbindir}/useradd -c "Nginx user" -s /bin/false -r -d %{nginx_home} %{nginx_user} 2>/dev/null || : fi %post if [ $1 == 1 ]; then /sbin/chkconfig --add %{name} fi %preun if [ $1 = 0 ]; then /sbin/service %{name} stop >/dev/null 2>&1 /sbin/chkconfig --del %{name} fi %postun if [ $1 == 2 ]; then /sbin/service %{name} upgrade || : fi %files %defattr(-,root,root,-) %doc LICENSE CHANGES README ngx_cache_purge-2.1/CHANGES.ngx_cache_purge ngx_cache_purge-2.1/README.ngx_cache_purge ngx_cache_purge-2.1/LICENSE.ngx_cache_purge %{nginx_datadir}/ %{_sbindir}/%{name} %{_mandir}/man3/%{name}.3pm.gz %{_initrddir}/%{name} %dir %{nginx_confdir} %dir %{nginx_confdir}/conf.d %dir %{nginx_logdir} %config(noreplace) %{nginx_confdir}/conf.d/*.conf %config(noreplace) %{nginx_confdir}/win-utf %config(noreplace) %{nginx_confdir}/%{name}.conf.default %config(noreplace) %{nginx_confdir}/mime.types.default %config(noreplace) %{nginx_confdir}/fastcgi.conf %config(noreplace) %{nginx_confdir}/fastcgi.conf.default %config(noreplace) %{nginx_confdir}/fastcgi_params %config(noreplace) %{nginx_confdir}/fastcgi_params.default %config(noreplace) %{nginx_confdir}/scgi_params %config(noreplace) %{nginx_confdir}/scgi_params.default %config(noreplace) %{nginx_confdir}/uwsgi_params %config(noreplace) %{nginx_confdir}/uwsgi_params.default %config(noreplace) %{nginx_confdir}/koi-win %config(noreplace) %{nginx_confdir}/koi-utf %config(noreplace) %{nginx_confdir}/%{name}.conf %config(noreplace) %{nginx_confdir}/mime.types %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %dir %{perl_vendorarch}/auto/%{name} %{perl_vendorarch}/%{name}.pm %{perl_vendorarch}/auto/%{name}/%{name}.so %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home} %attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp} %changelog * Tue Sep 23 2014 Atomicorp - 1.6.2-23 - Update to 1.6.2 * Mon Aug 18 2014 Atomicorp - 1.6.1-22 - Update to 1.6.1 * Mon May 5 2014 Atomicorp - 1.6.0-21 - Update to 1.6.0 * Thu Apr 10 2014 Atomicorp - 1.4.7-20 - Relinked for el6 * Tue Apr 8 2014 Atomicorp - 1.4.7-19 - Update to 1.4.7 * Thu Mar 6 2014 Atomicorp - 1.4.6-18 - Update to 1.4.6 * Fri Feb 2 2014 Atomicorp - 1.4.5-17 - Update to 1.4.5 * Mon Jan 13 2014 Atomicorp - 1.4.4-16 - Update mod_security 2.7.7 * Wed Nov 20 2013 Atomicorp - 1.4.4-15 - Update to 1.4.4 - Fix for CVE-2013-4547 * Thu Oct 17 2013 Atomicorp - 1.4.3-14 - Update to 1.4.3 * Tue Jul 30 2013 Atomicorp - 1.4.2-13 - Update to 1.4.2 - Update mod_security to 2.7.5 * Fri Jun 7 2013 Atomicorp - 1.4.1-12 - Update mod_security to 2.7.4 - Update ngx_cache_purge to 2.1 - Enable mod_spdy * Tue May 7 2013 Atomicorp - 1.4.1-11 - Update to 1.4.1 - Fix for CVE-2013-2028 - Disable mod_security for el5 and fc18 temporarily * Thu Apr 25 2013 Atomicorp - 1.4.0-10 - Update to 1.4.0 * Fri Apr 5 2013 Atomicorp - 1.2.8-9 - Update to 1.2.8 - Add mod_security 2.7.3 module * Fri Feb 22 2013 Atomicorp - 1.2.7-8 - Update to 1.2.7 * Wed Jan 30 2013 Atomicorp - 1.2.6-7 - Add ngx_cache_purge module * Wed Dec 12 2012 Atomicorp - 1.2.6-6 - Update to 1.2.6 * Wed Nov 14 2012 Atomicorp - 1.2.5-5 - Update to 1.2.5 * Mon Oct 22 2012 Atomicorp - 1.2.4-4 - Update to 1.2.4 * Wed Aug 8 2012 Atomicorp - 1.2.2-3 - Update to 1.2.3 * Fri Aug 3 2012 Atomicorp - 1.2.2-2 - Update to 1.2.2 * Fri Apr 13 2012 Atomicorp - 1.0.15-1 - Update to 1.0.15 * Fri Mar 16 2012 Atomicorp - 1.0.14-1 - Update to 1.0.14 * Tue Feb 7 2012 Atomicorp - 1.0.12-1 - Update to 1.0.12 * Fri Dec 30 2011 Atomicorp - 1.0.11-1 - Update to 1.0.11 * Fri Dec 2 2011 Atomicorp - 1.0.10-1 - Update to 1.0.10 * Fri Nov 4 2011 Atomicorp - 1.0.9-1 - Update to 1.0.9 * Wed Apr 13 2011 Atomicorp - 1.0.0-1 - Update to 1.0.0 * Mon Mar 07 2011 Atomicorp - 0.9.5-1 - Update to 0.9.5 * Tue Feb 08 2011 Fedora Release Engineering - 0.8.53-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Sun Dec 12 2010 Jeremy Hinegardner - 0.8.53.5 - Extract out default config into its own file (bug #635776) * Sun Dec 12 2010 Jeremy Hinegardner - 0.8.53-4 - Revert ownership of log dir * Sun Dec 12 2010 Jeremy Hinegardner - 0.8.53-3 - Change ownership of /var/log/nginx to be 0700 nginx:nginx - update init script to use killproc -p - add reopen_logs command to init script - update init script to use nginx -q option * Sun Oct 31 2010 Jeremy Hinegardner - 0.8.53-2 - Fix linking of perl module * Sun Oct 31 2010 Jeremy Hinegardner - 0.8.53-1 - Update to new stable 0.8.53 * Sat Jul 31 2010 Jeremy Hinegardner - 0.7.67-2 - add Provides: webserver (bug #619693) * Sun Jun 20 2010 Jeremy Hinegardner - 0.7.67-1 - Update to new stable 0.7.67 - fix bugzilla #591543 * Tue Jun 01 2010 Marcela Maslanova - 0.7.65-2 - Mass rebuild with perl-5.12.0 * Mon Feb 15 2010 Jeremy Hinegardner - 0.7.65-1 - Update to new stable 0.7.65 - change ownership of logdir to root:root - add support for ipv6 (bug #561248) - add random_index_module - add secure_link_module * Fri Dec 04 2009 Jeremy Hinegardner - 0.7.64-1 - Update to new stable 0.7.64 * Tue Oct 29 2009 Jeremy Hinegardner - 0.7.63-1 - Update to new stable 0.7.63 - reinstate zlib dependency * Mon Sep 14 2009 Jeremy Hinegardner - 0.7.62-1 - Update to new stable 0.7.62 - fixes CVE-2009-2629 - fix rpmlint zlib dependency complaint * Fri Aug 21 2009 Tomas Mraz - 0.7.61-2 - rebuilt with new openssl * Sun Aug 02 2009 Jeremy Hinegardner - 0.7.61-1 - Update to new stable 0.7.61 * Sat Jul 25 2009 Fedora Release Engineering - 0.6.36-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sun May 17 2009 Jeremy Hinegardner - 0.6.36-2 - init script updates from Gena Makhomed - remove nginx-upstream-fair * Sat Apr 11 2009 Jeremy Hinegardner - 0.6.36-1 - update to 0.6.36 * Wed Feb 25 2009 Fedora Release Engineering - 0.6.35-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Thu Feb 19 2009 Jeremy Hinegardner - 0.6.35-2 - rebuild * Thu Feb 19 2009 Jeremy Hinegardner - 0.6.35-1 - update to 0.6.35 * Sat Jan 17 2009 Tomas Mraz - 0.6.34-2 - rebuild with new openssl * Tue Dec 30 2008 Jeremy Hinegardner - 0.6.34-1 - update to 0.6.34 * Thu Dec 4 2008 Michael Schwendt - 0.6.33-2 - Fix inclusion of /usr/share/nginx tree => no unowned directories. * Sun Nov 23 2008 Jeremy Hinegardner - 0.6.33-1 - update to 0.6.33 * Tue Jul 22 2008 Jeremy Hinegardner - 0.6.32-1 - update to 0.6.32 - nginx now supports DESTDIR so removed the patches that enabled it * Mon May 26 2008 Jeremy Hinegardner - 0.6.31-3 - init script fixes - resolve 'listen 80 default' [#447873] * Mon May 12 2008 Jeremy Hinegardner - 0.6.31-2 - update to 0.6.31 * Sun May 11 2008 Jeremy Hinegardner - 0.6.30-2 - upate to new upstream stable branch 0.6 - added 3rd party module nginx-upstream-fair - added default webpages * Sun Apr 20 2008 Jeremy Hinegardner - 0.5.35-2 - update init script to match recommended guidelines - add /etc/nginx/conf.d support [#443280] - use /etc/sysconfig/nginx to determine nginx.conf [#442708] * Tue Mar 18 2008 Tom "spot" Callaway - 0.5.35-3 - add Requires for versioned perl (libperl.so) - drop silly file Requires * Tue Feb 19 2008 Fedora Release Engineering - 0.5.35-2 - Autorebuild for GCC 4.3 * Sat Jan 19 2008 Jeremy Hinegardner - 0.5.35-1 - update to 0.5.35 * Sat Dec 15 2007 Jeremy Hinegardner - 0.5.34-1 - update to 0.5.34 * Wed Dec 05 2007 Release Engineering - 0.5.33-2 - Rebuild for deps * Sun Nov 11 2007 Jeremy Hinegardner - 0.5.33-1 - update to 0.5.33 * Mon Sep 24 2007 Jeremy Hinegardner - 0.5.32-1 - updated to 0.5.32 - fixed rpmlint UTF-8 complaints. * Sat Aug 18 2007 Jeremy Hinegardner - 0.5.31-2 - added --with-http_stub_status_module build option. - added --with-http_sub_module build option. - added use of pcre-config --cflags * Fri Aug 17 2007 Jeremy Hinegardner - 0.5.31-1 - Update to 0.5.31 - specify license is BSD * Sat Aug 11 2007 Jeremy Hinegardner - 0.5.30-2 - Add BuildRequires: perl-devel - fixing rawhide build * Mon Jul 30 2007 Jeremy Hinegardner - 0.5.30-1 - Update to 0.5.30 * Tue Jul 24 2007 Jeremy Hinegardner - 0.5.29-1 - Update to 0.5.29 * Wed Jul 18 2007 Jeremy Hinegardner - 0.5.28-1 - Update to 0.5.28 * Mon Jul 09 2007 Jeremy Hinegardner - 0.5.27-1 - Update to 0.5.27 * Mon Jun 18 2007 Jeremy Hinegardner - 0.5.26-1 - Update to 0.5.26 * Sat Apr 28 2007 Jeremy Hinegardner - 0.5.19-1 - Update to 0.5.19 * Mon Apr 02 2007 Jeremy Hinegardner - 0.5.17-1 - Update to 0.5.17 * Mon Mar 26 2007 Jeremy Hinegardner - 0.5.16-1 - Update to 0.5.16 - add ownership of /usr/share/nginx/html (#233950) * Fri Mar 23 2007 Jeremy Hinegardner - 0.5.15-3 - fixed package review bugs (#235222) given by ruben@rubenkerkhof.com * Thu Mar 22 2007 Jeremy Hinegardner - 0.5.15-2 - fixed package review bugs (#233522) given by kevin@tummy.com * Thu Mar 22 2007 Jeremy Hinegardner - 0.5.15-1 - create patches to assist with building for Fedora - initial packaging for Fedora