File 1 of Package nginx (Revision 273)
Currently displaying revision 273, show latest
1
%define nginx_user nginx
2
%define nginx_group %{nginx_user}
3
%define nginx_home %{_localstatedir}/lib/nginx
4
%define nginx_home_tmp %{nginx_home}/tmp
5
%define nginx_logdir %{_localstatedir}/log/nginx
6
%define nginx_confdir %{_sysconfdir}/nginx
7
%define nginx_datadir %{_datadir}/nginx
8
%define nginx_webroot %{nginx_datadir}/html
9
10
%define rtmp_ext nginx-rtmp-module
11
%define rtmp_ext_version 1.1.15
12
%define rtmp %{rtmp_ext}-%{rtmp_ext_version}
13
%define rtmp_nover %{rtmp_ext}
14
%define with_rtmp_ext 0
15
16
%define nps_version latest-testing
17
%define psol_version 1.12.34.2-x64
18
%define slowfs_version 1.5
19
#%define waf_version 2.8.0
20
%define openssl_version 1.1.0g
21
%define ngxpurge_version 2.3
22
%define ajpmodule_version 0.3
23
%define with_ldap_auth 0
24
%define with_ajp_module 1
25
%define with_pagespeed 0
26
27
Name: nginx
28
Version: 1.13.8
29
Release: 1
30
Summary: Robust, small and high performance http and reverse proxy server
31
Group: System Environment/Daemons
32
33
License: BSD
34
URL: http://nginx.net/
35
BuildRoot: %{_tmppath}/%{name}-%{version}-root
36
37
38
Provides: webserver
39
40
41
BuildRequires: pcre-devel
42
BuildRequires: zlib-devel
43
BuildRequires: openssl-devel
44
BuildRequires: perl(ExtUtils::Embed)
45
BuildRequires: libxml2-devel
46
BuildRequires: libxslt-devel
47
BuildRequires: gd-devel
48
BuildRequires: GeoIP-devel
49
BuildRequires: libatomic_ops-devel
50
%if 0%{?with_ldap_auth} == 1
51
BuildRequires: openldap-devel
52
%endif
53
54
Requires: pcre
55
Requires: zlib
56
Requires: openssl
57
Requires: libxml2
58
Requires: libxslt
59
Requires: gd
60
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
61
Requires: GeoIP
62
63
Requires(pre): shadow-utils
64
Requires(post): chkconfig
65
Requires(preun): chkconfig, initscripts
66
Requires(postun): initscripts
67
68
Source0: http://sysoev.ru/nginx/nginx-%{version}.tar.gz
69
Source1: %{name}.init
70
Source2: %{name}.logrotate
71
Source3: virtual.conf
72
Source4: ssl.conf
73
Source5: nginx-upstream-fair.tgz
74
Source6: upstream-fair.conf
75
Source7: %{name}.sysconfig
76
Source8: ngx_slowfs_cache-%{slowfs_version}.tar.gz
77
Source9: Nginx-limit-traffic-rate-module.tar.gz
78
Source10: %{rtmp}.tar.gz
79
Source11: nginx_upstream_check_module-master.tar.gz
80
Source12: openssl-%{openssl_version}.tar.gz
81
Source13: nginx-munin.tar.gz
82
%if 0%{?with_pagespeed} == 1
83
Source14: ngx_pagespeed-%{nps_version}.zip
84
Source15: %{psol_version}.tar.gz
85
%endif
86
Source16: ngx_cache_purge-%{ngxpurge_version}.tar.gz
87
Source17: naxsi-git.tar.gz
88
Source18: changelog
89
Source19: nginx-auth-ldap.tar.gz
90
Source20: nginx-ajp-module-%{ajpmodule_version}.tar.gz
91
Source100: index.html
92
Source101: poweredby.png
93
Source102: nginx-logo.png
94
Source103: 50x.html
95
Source104: 404.html
96
Source105: ssl-ciphersample
97
%if 0%{?with_pagespeed} == 1
98
Source106: pagespeed.conf
99
%endif
100
Source108: blockips.conf
101
102
Patch0: nginx-auto-cc-gcc.patch
103
Patch1: nginx-conf-0.7.x.patch
104
#Patch2: check_1.7.5+.patch
105
Patch3: openssl-rc4tilt.patch
106
#Patch4: openssl__chacha20_poly1305_draft_and_rfc_ossl102g.patch
107
108
%description
109
Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
110
proxy server written by Igor Sysoev.
111
112
Several 3rd Party Extensions added
113
114
%prep
115
%setup -q
116
117
%patch0 -p0
118
%patch1 -p0
119
#%patch2 -p1
120
%{__tar} zxvf %{SOURCE5}
121
%{__tar} zxvf %{SOURCE9}
122
%{__tar} zxvf %{SOURCE10}
123
#%{__tar} zxvf %{SOURCE11}
124
%{__tar} zxvf %{SOURCE12}
125
%{__tar} zxvf %{SOURCE13}
126
%{__tar} zxvf %{SOURCE16}
127
%{__tar} zxvf %{SOURCE17}
128
%{__tar} zxvf %{SOURCE19}
129
%{__tar} zxvf %{SOURCE20}
130
131
cd openssl-%{openssl_version}
132
#%patch4 -p1
133
./config
134
135
%if 0%{?rhel_version} == 700 || 0%{?centos_version} == 700
136
%if 0%{?with_pagespeed} == 1
137
cd %{_builddir}/nginx-%{version}/
138
%{__unzip} -o %{SOURCE14}
139
if [ $? -ne 0 ]; then
140
exit $?
141
fi
142
143
%{__tar} xzf %{SOURCE15}
144
if [ $? -ne 0 ]; then
145
exit $?
146
fi
147
%endif
148
chmod -Rf a+rX,u+w,g-w,o-w .
149
150
%endif
151
152
153
%build
154
export DESTDIR=%{buildroot}
155
./configure \
156
--user=%{nginx_user} \
157
--group=%{nginx_group} \
158
--prefix=%{nginx_datadir} \
159
--sbin-path=%{_sbindir}/%{name} \
160
--conf-path=%{nginx_confdir}/%{name}.conf \
161
--error-log-path=%{nginx_logdir}/error.log \
162
--http-log-path=%{nginx_logdir}/access.log \
163
--http-client-body-temp-path=%{nginx_home_tmp}/client_body \
164
--http-proxy-temp-path=%{nginx_home_tmp}/proxy \
165
--http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
166
--pid-path=%{_localstatedir}/run/%{name}.pid \
167
--lock-path=%{_localstatedir}/lock/subsys/%{name} \
168
--with-poll_module \
169
--with-http_ssl_module \
170
--with-http_v2_module \
171
--with-http_realip_module \
172
--with-http_addition_module \
173
--with-http_sub_module \
174
--with-http_dav_module \
175
--with-http_flv_module \
176
--with-http_mp4_module \
177
--with-http_gunzip_module \
178
--with-http_gzip_static_module \
179
--with-http_auth_request_module \
180
--with-http_random_index_module \
181
--with-http_secure_link_module \
182
--with-http_degradation_module \
183
--with-http_stub_status_module \
184
--with-http_xslt_module \
185
--with-http_image_filter_module \
186
--with-http_geoip_module \
187
--with-http_perl_module \
188
--with-stream \
189
--with-stream_ssl_module \
190
--with-stream_realip_module \
191
--with-stream_geoip_module \
192
--with-stream_ssl_preread_module \
193
--with-threads \
194
--with-libatomic \
195
--with-pcre-jit \
196
--with-pcre \
197
--with-ipv6 \
198
--with-http_slice_module \
199
--with-stream_ssl_preread_module \
200
%if 0%{?with_ldap_auth} == 1
201
--add-module=%{_builddir}/nginx-%{version}/nginx-auth-ldap \
202
%endif
203
--add-module=%{_builddir}/nginx-%{version}/naxsi-git/naxsi_src \
204
%if 0%{?rhel_version} == 700 || 0%{?centos_version} == 700
205
--with-ld-opt="-Wl,-z,relro,-z,now -Wl,-rpath -Wl,-Bsymbolic-functions -Wl,--as-needed -fPIE" \
206
--with-cc-opt="-g -Ofast -march=native -ffast-math -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2" \
207
%endif
208
--with-openssl=%{_builddir}/nginx-%{version}/openssl-%{openssl_version} \
209
%if 0%{?rhel_version} == 700 || 0%{?centos_version} == 700
210
--with-openssl-opt=enable-ec_nistp_64_gcc_128 \
211
%endif
212
--with-file-aio \
213
--add-module=%{_builddir}/nginx-%{version}/Nginx-limit-traffic-rate-module \
214
--add-module=%{_builddir}/nginx-%{version}/ngx_cache_purge-2.3 \
215
%if 0%{?rhel_version} == 700 || 0%{?centos_version} == 700
216
%if 0%{?with_pagespeed} == 1
217
--add-module=%{_builddir}/nginx-%{version}/ngx_pagespeed-%{nps_version} \
218
--with-threads \
219
%endif
220
%endif
221
%if 0%{with_rtmp_ext}
222
--add-module=%{_builddir}/nginx-%{version}/%{rtmp} \
223
%endif
224
%if 0%{with_ajp_module}
225
--add-module=%{_builddir}/nginx-%{version}/nginx-ajp-module-%{ajpmodule_version} \
226
%endif
227
--with-mail \
228
--with-mail_ssl_module
229
230
make
231
232
mv nginx-upstream-fair/README nginx-upstream-fair/README.nginx-upstream-fair
233
234
235
236
%install
237
rm -rf %{buildroot}
238
make install DESTDIR=%{buildroot} INSTALLDIRS=vendor
239
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
240
find %{buildroot} -type f -name perllocal.pod -exec rm -f {} \;
241
find %{buildroot} -type f -empty -exec rm -f {} \;
242
find %{buildroot} -type f -exec chmod 0644 {} \;
243
find %{buildroot} -type f -name '*.so' -exec chmod 0755 {} \;
244
chmod 0755 %{buildroot}%{_sbindir}/nginx
245
%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
246
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
247
%{__install} -p -D -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
248
%{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d
249
%{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE6} %{SOURCE108} %{buildroot}%{nginx_confdir}/conf.d
250
251
%if 0%{?rhel_version} == 700 || 0%{?centos_version} == 700
252
%if 0%{?with_pagespeed} == 1
253
%{__install} -p -m 0644 %{SOURCE106} %{buildroot}%{nginx_confdir}/conf.d
254
%endif
255
%endif
256
257
%{__install} -p -m 0644 %{SOURCE105} %{buildroot}%{nginx_confdir}
258
%{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp}
259
%{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir}
260
%{__install} -p -d -m 0755 %{buildroot}%{nginx_webroot}
261
%{__install} -p -m 0644 %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{buildroot}%{nginx_webroot}
262
263
# convert to UTF-8 all files that give warnings.
264
for textfile in CHANGES
265
do
266
mv $textfile $textfile.old
267
iconv --from-code ISO8859-1 --to-code UTF-8 --output $textfile $textfile.old
268
rm -f $textfile.old
269
done
270
271
%clean
272
rm -rf %{buildroot}
273
274
%pre
275
%{_sbindir}/useradd -c "Nginx user" -s /bin/false -r -d %{nginx_home} %{nginx_user} 2>/dev/null || :
276
277
%post
278
/sbin/chkconfig --add %{name}
279
280
%preun
281
if [ $1 = 0 ]; then
282
/sbin/service %{name} stop >/dev/null 2>&1
283
/sbin/chkconfig --del %{name}
284
fi
285
286
%postun
287
if [ $1 -ge 1 ]; then
288
/sbin/service %{name} condrestart > /dev/null 2>&1 || :
289
fi
290
291
%files
292
%defattr(-,root,root,-)
293
%doc LICENSE CHANGES README nginx-upstream-fair/README.nginx-upstream-fair
294
%{nginx_datadir}/
295
%{_sbindir}/%{name}
296
%{_initrddir}/%{name}
297
%dir %{nginx_confdir}
298
%dir %{nginx_confdir}/conf.d
299
%config(noreplace) %{nginx_confdir}/conf.d/*.conf
300
%config(noreplace) %{nginx_confdir}/win-utf
301
%config(noreplace) %{nginx_confdir}/%{name}.conf.default
302
%config(noreplace) %{nginx_confdir}/mime.types.default
303
%config(noreplace) %{nginx_confdir}/fastcgi_params
304
%config(noreplace) %{nginx_confdir}/fastcgi_params.default
305
%config(noreplace) %{nginx_confdir}/fastcgi.conf
306
%config(noreplace) %{nginx_confdir}/fastcgi.conf.default
307
%config(noreplace) %{nginx_confdir}/scgi_params
308
%config(noreplace) %{nginx_confdir}/scgi_params.default
309
%config(noreplace) %{nginx_confdir}/uwsgi_params
310
%config(noreplace) %{nginx_confdir}/uwsgi_params.default
311
%config(noreplace) %{nginx_confdir}/koi-win
312
%config(noreplace) %{nginx_confdir}/koi-utf
313
%config(noreplace) %{nginx_confdir}/%{name}.conf
314
%config(noreplace) %{nginx_confdir}/mime.types
315
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
316
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
317
%config %{nginx_confdir}/ssl-ciphersample
318
%dir %{perl_vendorarch}/auto/%{name}
319
%{perl_vendorarch}/%{name}.pm
320
%{perl_vendorarch}/auto/%{name}/%{name}.so
321
%{_mandir}/man3/%{name}.3pm.gz
322
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home}
323
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp}
324
%attr(-,%{nginx_user},%{nginx_group}) %dir %{nginx_logdir}
325
326
327
%changelog
328
329