]>
Commit | Line | Data |
---|---|---|
f9e65082 | 1 | # TODO |
ee4f2132 | 2 | # - /etc/sysconfig/nginx file |
1c438d78 | 3 | # - missing perl build/install requires |
644ecce3 | 4 | # - add njs: https://nginx.org/en/docs/njs/ |
ee4f2132 | 5 | # |
362f5ab2 | 6 | # Conditional build for nginx: |
d2732616 ER |
7 | # Features |
8 | %bcond_with debug # enable debug logging: http://nginx.org/en/docs/debugging_log.html | |
d54a9642 | 9 | %bcond_without threads # thread pool support |
d2732616 ER |
10 | # Modules |
11 | %bcond_without addition # http addition module | |
12 | %bcond_without auth_request # auth_request module | |
13 | %bcond_without dav # WebDAV | |
14 | %bcond_without flv # http FLV module | |
278483d6 | 15 | %bcond_without gd # without http image filter module |
82f38dc6 | 16 | %bcond_without geoip # without http geoip module and stream geoip module |
d2732616 | 17 | %bcond_without http2 # HTTP/2 module |
056acc18 | 18 | %bcond_without mail # don't build imap/mail proxy |
19 | %bcond_without perl # don't build with perl module | |
d2732616 | 20 | %bcond_without poll # poll module |
d0c0492d | 21 | %bcond_without realip # real ip (behind proxy) |
d2732616 ER |
22 | %bcond_without select # select module |
23 | %bcond_without ssl # ssl support and http ssl module | |
24 | %bcond_without stream # TCP/UDP proxy module | |
25 | %bcond_without stub_status # http stub status module | |
26 | %bcond_without sub # ngx_http_sub_module | |
278483d6 | 27 | %bcond_without xslt # without http xslt module |
d2732616 | 28 | %bcond_with http_browser # http browser module (header "User-agent" parser) |
ba5570e8 | 29 | %bcond_with modsecurity # modsecurity module |
d2732616 | 30 | %bcond_with rtmp # rtmp support |
a7bd1a0f | 31 | %bcond_without vts # virtual host traffic status module |
1736adcc | 32 | %bcond_without headers_more # headers more module |
fb649fe5 | 33 | |
8cf64677 WF |
34 | %ifarch x32 |
35 | %undefine with_rtsig | |
36 | %endif | |
37 | ||
27ce902f | 38 | %define ssl_version 1.0.2 |
a71fb2d9 | 39 | %define rtmp_version 1.2.1 |
a7bd1a0f | 40 | %define vts_version 0.1.18 |
1736adcc | 41 | %define headers_more_version 0.33 |
9ccdc6d2 | 42 | %define modsecurity_version 3.0.4 |
8e1389c7 | 43 | Summary: High perfomance HTTP and reverse proxy server |
185313bb | 44 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
3dfa1ca2 AM |
45 | # nginx lines: |
46 | # - stable: production quality with stable API | |
47 | # - mainline: production quality but API can change | |
436be8d4 | 48 | # http://nginx.org/en/download.html |
f9e65082 | 49 | Name: nginx |
9ccdc6d2 | 50 | Version: 1.20.0 |
c0d1c5ae | 51 | Release: |
51ef519b | 52 | License: BSD-like |
cbf76340 | 53 | Group: Networking/Daemons/HTTP |
06e274b9 | 54 | Source0: http://nginx.org/download/%{name}-%{version}.tar.gz |
9ccdc6d2 | 55 | # Source0-md5: d3d7985527d535ebcda9fc3fdbd3a974 |
06e274b9 | 56 | Source1: http://nginx.net/favicon.ico |
87404bf2 | 57 | # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab |
06e274b9 | 58 | Source2: proxy.conf |
226bcc40 | 59 | Source3: %{name}.logrotate |
60 | Source4: %{name}.mime | |
7f97359c | 61 | Source6: %{name}.monitrc |
2cb3d9b2 | 62 | Source7: %{name}.init |
5d9f0850 | 63 | Source14: %{name}.conf |
7d80c773 | 64 | Source17: %{name}-mime.types.sh |
8d0ed4b0 | 65 | Source18: %{name}.service |
701bd771 | 66 | Source33: https://github.com/SpiderLabs/ModSecurity/releases/download/v%{modsecurity_version}/modsecurity-v%{modsecurity_version}.tar.gz |
ca59a792 | 67 | # Source33-md5: 42c9860e0c073ca32a4a015ead970774 |
278483d6 | 68 | Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/%{name}-rtmp-module-%{rtmp_version}.tar.gz |
a71fb2d9 | 69 | # Source101-md5: 639ac2b78103adaccbcfe484a92acf44 |
a7bd1a0f AM |
70 | Source102: https://github.com/vozlt/nginx-module-vts/archive/v%{vts_version}.tar.gz |
71 | # Source102-md5: 409a10dbd85e0b807cc77eecec29a3b5 | |
1736adcc AM |
72 | Source103: https://github.com/openresty/headers-more-nginx-module/archive/v%{headers_more_version}.tar.gz |
73 | # Source103-md5: 95e15a2331c2d4db3691a56268df5f47 | |
5ca9795d | 74 | Patch0: %{name}-no-Werror.patch |
7ce2935c | 75 | Patch1: %{name}-modsecurity-xheaders.patch |
b7a97f81 | 76 | URL: http://nginx.org/ |
dfef7372 | 77 | BuildRequires: mailcap |
f1fc9780 | 78 | BuildRequires: pcre-devel |
d323480a | 79 | BuildRequires: rpmbuild(macros) >= 1.644 |
f9e65082 | 80 | BuildRequires: zlib-devel |
278483d6 ER |
81 | %if %{with geoip} |
82 | BuildRequires: GeoIP-devel | |
83 | %endif | |
84 | %if %{with gd} | |
85 | BuildRequires: gd-devel | |
86 | %endif | |
87 | %if %{with modsecurity} | |
88 | BuildRequires: lua-devel | |
89 | %endif | |
90 | %if %{with perl} | |
91 | BuildRequires: perl-CGI | |
92 | BuildRequires: perl-devel | |
93 | BuildRequires: python | |
94 | BuildRequires: rpm-perlprov | |
95 | %endif | |
96 | %if %{with ssl} | |
97 | BuildRequires: openssl-devel >= %{ssl_version} | |
98 | Requires: openssl >= %{ssl_version} | |
99 | %endif | |
100 | %if %{with xslt} | |
101 | BuildRequires: libxslt-devel | |
102 | %endif | |
1a973791 JK |
103 | Provides: group(http) |
104 | Provides: group(nginx) | |
105 | Provides: user(nginx) | |
4ac1d45f | 106 | Provides: webserver |
9b47506f AM |
107 | Provides: webserver(access) |
108 | Provides: webserver(alias) | |
81d5057a JK |
109 | Provides: webserver(auth) |
110 | Provides: webserver(expires) | |
111 | Provides: webserver(headers) | |
1e42c256 | 112 | Provides: webserver(indexfile) |
81d5057a JK |
113 | Provides: webserver(log) |
114 | Provides: webserver(mime) | |
115 | Provides: webserver(reqtimeout) | |
116 | Provides: webserver(rewrite) | |
117 | Provides: webserver(setenv) | |
1a973791 | 118 | Conflicts: logrotate < 3.8.0 |
85600569 | 119 | Requires(post,preun): /sbin/chkconfig |
1a973791 | 120 | Requires(post,preun,postun): systemd-units >= 38 |
4ac1d45f ER |
121 | Requires(postun): /usr/sbin/groupdel |
122 | Requires(postun): /usr/sbin/userdel | |
123 | Requires(pre): /bin/id | |
124 | Requires(pre): /usr/bin/getgid | |
125 | Requires(pre): /usr/sbin/groupadd | |
126 | Requires(pre): /usr/sbin/useradd | |
127 | Requires: rc-scripts >= 0.2.0 | |
128 | Requires: systemd-units >= 38 | |
129 | Suggests: vim-syntax-nginx | |
7cd50bff AM |
130 | Obsoletes: nginx-common < 1.13.3 |
131 | Obsoletes: nginx-light < 1.13.3 | |
132 | Obsoletes: nginx-standard < 1.13.3 | |
6d00ffc3 | 133 | Conflicts: rpm < 4.4.2-0.2 |
4ac1d45f | 134 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
1a973791 | 135 | |
4ac1d45f ER |
136 | %define _sysconfdir /etc/%{name} |
137 | %define _nginxdir /home/services/%{name} | |
1a973791 | 138 | |
6d00ffc3 ER |
139 | # minimizing restarts logics. we restart webserver: |
140 | # | |
141 | # 1. at the end of transaction. (posttrans, feature from rpm 4.4.2) | |
142 | # 2. first install of module (post: $1 = 1) | |
143 | # 2. uninstall of module (postun: $1 == 0) | |
144 | # | |
145 | # the strict internal deps between modules and | |
146 | # main package are very important for all this to work. | |
85600569 | 147 | |
6d00ffc3 ER |
148 | # restart webserver at the end of transaction |
149 | ||
150 | %define restart_webserver \ | |
151 | %systemd_post %{name}.service \ | |
152 | %service %{name} force-reload \ | |
153 | %{nil} | |
154 | ||
155 | # macro called at module post scriptlet | |
156 | %define module_post \ | |
157 | if [ "$1" = "1" ]; then \ | |
158 | %restart_webserver \ | |
159 | fi | |
160 | ||
161 | # macro called at module postun scriptlet | |
162 | %define module_postun \ | |
163 | if [ "$1" = "0" ]; then \ | |
164 | %restart_webserver \ | |
165 | fi | |
166 | ||
167 | # it's sooo annoying to write them | |
168 | %define module_scripts() \ | |
169 | %post %1 \ | |
170 | %module_post \ | |
171 | \ | |
172 | %postun %1 \ | |
173 | %module_postun | |
2ee780b1 | 174 | |
4ac1d45f | 175 | %description |
1a973791 JK |
176 | nginx ("engine x") is a high-performance HTTP server and reverse |
177 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
178 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
179 | has been running in production for over two and a half years. Igor has | |
180 | released the source code under a BSD-like license. Although still in | |
181 | beta, nginx is known for its stability, rich feature set, simple | |
182 | configuration, and low resource consumption. | |
183 | ||
4ac1d45f | 184 | %description -l pl.UTF-8 |
1a973791 | 185 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
186 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
187 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 188 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
189 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
190 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
1a973791 JK |
191 | prostej konfiguracji oraz małej "zasobożerności". |
192 | ||
1736adcc AM |
193 | %package mod_headers_more |
194 | Summary: Nginx HTTP headers more module | |
195 | Group: Daemons | |
196 | Requires: %{name} = %{version}-%{release} | |
1736adcc AM |
197 | |
198 | %description mod_headers_more | |
199 | Set and clear input and output headers...more than "add". | |
200 | ||
278483d6 ER |
201 | %package mod_http_geoip |
202 | Summary: Nginx HTTP geoip module | |
203 | Group: Daemons | |
204 | Requires: %{name} = %{version}-%{release} | |
205 | Requires: GeoIP | |
2ee780b1 | 206 | |
278483d6 ER |
207 | %description mod_http_geoip |
208 | Nginx HTTP geoip module. | |
2ee780b1 | 209 | |
82f38dc6 ER |
210 | %package mod_stream_geoip |
211 | Summary: Nginx stream geoip module | |
212 | Group: Daemons | |
213 | Requires: %{name} = %{version}-%{release} | |
57aa9c0a | 214 | Requires: %{name}-mod_stream = %{version}-%{release} |
82f38dc6 | 215 | Requires: GeoIP |
1a973791 | 216 | |
82f38dc6 ER |
217 | %description mod_stream_geoip |
218 | Nginx stream geoip module. | |
2ee780b1 | 219 | |
278483d6 ER |
220 | %package mod_http_image_filter |
221 | Summary: Nginx HTTP image filter module | |
222 | Group: Daemons | |
223 | Requires: %{name} = %{version}-%{release} | |
1a973791 | 224 | |
278483d6 ER |
225 | %description mod_http_image_filter |
226 | Nginx HTTP image filter module. | |
2ee780b1 | 227 | |
f5d76ba0 ER |
228 | %package mod_http_perl |
229 | Summary: Nginx HTTP Perl module | |
cbf76340 | 230 | Group: Networking/Daemons/HTTP |
4ac1d45f | 231 | Requires: %{name} = %{version}-%{release} |
2ee780b1 | 232 | |
f5d76ba0 ER |
233 | %description mod_http_perl |
234 | Nginx HTTP Perl module. | |
1a973791 | 235 | |
278483d6 ER |
236 | %package mod_http_xslt_filter |
237 | Summary: Nginx XSLT module | |
238 | Group: Daemons | |
239 | Requires: %{name} = %{version}-%{release} | |
2ee780b1 | 240 | |
278483d6 ER |
241 | %description mod_http_xslt_filter |
242 | Nginx XSLT module. | |
2ee780b1 | 243 | |
f5d76ba0 ER |
244 | %package mod_mail |
245 | Summary: Nginx mail module | |
cbf76340 | 246 | Group: Networking/Daemons/HTTP |
4ac1d45f | 247 | Requires: %{name} = %{version}-%{release} |
28a25161 | 248 | |
f5d76ba0 ER |
249 | %description mod_mail |
250 | Nginx mail module. | |
1a973791 | 251 | |
9b4add35 AM |
252 | %package mod_vts |
253 | Summary: Nginx virtual host traffic status module | |
254 | Group: Networking/Daemons/HTTP | |
255 | Requires: %{name} = %{version}-%{release} | |
256 | ||
257 | %description mod_vts | |
258 | Nginx virtual host traffic status module. | |
259 | ||
278483d6 ER |
260 | %package mod_stream |
261 | Summary: Nginx stream modules | |
262 | Group: Daemons | |
263 | Requires: %{name} = %{version}-%{release} | |
fccff804 | 264 | |
278483d6 ER |
265 | %description mod_stream |
266 | Nginx stream modules. | |
85600569 | 267 | |
dd7459ac | 268 | %package -n monit-rc-nginx |
57f21172 | 269 | Summary: nginx support for monit |
270 | Summary(pl.UTF-8): Wsparcie nginx dla monit | |
60b8f836 | 271 | Group: Applications/System |
4ac1d45f | 272 | Requires: %{name} = %{version}-%{release} |
1cf92547 | 273 | Requires: monit |
dd7459ac | 274 | |
275 | %description -n monit-rc-nginx | |
57f21172 | 276 | monitrc file for monitoring nginx webserver. |
dd7459ac | 277 | |
278 | %description -n monit-rc-nginx -l pl.UTF-8 | |
57f21172 | 279 | Plik monitrc do monitorowania serwera WWW nginx. |
dd7459ac | 280 | |
f9e65082 | 281 | %prep |
1736adcc | 282 | %setup -q %{?with_rtmp:-a101} %{?with_modsecurity:-a22} %{?with_vts:-a102} %{?with_headers_more:-a103} |
717159c4 | 283 | %patch0 -p0 |
7ce2935c | 284 | %{?with_modsecurity:%patch1 -p0} |
f9e65082 | 285 | |
fb649fe5 ER |
286 | %if %{with rtmp} |
287 | mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module | |
288 | %endif | |
289 | ||
a7bd1a0f AM |
290 | %if %{with vts} |
291 | mv nginx-module-vts-%{vts_version} nginx-vts-module | |
292 | %endif | |
293 | ||
1736adcc AM |
294 | %if %{with headers_more} |
295 | mv headers-more-nginx-module-%{headers_more_version} nginx-headers-more-module | |
296 | %endif | |
297 | ||
a8eaad11 | 298 | # build mime.types.conf |
7d80c773 | 299 | #sh %{SOURCE17} /etc/mime.types |
a8eaad11 | 300 | |
f9e65082 ER |
301 | %build |
302 | # NB: not autoconf generated configure | |
056acc18 | 303 | cp -f configure auto/ |
5d0d957d | 304 | |
056acc18 | 305 | ./configure \ |
306 | --prefix=%{_prefix} \ | |
483adace | 307 | --modules-path=%{_libdir}/%{name}/modules \ |
efc6207e ER |
308 | --sbin-path=%{_sbindir}/%{name} \ |
309 | --conf-path=%{_sysconfdir}/%{name}.conf \ | |
310 | --error-log-path=%{_localstatedir}/log/%{name}/error.log \ | |
311 | --http-log-path=%{_localstatedir}/log/%{name}/access.log \ | |
312 | --pid-path=%{_localstatedir}/run/%{name}.pid \ | |
313 | --lock-path=%{_localstatedir}/lock/subsys/%{name} \ | |
314 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \ | |
315 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \ | |
316 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \ | |
0bd5043b | 317 | --http-uwsgi-temp-path=%{_localstatedir}/cache/%{name}/uwsgi_temp \ |
bfad744d | 318 | --http-scgi-temp-path=%{_localstatedir}/cache/%{name}/scgi_temp \ |
2fb62cf2 ER |
319 | --user=nginx \ |
320 | --group=nginx \ | |
021e3ce8 ER |
321 | %{?with_select:--with-select_module} \ |
322 | %{?with_poll:--with-poll_module} \ | |
323 | %{?with_rtsig:--with-rtsig_module} \ | |
278483d6 | 324 | %{?with_perl:--with-http_perl_module=dynamic} \ |
278483d6 ER |
325 | %{?with_gd:--with-http_image_filter_module=dynamic} \ |
326 | %{?with_xslt:--with-http_xslt_module=dynamic} \ | |
82f38dc6 ER |
327 | %{?with_geoip:--with-http_geoip_module=dynamic} \ |
328 | %{?with_geoip:--with-stream_geoip_module=dynamic} \ | |
008e09c3 ER |
329 | %if %{with mail} |
330 | --with-mail=dynamic \ | |
331 | --with-mail_ssl_module \ | |
278483d6 ER |
332 | %endif |
333 | %if %{with stream} | |
334 | --with-stream=dynamic \ | |
335 | --with-stream_ssl_module \ | |
008e09c3 | 336 | %endif |
2fb62cf2 ER |
337 | --with-cc="%{__cc}" \ |
338 | --with-cc-opt="%{rpmcflags}" \ | |
339 | --with-ld-opt="%{rpmldflags}" \ | |
0aa7dc69 | 340 | %{?with_debug:--with-debug} \ |
056acc18 | 341 | %{?with_addition:--with-http_addition_module} \ |
342 | %{?with_dav:--with-http_dav_module} \ | |
343 | %{?with_flv:--with-http_flv_module} \ | |
d6fc4b09 | 344 | %{?with_sub:--with-http_sub_module} \ |
056acc18 | 345 | %{?with_realip:--with-http_realip_module} \ |
d2732616 | 346 | %{?with_stub_status:--with-http_stub_status_module} \ |
056acc18 | 347 | %{?with_ssl:--with-http_ssl_module} \ |
348 | %{!?with_http_browser:--without-http_browser_module} \ | |
1736adcc | 349 | %{?with_headers_more:--add-dynamic-module=./nginx-headers-more-module} \ |
fb649fe5 | 350 | %{?with_rtmp:--add-module=./nginx-rtmp-module} \ |
9b4add35 | 351 | %{?with_vts:--add-dynamic-module=./nginx-vts-module} \ |
e9a11359 | 352 | %{?with_auth_request:--with-http_auth_request_module} \ |
8cf64677 | 353 | %{?with_threads:--with-threads} \ |
6f05a009 | 354 | %{?with_http2:--with-http_v2_module} \ |
ba5570e8 | 355 | %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \ |
ca3f3f03 | 356 | --with-http_secure_link_module \ |
2fb62cf2 ER |
357 | %{nil} |
358 | ||
53215d5e | 359 | %{__make} |
f9e65082 | 360 | |
53215d5e ER |
361 | %if %{with modsecurity} |
362 | cd modsecurity-%{modsecurity_version} | |
363 | ./autogen.sh | |
364 | %configure \ | |
365 | --enable-standalone-module \ | |
366 | --disable-mlogc \ | |
367 | --enable-alp2 \ | |
368 | --with-lua=/usr | |
369 | %{__make} | |
370 | cd .. | |
371 | %endif | |
056acc18 | 372 | |
f9e65082 ER |
373 | %install |
374 | rm -rf $RPM_BUILD_ROOT | |
362f5ab2 | 375 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \ |
376 | $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \ | |
4e61eac8 | 377 | $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \ |
c63e9e18 ER |
378 | $RPM_BUILD_ROOT%{_localstatedir}/cache/%{name} \ |
379 | $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/%{name} \ | |
97ac281a | 380 | $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{conf,modules,vhosts,webapps}.d} \ |
924400ca | 381 | $RPM_BUILD_ROOT%{_sysconfdir}/snippets \ |
d323480a | 382 | $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \ |
599f35f0 | 383 | $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system} |
f9e65082 | 384 | |
483adace ER |
385 | %{__make} install \ |
386 | INSTALLDIRS=vendor \ | |
387 | DESTDIR=$RPM_BUILD_ROOT | |
388 | ||
389 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/*.default | |
390 | ||
7f97359c ER |
391 | cp -p %{_sourcedir}/%{name}.conf $RPM_BUILD_ROOT%{_sysconfdir} |
392 | cp -p %{_sourcedir}/%{name}.service $RPM_BUILD_ROOT%{systemdunitdir} | |
393 | cp -p %{_sourcedir}/%{name}.monitrc $RPM_BUILD_ROOT/etc/monit | |
c63e9e18 ER |
394 | install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
395 | ||
483adace ER |
396 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
397 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf | |
3c75ce8a | 398 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types |
483adace | 399 | rm -r $RPM_BUILD_ROOT%{_prefix}/html |
5ca9795d ER |
400 | cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html |
401 | cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors | |
402 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico | |
c9aa991c | 403 | |
a88a446d ER |
404 | load_module() { |
405 | local module=ngx_${1}_module.so conffile=mod_$1.conf | |
9453c586 | 406 | printf 'load_module "%{_libdir}/%{name}/modules/%s";' "$module" \ |
97ac281a | 407 | > $RPM_BUILD_ROOT%{_sysconfdir}/modules.d/$conffile |
c9aa991c ER |
408 | } |
409 | ||
85600569 | 410 | %if %{with perl} |
483adace ER |
411 | %{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod |
412 | %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/nginx/.packlist | |
a88a446d | 413 | load_module http_perl |
85600569 | 414 | %endif |
f9e65082 | 415 | |
a88a446d ER |
416 | %if %{with geoip} |
417 | load_module http_geoip | |
763de572 | 418 | load_module stream_geoip |
a88a446d ER |
419 | %endif |
420 | %if %{with gd} | |
421 | load_module http_image_filter | |
422 | %endif | |
423 | %if %{with xslt} | |
424 | load_module http_xslt_filter | |
425 | %endif | |
c9aa991c | 426 | %if %{with mail} |
a88a446d ER |
427 | load_module mail |
428 | %endif | |
d925a29b | 429 | %{?with_vts:load_module http_vhost_traffic_status} |
1736adcc | 430 | %{?with_headers_more:load_module http_headers_more_filter} |
a88a446d ER |
431 | %if %{with stream} |
432 | load_module stream | |
c9aa991c | 433 | %endif |
32c47bd6 | 434 | |
f9e65082 ER |
435 | %clean |
436 | rm -rf $RPM_BUILD_ROOT | |
437 | ||
c63e9e18 | 438 | %pre |
a37373c3 | 439 | %groupadd -r -g 213 %{name} |
362f5ab2 | 440 | %groupadd -g 51 http |
a37373c3 | 441 | %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name} |
362f5ab2 | 442 | %addusertogroup %{name} http |
f1fc9780 | 443 | |
c63e9e18 | 444 | %post |
738166d2 | 445 | for a in access.log error.log; do |
c63e9e18 | 446 | if [ ! -f /var/log/%{name}/$a ]; then |
98376457 | 447 | umask 022 |
c63e9e18 ER |
448 | touch /var/log/%{name}/$a |
449 | chown nginx:nginx /var/log/%{name}/$a | |
450 | chmod 644 /var/log/%{name}/$a | |
738166d2 | 451 | fi |
452 | done | |
c63e9e18 | 453 | /sbin/chkconfig --add %{name} |
738166d2 | 454 | |
6d00ffc3 ER |
455 | %posttrans |
456 | %restart_webserver | |
738166d2 | 457 | |
c63e9e18 | 458 | %preun |
7d80c773 | 459 | if [ "$1" = "0" ];then |
c63e9e18 ER |
460 | %service %{name} stop |
461 | /sbin/chkconfig --del %{name} | |
f9e65082 | 462 | fi |
c63e9e18 | 463 | %systemd_preun %{name}.service |
f9e65082 | 464 | |
c63e9e18 | 465 | %postun |
f1fc9780 | 466 | if [ "$1" = "0" ]; then |
7d9b86c7 ER |
467 | %userremove %{name} |
468 | %groupremove %{name} | |
f1fc9780 | 469 | fi |
d323480a JK |
470 | %systemd_reload |
471 | ||
6d00ffc3 ER |
472 | %module_scripts mod_http_geoip |
473 | %module_scripts mod_http_image_filter | |
474 | %module_scripts mod_http_perl | |
475 | %module_scripts mod_http_xslt_filter | |
476 | %module_scripts mod_mail | |
9b4add35 | 477 | %module_scripts mod_vts |
1736adcc | 478 | %module_scripts mod_headers_more |
6d00ffc3 ER |
479 | %module_scripts mod_stream |
480 | %module_scripts mod_stream_geoip | |
d323480a | 481 | |
c63e9e18 | 482 | %files |
f9e65082 | 483 | %defattr(644,root,root,755) |
6f8318ed | 484 | %doc CHANGES LICENSE README html/index.html conf/nginx.conf |
f9e65082 | 485 | %doc %lang(ru) CHANGES.ru |
28a25161 | 486 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} |
7f6266e4 ER |
487 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
488 | %dir %attr(750,root,nginx) %{_sysconfdir} | |
943e8c63 | 489 | %dir %{_sysconfdir}/conf.d |
97ac281a | 490 | %dir %{_sysconfdir}/modules.d |
924400ca | 491 | %dir %{_sysconfdir}/snippets |
7f6266e4 ER |
492 | %dir %{_sysconfdir}/vhosts.d |
493 | %dir %{_sysconfdir}/webapps.d | |
f1fc9780 | 494 | %attr(640,root,root) %{_sysconfdir}/mime.types |
57f21172 | 495 | %attr(640,root,root) %{_sysconfdir}/koi-utf |
496 | %attr(640,root,root) %{_sysconfdir}/koi-win | |
497 | %attr(640,root,root) %{_sysconfdir}/win-utf | |
ba3249a3 | 498 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.conf |
7f6266e4 ER |
499 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nginx.conf |
500 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf | |
501 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params | |
502 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params | |
503 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params | |
483adace | 504 | %attr(755,root,root) %{_sbindir}/%{name} |
278483d6 ER |
505 | %dir %{_libdir}/%{name} |
506 | %dir %{_libdir}/%{name}/modules | |
c63e9e18 | 507 | %{systemdunitdir}/%{name}.service |
b0fa7cc6 | 508 | |
debe6eba JR |
509 | %attr(750,nginx,logs) %dir /var/log/archive/%{name} |
510 | %attr(750,nginx,logs) /var/log/%{name} | |
7f6266e4 ER |
511 | %attr(770,root,nginx) /var/cache/%{name} |
512 | ||
513 | %dir %{_nginxdir} | |
514 | %dir %{_nginxdir}/cgi-bin | |
515 | %dir %{_nginxdir}/html | |
516 | %dir %{_nginxdir}/errors | |
475fecd1 | 517 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/* |
cd728db7 | 518 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/* |
28a25161 | 519 | |
278483d6 ER |
520 | %if %{with geoip} |
521 | %files mod_http_geoip | |
b0fa7cc6 | 522 | %defattr(644,root,root,755) |
97ac281a | 523 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_http_geoip.conf |
278483d6 | 524 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_http_geoip_module.so |
b0fa7cc6 | 525 | |
82f38dc6 | 526 | %files mod_stream_geoip |
85600569 | 527 | %defattr(644,root,root,755) |
97ac281a | 528 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_stream_geoip.conf |
82f38dc6 | 529 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_stream_geoip_module.so |
85600569 | 530 | %endif |
531 | ||
278483d6 ER |
532 | %if %{with gd} |
533 | %files mod_http_image_filter | |
85600569 | 534 | %defattr(644,root,root,755) |
97ac281a | 535 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_http_image_filter.conf |
278483d6 | 536 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_http_image_filter_module.so |
85600569 | 537 | %endif |
538 | ||
539 | %if %{with perl} | |
f5d76ba0 | 540 | %files mod_http_perl |
85600569 | 541 | %defattr(644,root,root,755) |
97ac281a | 542 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_http_perl.conf |
008e09c3 | 543 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_http_perl_module.so |
85600569 | 544 | %dir %{perl_vendorarch}/auto/%{name} |
545 | %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so | |
98376457 | 546 | %{perl_vendorarch}/%{name}.pm |
483adace | 547 | %{_mandir}/man3/nginx.3pm* |
dd7459ac | 548 | %endif |
549 | ||
278483d6 ER |
550 | %if %{with xslt} |
551 | %files mod_http_xslt_filter | |
dd7459ac | 552 | %defattr(644,root,root,755) |
97ac281a | 553 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_http_xslt_filter.conf |
278483d6 | 554 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_http_xslt_filter_module.so |
dd7459ac | 555 | %endif |
278483d6 | 556 | |
dd7459ac | 557 | %if %{with mail} |
278483d6 ER |
558 | %files mod_mail |
559 | %defattr(644,root,root,755) | |
97ac281a | 560 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_mail.conf |
278483d6 | 561 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_mail_module.so |
dd7459ac | 562 | %endif |
278483d6 | 563 | |
1736adcc AM |
564 | %if %{with headers_more} |
565 | %files mod_headers_more | |
566 | %defattr(644,root,root,755) | |
567 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_http_headers_more_filter.conf | |
568 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_http_headers_more_filter_module.so | |
569 | %endif | |
570 | ||
9b4add35 AM |
571 | %if %{with vts} |
572 | %files mod_vts | |
573 | %defattr(644,root,root,755) | |
d925a29b | 574 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_http_vhost_traffic_status.conf |
9b4add35 AM |
575 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_http_vhost_traffic_status_module.so |
576 | %endif | |
577 | ||
278483d6 ER |
578 | %if %{with stream} |
579 | %files mod_stream | |
580 | %defattr(644,root,root,755) | |
97ac281a | 581 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modules.d/mod_stream.conf |
278483d6 ER |
582 | %attr(755,root,root) %{_libdir}/%{name}/modules/ngx_stream_module.so |
583 | %endif | |
584 | ||
dd7459ac | 585 | %files -n monit-rc-nginx |
586 | %defattr(644,root,root,755) | |
c63e9e18 | 587 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc |