LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dba-nginx-180-stream.spec of Package dba-nginx-180-stream (Project home:csbuild:DBA)

%define real_name 	nginx
%define version		1.8.0
%define vers		180
%define prefix		/DBA/apache/NGX/%{version}
%define gemname		passenger
%define gemvers		4.0.59

%define with_ajp     0
%define with_lua     1
%define with_ruby    1
%define with_slowfs  1
%define with_spdy    1
%define with_stream  1

Name:           dba-nginx-%{vers}-stream
Summary:        A HTTP server and IMAP/POP3 proxy server 1.8.0
Version:        %{version}
Release:        1
AutoReqProv:    on
License:        BSD
Group:          Productivity/Networking/Web/Proxy
Url:            http://nginx.net/
Source:         http://sysoev.ru/nginx/nginx-%{version}.tar.gz
Source1:        nginx.init
Source2:        nginx-upload-progress.tar.gz
Source3:        nginx-upstream-fair.tar.gz
Source4:        ngx_supervisord.tar.gz
Source5:        ngx_cache_purge-2.3.tar.gz
Source6:        nginx_ajp_module.tgz
Source7:        nginx_upstream_check.tgz
Source9:        http://rubygems.org/downloads/%{gemname}-%{gemvers}.gem
Source10:       dba-nginx-rpmlintrc
Source11:       ngx_log_if.tgz
Source12:       nginx_accept_language_module.tgz
Source13:       http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
Source14:       http://www.openssl.org/source/openssl-1.0.1m.tar.gz
Source15:       ngx_slowfs_cache-master.tgz
Source16:       lua-nginx-module-0.9.15.tar.gz
Source17:	set_nginx_1.8.latest.sh
Source18:	http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz
Source19:	headers-more-nginx-module-0.26.tar.gz
Source20:	filter-requires-nginx.sh
Source21:	testcookie-nginx-module.tgz
Patch1:		nginx-remove-werror.patch
Patch2:		nginx-geoip.patch
Patch3:		nginx_upstream_check.patch
# http://hg.nginx.org/nginx/rev/61d7ae76647d
Patch4:		nginx-stream.patch
Patch5:		nginx-stream_2.patch
Patch6:		nginx-lock.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%define _use_internal_dependency_generator 0
%define __find_requires %{SOURCE20}

#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c dba-openssl-101e dba-openssl-101f
#!BuildIgnore:  dba-libxml2-290

BuildRequires:  pkgconfig zlib-devel dos2unix patch openssl-devel
BuildRequires:	libxslt-devel libaio-devel libxml2-devel 
BuildRequires:	gcc-c++ pcre-devel 

%if 0%{?rhel_version} >= 401
%define with_ruby    0

%if 0%{?sles_version} == 10
%define with_ruby    0

%if 0%{?suse_version} >= 1300
%define with_ruby    0

%if 0%{?centos_version} >= 501 && 0%{?centos_version} < 600
%define with_ruby    0

%if 0%{?centos_version} >= 700
%define with_ruby    0

%if %{with_ruby}
BuildRequires:	rubygem-rake gcc-c++ libstdc++-devel curl-devel ruby-devel
Requires:	ruby
%define ruby_gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%define ruby_sitearchdir %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")

%if 0%{?fedora_version}
%define with_ruby    0

# %if 0%{?fedora_version} || 0%{?suse_version} >= 1200
%if 0%{?fedora_version}
%define with_geoip   0
%define with_geoip   1

%if 0%{?rhel_version} >= 600
# gd-devel is optional in rhel6
%define with_gd      0
%define with_gd      1

%if 0%{?sles_version} == 9
%define with_gd      0

%if 0%{?sles_version} >= 9
%define with_aio      0
%define with_aio      1

# aio not compiling for CentOS5 i586 environment
%if 0%{?centos_version} >= 501 && 0%{?centos_version} < 600
%ifarch %ix86
%define with_aio      0

%if 0%{?rhel_version} == 406
%define with_aio      0
%define with_lua      0

%if %{with_lua}
BuildRequires:	dba-lua-515-static
%define luadir /DBA/lua/5.1.5

%if %{with_gd}
BuildRequires:	gd-devel

%if %{with_geoip}
BuildRequires:	dba-geoip-163-static
%define geodir /DBA/geoip/1.6.3

%if 0%{?suse_version}
Requires:  	pwdutils
BuildRequires:  pwdutils
Requires:  	passwd
BuildRequires:  passwd

%if 0%{?suse_version} >= 1100
BuildRequires:          -post-build-checks

nginx [engine x] is a HTTP server and IMAP/POP3 proxy server written by Igor Sysoev.
It has been running on many heavily loaded Russian sites for more than two years.

    Igor Sysoev

%if %{with_ruby}
%package ruby
Summary:        Ruby files for passenger module
Group:          Productivity/Networking/Web/Proxy
Requires:       %{name} = %{version}

%description ruby
Ruby files for passenger module


# %setup -n %{real_name}-%{version} -a 2 -a 3 -a 4 -a 5
%setup -n %{real_name}-%{version} -a 2 -a 3 -a 5 -a 6 -a 7 -a 11 -a 12 -a 14 -a 15 -a 16 -a 19
dos2unix contrib/geo2nginx.pl

# Remove -Werror flag due to compile errors with -Wunused-function and -Wunused-variable
# %{__perl} -pi.orig -e 's|-Werror||g' auto/cc/*

%{__chmod} +x %{SOURCE20}

%if %{with_ruby}
%if 0%{?sles_version} <= 11
pushd ../
gem unpack %{SOURCE9}
gem unpack %{SOURCE9} --target %{_builddir}

%if 0%{?suse_version} || 0%{?fedora_version}
%patch1 -p1
%if %{with_geoip}
%patch2 -p0

%if %{with_stream}
%patch4 -p1
%patch5 -p0
%patch6 -p1

# %if %{with_ajp}
# patch -p1 < ./nginx_ajp_module/ajp.patch
# %endif

pushd ./nginx-upstream-fair
patch -p1 < ../nginx_upstream_check/upstream_fair.patch

# see https://github.com/yaoweibin/nginx_upstream_check_module
# patch -p1 < ./nginx_upstream_check/check_1.5.12+.patch
patch -p1 < ./nginx_upstream_check/check_1.7.5+.patch

%patch3 -p0

rm -f conf/*.orig

%if %{with_geoip}
export CFLAGS='-I%{geodir}/include'
export LDFLAGS='-L%{geodir}/lib'
%if %{with_lua}
export LUA_LIB=%{luadir}/lib
export LUA_INC=%{luadir}/include

./configure \
  --prefix=%{prefix} \
  --with-openssl=./openssl-1.0.1m \
  --with-rtsig_module \
  --with-select_module \
  --with-poll_module \
  --with-http_ssl_module \
  --with-http_realip_module \
  --with-http_addition_module \
  --with-http_auth_request_module \
%if %{with_gd}
  --with-http_image_filter_module \
  --with-http_sub_module \
  --with-http_gzip_static_module \
  --with-http_stub_status_module \
%if %{with_lua}
  --add-module=./lua-nginx-module-0.9.15 \
%if %{with_geoip}
  --with-http_geoip_module \
  --add-module=./nginx-upstream-fair \
  --add-module=./nginx-upload-progress \
  --add-module=./ngx_cache_purge-2.3 \
  --add-module=./nginx_upstream_check \
  --add-module=./ngx_log_if \
  --add-module=./nginx_accept_language_module \
%if %{with_stream}
  --with-stream \
  --with-stream_ssl_module \
%if %{with_ruby}
  --add-module=%{_builddir}/passenger-%{gemvers}/ext/nginx \
%if %{with_ajp}
  --add-module=./nginx_ajp_module \
  --add-module=./headers-more-nginx-module-0.26 \
  --with-imap \
%if %{with_aio}
  --with-file-aio \
%if %{with_spdy}
  --with-http_spdy_module \
  --with-http_gunzip_module \
  --with-md5=/usr \
  --with-sha1=/usr \
%if %{with_slowfs}
  --add-module=./ngx_slowfs_cache-master \
%if 0%{?suse_version} > 1000 || 0%{?fedora_version} > 4 || 0%{?mandriva_version} > 2006
  --with-cc-opt="%{optflags} -fstack-protector"
# --add-module=./ngx_supervisord \


%{__mkdir_p} %{buildroot}%{prefix}/bin
%{__mkdir_p} %{buildroot}%{prefix}/html
%{__mkdir_p} %{buildroot}%{prefix}/man/man8
%{__install} -m 0755 contrib/geo2nginx.pl %{buildroot}%{prefix}/bin/
%{__install} -m 0644 man/nginx* %{buildroot}%{prefix}/man/man8/

%if %{with_ruby}
%if 0%{?suse_version} > 0 && 0%{?sles_version} <= 10
gem install --local --install-dir %{buildroot}/%{ruby_gemdir} --force %{SOURCE9}
gem install --bindir %{buildroot}%{_bindir} --local --install-dir %{buildroot}/%{ruby_gemdir} --force %{SOURCE9}
%{__rm} -rf %{buildroot}%{ruby_gemdir}/{cache,gems/%{gemname}-%{version}/{debian,ext}}
%{__rm} -rf %{buildroot}%{ruby_gemdir}/doc

%if %{with_geoip}
  %{__mkdir_p} %{buildroot}%{prefix}/share/GeoIP
  %{__install} -m 0644 %{SOURCE13} %{buildroot}%{prefix}/share/GeoIP/
  %{__install} -m 0644 %{SOURCE18} %{buildroot}%{prefix}/share/GeoIP/

%{__install} -m 0755 %{SOURCE17} %{buildroot}%{prefix}/bin/set_nginx_1.8.latest.sh

find %{buildroot} -name "nginx.old" -o -name "*.sav" -o -name "*.bs" -o -name "*.keep" -o -name "*.gitkeep" -o -name "*.gitignore" |xargs -i rm -f {}

cd %{prefix}/..

%if %{with_geoip}
  cd %{prefix}/share/GeoIP
  rm -f %{prefix}/share/GeoIP/GeoIP*.dat
  gzip -d GeoIP*gz

%if %{with_geoip}
  rm -f %{prefix}/share/GeoIP/GeoIP*
  touch %{prefix}/share/GeoIP/GeoIP.dat.gz %{prefix}/share/GeoIP/GeoIPv6.dat.gz

%{__rm} -rf %{buildroot}

%if %{with_ruby}
%files ruby
%if 0%{?suse_version} >= 1200

%dir %{prefix} 
%if %{with_geoip}

* Wed Apr 22 2015 Holger Manthey <holger.manthey@bertelsmann.de>
- initial package