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