]> git.pld-linux.org Git - packages/nginx.git/blob - nginx.spec
More P: webserver(*)
[packages/nginx.git] / nginx.spec
1 # TODO
2 # - /etc/sysconfig/nginx file
3 # - missing perl build/install requires
4 #
5 # Conditional build for nginx:
6 %bcond_without  light           # don't build light version
7 %bcond_without  mail            # don't build imap/mail proxy
8 %bcond_without  perl            # don't build with perl module
9 %bcond_without  addition        # adds module
10 %bcond_without  dav             # WebDAV
11 %bcond_without  flv             # FLV stream
12 %bcond_without  ipv6            # build without ipv6 support
13 %bcond_without  sub             # ngx_http_sub_module
14 %bcond_without  poll            # poll
15 %bcond_without  realip          # real ip (behind proxy)
16 %bcond_without  select          # select
17 %bcond_without  http2           # HTTP/2 module
18 %bcond_without  status          # status module
19 %bcond_without  ssl             # ssl support
20 %bcond_without  threads         # thread pool support
21 %bcond_with     http_browser    # header "User-agent" parser
22 %bcond_with     rtmp            # rtmp support
23 %bcond_with     debug           # enable debug logging: http://nginx.org/en/docs/debugging_log.html
24 %bcond_without  auth_request    # auth_request module
25 %bcond_with     modsecurity     # modsecurity module
26
27 %ifarch x32
28 %undefine       with_rtsig
29 %endif
30
31 %define         ssl_version     1.0.2
32 %define         rtmp_version    1.1.7
33 %define         modsecurity_version     2.9.1
34 Summary:        High perfomance HTTP and reverse proxy server
35 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
36 # nginx lines:
37 # - stable: production quality with stable API
38 # - mainline: production quality but API can change
39 Name:           nginx
40 Version:        1.11.3
41 Release:        1
42 License:        BSD-like
43 Group:          Networking/Daemons/HTTP
44 Source0:        http://nginx.org/download/%{name}-%{version}.tar.gz
45 # Source0-md5:  18275c1daa39c5fac12e56c34907d45b
46 Source1:        http://nginx.net/favicon.ico
47 # Source1-md5:  2aaf2115c752cbdbfb8a2f0b3c3189ab
48 Source2:        proxy.conf
49 Source3:        %{name}.logrotate
50 Source4:        %{name}.mime
51 Source6:        %{name}-light.monitrc
52 Source7:        %{name}.init
53 Source8:        %{name}-mail.conf
54 Source9:        %{name}-mail.monitrc
55 Source12:       %{name}-perl.monitrc
56 Source14:       %{name}.conf
57 Source15:       %{name}-standard.monitrc
58 Source17:       %{name}-mime.types.sh
59 Source18:       %{name}-standard.service
60 Source19:       %{name}-light.service
61 Source20:       %{name}-perl.service
62 Source21:       %{name}-mail.service
63 Source22:       http://www.modsecurity.org/tarball/%{modsecurity_version}/modsecurity-%{modsecurity_version}.tar.gz
64 # Source22-md5: 0fa92b852abc857a20b9e24f83f814cf
65 Source101:      https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
66 # Source101-md5:        8006de2560db3e55bb15d110220076ac
67 Patch0:         %{name}-no-Werror.patch
68 Patch1:         %{name}-modsecurity-xheaders.patch
69 URL:            http://nginx.net/
70 %{?with_modsecurity:BuildRequires: lua-devel}
71 BuildRequires:  mailcap
72 %{?with_ssl:BuildRequires: openssl-devel >= %{ssl_version}}
73 BuildRequires:  pcre-devel
74 %{?with_perl:BuildRequires: perl-CGI}
75 %{?with_perl:BuildRequires: perl-devel}
76 %{?with_perl:BuildRequires: python}
77 %{?with_perl:BuildRequires: rpm-perlprov}
78 BuildRequires:  rpmbuild(macros) >= 1.644
79 BuildRequires:  zlib-devel
80 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81
82 %define         _sysconfdir     /etc/%{name}
83 %define         _nginxdir       /home/services/%{name}
84
85 %description
86 nginx ("engine x") is a high-performance HTTP server and reverse
87 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
88 Sysoev for Rambler.ru, Russia's second-most visited website, where it
89 has been running in production for over two and a half years. Igor has
90 released the source code under a BSD-like license. Although still in
91 beta, nginx is known for its stability, rich feature set, simple
92 configuration, and low resource consumption.
93
94 %description -l pl.UTF-8
95 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
96 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
97 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
98 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
99 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
100 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
101 prostej konfiguracji oraz małej "zasobożerności".
102
103 %package common
104 Summary:        nginx - common files
105 Summary(pl.UTF-8):      nginx - pliki wspólne
106 Group:          Networking/Daemons/HTTP
107 Requires(postun):       /usr/sbin/groupdel
108 Requires(postun):       /usr/sbin/userdel
109 Requires(pre):  /bin/id
110 Requires(pre):  /usr/bin/getgid
111 Requires(pre):  /usr/sbin/groupadd
112 Requires(pre):  /usr/sbin/useradd
113 Requires:       rc-scripts >= 0.2.0
114 Requires:       systemd-units >= 38
115 Suggests:       vim-syntax-nginx
116 Provides:       group(http)
117 Provides:       group(nginx)
118 Provides:       user(nginx)
119 Provides:       webserver
120 Provides:       webserver(access)
121 Provides:       webserver(alias)
122 Provides:       webserver(indexfile)
123 Obsoletes:      nginx < 1.4.1-4.1
124 Conflicts:      logrotate < 3.8.0
125
126 %description common
127 Common files for the nginx daemon.
128
129 %description common -l pl.UTF-8
130 Niezbędne pliki dla nginx.
131
132 %package light
133 Summary:        High perfomance HTTP and reverse proxy server
134 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
135 Group:          Networking/Daemons/HTTP
136 Requires(post,preun):   /sbin/chkconfig
137 Requires(post,preun,postun):    systemd-units >= 38
138 Requires:       %{name}-common = %{version}-%{release}
139 %{?with_ssl:Requires: openssl >= %{ssl_version}}
140 Provides:       nginx-daemon
141 Provides:       webserver
142 Provides:       webserver(access)
143 Provides:       webserver(alias)
144 Provides:       webserver(indexfile)
145
146 %description light
147 nginx ("engine x") is a high-performance HTTP server and reverse
148 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
149 Sysoev for Rambler.ru, Russia's second-most visited website, where it
150 has been running in production for over two and a half years. Igor has
151 released the source code under a BSD-like license. Although still in
152 beta, nginx is known for its stability, rich feature set, simple
153 configuration, and low resource consumption.
154
155 The smallest, but also the fastest nginx edition. No additional
156 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
157
158 %description light -l pl.UTF-8
159 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
160 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
161 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
162 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
163 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
164 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
165 prostej konfiguracji oraz małej "zasobożerności".
166
167 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
168 FLV oraz IMAP, POP3, SMTP proxy.
169
170 %package perl
171 Summary:        High perfomance HTTP and reverse proxy server
172 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
173 Group:          Networking/Daemons/HTTP
174 Requires(post,preun):   /sbin/chkconfig
175 Requires(post,preun,postun):    systemd-units >= 38
176 Requires:       %{name}-common = %{version}-%{release}
177 %{?with_ssl:Requires: openssl >= %{ssl_version}}
178 Provides:       nginx-daemon
179 Provides:       webserver
180 Provides:       webserver(access)
181 Provides:       webserver(alias)
182 Provides:       webserver(indexfile)
183
184 %description perl
185 nginx ("engine x") is a high-performance HTTP server and reverse
186 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
187 Sysoev for Rambler.ru, Russia's second-most visited website, where it
188 has been running in production for over two and a half years. Igor has
189 released the source code under a BSD-like license. Although still in
190 beta, nginx is known for its stability, rich feature set, simple
191 configuration, and low resource consumption.
192
193 nginx with Perl support. Mail modules not included.
194
195 %description perl -l pl.UTF-8
196 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
197 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
198 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
199 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
200 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
201 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
202 prostej konfiguracji oraz małej "zasobożerności".
203
204 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
205
206 %package mail
207 Summary:        High perfomance IMAP, POP3, SMTP proxy server
208 Summary(pl.UTF-8):      IMAP, POP3, SMTP proxy o wysokiej wydajności
209 Group:          Networking/Daemons/HTTP
210 Requires(post,preun):   /sbin/chkconfig
211 Requires(post,preun,postun):    systemd-units >= 38
212 Requires:       %{name}-common = %{version}-%{release}
213 Provides:       nginx-daemon
214
215 %description mail
216 nginx ("engine x") is a high-performance HTTP server and reverse
217 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
218 Sysoev for Rambler.ru, Russia's second-most visited website, where it
219 has been running in production for over two and a half years. Igor has
220 released the source code under a BSD-like license. Although still in
221 beta, nginx is known for its stability, rich feature set, simple
222 configuration, and low resource consumption.
223
224 nginx with mail support. Only mail modules included.
225
226 %description mail -l pl.UTF-8
227 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
228 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
229 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
230 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
231 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
232 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
233 prostej konfiguracji oraz małej "zasobożerności".
234
235 nginx ze wsparciem tylko dla modułów poczty.
236
237 %package standard
238 Summary:        High perfomance HTTP and reverse proxy server
239 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
240 Group:          Networking/Daemons/HTTP
241 Requires(post,preun):   /sbin/chkconfig
242 Requires(post,preun,postun):    systemd-units >= 38
243 Requires:       %{name}-common = %{version}-%{release}
244 %{?with_ssl:Requires: openssl >= %{ssl_version}}
245 Provides:       nginx
246 Provides:       nginx-daemon
247 Conflicts:      logrotate < 3.7-4
248
249 %description standard
250 nginx ("engine x") is a high-performance HTTP server and reverse
251 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
252 Sysoev for Rambler.ru, Russia's second-most visited website, where it
253 has been running in production for over two and a half years. Igor has
254 released the source code under a BSD-like license. Although still in
255 beta, nginx is known for its stability, rich feature set, simple
256 configuration, and low resource consumption.
257
258 This is standard nginx version, without Perl support and IMAP, POP3,
259 SMTP proxy.
260
261 %description standard -l pl.UTF-8
262 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
263 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
264 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
265 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
266 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
267 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
268 prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x")
269 jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3
270 proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu
271 Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji
272 i działa od ponad dwóch i pół roku. Igor opublikował źródła na
273 licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął
274 dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej
275 "zasobożerności".
276
277 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
278 IMAP, POP3, SMTP.
279
280 %package -n monit-rc-nginx
281 Summary:        nginx support for monit
282 Summary(pl.UTF-8):      Wsparcie nginx dla monit
283 Group:          Applications/System
284 URL:            http://nginx.eu/
285 Requires:       %{name}-common = %{version}-%{release}
286 Requires:       monit
287
288 %description -n monit-rc-nginx
289 monitrc file for monitoring nginx webserver.
290
291 %description -n monit-rc-nginx -l pl.UTF-8
292 Plik monitrc do monitorowania serwera WWW nginx.
293
294 %prep
295 %setup -q %{?with_rtmp:-a101} %{?with_modsecurity:-a22}
296 %patch0 -p0
297 %{?with_modsecurity:%patch1 -p0}
298
299 %if %{with rtmp}
300 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
301 %endif
302
303 # build mime.types.conf
304 #sh %{SOURCE17} /etc/mime.types
305
306 %build
307 # NB: not autoconf generated configure
308 cp -f configure auto/
309
310 install -d bin
311
312 # build with default options
313 build() {
314         local type=$1; shift
315 ./configure \
316         --prefix=%{_prefix} \
317         --sbin-path=%{_sbindir}/%{name}-$type \
318         --conf-path=%{_sysconfdir}/%{name}-$type.conf \
319         --error-log-path=%{_localstatedir}/log/%{name}/%{name}-${type}_error.log \
320         --http-log-path=%{_localstatedir}/log/%{name}/%{name}-${type}_access.log \
321         --pid-path=%{_localstatedir}/run/%{name}-$type.pid \
322         --lock-path=%{_localstatedir}/lock/subsys/%{name}-$type \
323         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-$type/client_body_temp \
324         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-$type/fastcgi_temp \
325         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-$type/proxy_temp \
326         --user=nginx \
327         --group=nginx \
328         %{?with_ipv6:--with-ipv6} \
329         %{?with_select:--with-select_module} \
330         %{?with_poll:--with-poll_module} \
331         %{?with_rtsig:--with-rtsig_module} \
332         --with-cc="%{__cc}" \
333         --with-cc-opt="%{rpmcflags}" \
334         --with-ld-opt="%{rpmldflags}" \
335         %{?with_debug:--with-debug} \
336         "$@"
337 %{__make}
338 }
339
340 %if %{with modsecurity}
341 cd modsecurity-%{modsecurity_version}
342 ./autogen.sh
343 %configure \
344         --enable-standalone-module \
345         --disable-mlogc \
346         --enable-alp2 \
347         --with-lua=/usr
348 %{__make}
349 cd ..
350 %endif
351
352 %if %{with perl}
353 build perl \
354         --with-http_perl_module \
355         %{?with_addition:--with-http_addition_module} \
356         %{?with_dav:--with-http_dav_module} \
357         %{?with_flv:--with-http_flv_module} \
358         %{?with_sub:--with-http_sub_module} \
359         %{?with_realip:--with-http_realip_module} \
360         %{?with_status:--with-http_stub_status_module} \
361         %{?with_ssl:--with-http_ssl_module} \
362         %{!?with_http_browser:--without-http_browser_module} \
363         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
364         %{?with_auth_request:--with-http_auth_request_module} \
365         %{?with_threads:--with-threads} \
366         %{?with_http2:--with-http_v2_module} \
367         --with-http_secure_link_module \
368         %{nil}
369
370 mv -f objs/nginx bin/nginx-perl
371 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so
372 mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm
373 %endif
374
375 %if %{with mail}
376 build mail \
377         --without-http \
378         --with-imap \
379         --with-mail \
380         --with-mail_ssl_module \
381         %{nil}
382
383 mv -f objs/nginx bin/nginx-mail
384 %endif
385
386 %if %{with light}
387 build light \
388         %{?with_realip:--with-http_realip_module} \
389         %{?with_status:--with-http_stub_status_module} \
390         %{?with_ssl:--with-http_ssl_module} \
391         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
392         %{?with_auth_request:--with-http_auth_request_module} \
393         %{?with_threads:--with-threads} \
394         %{?with_http2:--with-http_v2_module} \
395         %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
396         --without-http_browser_module \
397         --with-http_secure_link_module \
398         %{nil}
399
400 mv -f objs/nginx bin/nginx-light
401 %endif
402
403 build standard \
404         %{?with_addition:--with-http_addition_module} \
405         %{?with_dav:--with-http_dav_module} \
406         %{?with_flv:--with-http_flv_module} \
407         %{?with_sub:--with-http_sub_module} \
408         %{?with_realip:--with-http_realip_module} \
409         %{?with_status:--with-http_stub_status_module} \
410         %{?with_ssl:--with-http_ssl_module} \
411         %{!?with_http_browser:--without-http_browser_module} \
412         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
413         %{?with_auth_request:--with-http_auth_request_module} \
414         %{?with_threads:--with-threads} \
415         %{?with_http2:--with-http_v2_module} \
416         %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
417         --with-http_secure_link_module \
418         %{nil}
419
420 mv -f objs/nginx bin/nginx-standard
421
422 %install
423 rm -rf $RPM_BUILD_ROOT
424 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
425         $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
426         $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
427         $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
428         $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
429         $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
430         $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
431         $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
432
433 cp -p conf/*_params $RPM_BUILD_ROOT%{_sysconfdir}
434 cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
435 cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
436 cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
437 cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
438 cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
439 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
440 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
441 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
442 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
443
444 install_build() {
445         local type=$1
446         %{__sed} -e "s/@type@/${type}/g" %{_sourcedir}/%{name}.conf \
447                 > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-$type.conf
448
449         install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-$type
450         %{__sed} -i -e "s/@type@/${type}/g" $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-$type
451
452         cp -p %{_sourcedir}/%{name}-$type.service $RPM_BUILD_ROOT%{systemdunitdir}
453         cp -p %{_sourcedir}/%{name}-$type.monitrc $RPM_BUILD_ROOT/etc/monit
454         install -p bin/%{name}-$type $RPM_BUILD_ROOT%{_sbindir}
455 }
456
457 install_build standard
458 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
459
460 %if %{with light}
461 install_build light
462 %endif
463
464 %if %{with perl}
465 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
466 install_build perl
467 cp -p bin/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
468 install -p bin/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
469 install -p bin/nginx-perl $RPM_BUILD_ROOT%{_sbindir}
470 %endif
471
472 %if %{with mail}
473 install_build mail
474 %endif
475
476 # only touch these for ghost packaging
477 touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params
478
479 %clean
480 rm -rf $RPM_BUILD_ROOT
481
482 %pre common
483 %groupadd -r -g 213 %{name}
484 %groupadd -g 51 http
485 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
486 %addusertogroup %{name} http
487
488 %post standard
489 for a in access.log error.log; do
490         if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
491                 umask 022
492                 touch /var/log/%{name}/nginx-standard_$a
493                 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
494                 chmod 644 /var/log/%{name}/nginx-standard_$a
495         fi
496 done
497 /sbin/chkconfig --add %{name}-standard
498 %systemd_post %{name}-standard.service
499 %service %{name}-standard force-reload
500 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
501 if ! [ -L /etc/systemd/system/nginx.service ] ; then
502         ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
503 fi
504
505 %post light
506 for a in access.log error.log; do
507         if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
508                 umask 022
509                 touch /var/log/%{name}/nginx-light_$a
510                 chown nginx:nginx /var/log/%{name}/nginx-light_$a
511                 chmod 644 /var/log/%{name}/nginx-light_$a
512         fi
513 done
514 /sbin/chkconfig --add %{name}-light
515 %systemd_post %{name}-light.service
516 %service %{name}-light force-reload
517 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
518
519 %post perl
520 for a in access.log error.log; do
521         if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
522                 umask 022
523                 touch /var/log/%{name}/nginx-perl_$a
524                 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
525                 chmod 644 /var/log/%{name}/nginx-perl_$a
526         fi
527 done
528 /sbin/chkconfig --add %{name}-perl
529 %systemd_post %{name}-perl.service
530 %service %{name}-perl force-reload
531 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
532
533 %post mail
534 for a in access.log error.log; do
535         if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
536                 umask 022
537                 touch /var/log/%{name}/nginx-mail_$a
538                 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
539                 chmod 644 /var/log/%{name}/nginx-mail_$a
540         fi
541 done
542 /sbin/chkconfig --add %{name}-mail
543 %systemd_post %{name}-mail.service
544 %service %{name}-mail force-reload
545 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
546
547 %preun standard
548 if [ "$1" = "0" ];then
549         %service %{name}-standard stop
550         /sbin/chkconfig --del %{name}-standard
551 fi
552 %systemd_preun %{name}-standard.service
553
554 %preun light
555 if [ "$1" = "0" ]; then
556         %service %{name}-light stop
557         /sbin/chkconfig --del %{name}-light
558 fi
559 %systemd_preun %{name}-light.service
560
561 %preun perl
562 if [ "$1" = "0" ]; then
563         %service %{name}-perl stop
564         /sbin/chkconfig --del %{name}-perl
565 fi
566 %systemd_preun %{name}-perl.service
567
568 %preun mail
569 if [ "$1" = "0" ]; then
570         %service %{name}-mail stop
571         /sbin/chkconfig --del %{name}-mail
572 fi
573 %systemd_preun %{name}-mail.service
574
575 %postun common
576 if [ "$1" = "0" ]; then
577         %userremove %{name}
578         %groupremove %{name}
579 fi
580
581 %postun standard
582 %systemd_reload
583
584 %postun light
585 %systemd_reload
586
587 %postun perl
588 %systemd_reload
589
590 %postun mail
591 %systemd_reload
592
593 %triggerpostun -- %{name}-standard < 1.4.1-4
594 %systemd_trigger %{name}-standard.service
595
596 %triggerpostun -- %{name}-light < 1.4.1-4
597 %systemd_trigger %{name}-light.service
598
599 %triggerpostun -- %{name}-perl < 1.4.1-4
600 %systemd_trigger %{name}-perl.service
601
602 %triggerpostun -- %{name}-mail < 1.4.1-4
603 %systemd_trigger %{name}-mail.service
604
605 %triggerpostun common -- %{name}-common < 1.8.0-2
606 # skip *this* trigger on downgrade
607 [ $1 -le 1 ] && exit 0
608 ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params
609 ln -sf scgi_params %{_sysconfdir}/scgi.params
610 ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params
611 exit 0
612
613 %files common
614 %defattr(644,root,root,755)
615 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
616 %doc %lang(ru) CHANGES.ru
617 %dir %attr(750,root,nginx) %{_sysconfdir}
618 %dir %{_nginxdir}
619 %dir %{_nginxdir}/cgi-bin
620 %dir %{_nginxdir}/html
621 %dir %{_nginxdir}/errors
622 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
623 # XXX: duplicates, don't use such glob here
624 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
625 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
626 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params
627 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params
628 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params
629 %ghost %{_sysconfdir}/fastcgi.params
630 %ghost %{_sysconfdir}/scgi.params
631 %ghost %{_sysconfdir}/uwsgi.params
632 %attr(640,root,root) %{_sysconfdir}/mime.types
633 %attr(640,root,root) %{_sysconfdir}/koi-utf
634 %attr(640,root,root) %{_sysconfdir}/koi-win
635 %attr(640,root,root) %{_sysconfdir}/win-utf
636 %dir %{_sysconfdir}/webapps.d
637 %dir %{_sysconfdir}/vhosts.d
638 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
639 %attr(750,nginx,logs) /var/log/%{name}
640 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
641 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
642 %ghost /etc/systemd/system/nginx.service
643
644 %files standard
645 %defattr(644,root,root,755)
646 %attr(755,root,root) %{_sbindir}/%{name}-standard
647 %attr(770,root,%{name}) /var/cache/%{name}-standard
648 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
649 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
650 %{systemdunitdir}/%{name}-standard.service
651
652 %if %{with mail}
653 %files mail
654 %defattr(644,root,root,755)
655 %attr(755,root,root) %{_sbindir}/%{name}-mail
656 %attr(770,root,%{name}) /var/cache/%{name}-mail
657 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
658 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
659 %{systemdunitdir}/%{name}-mail.service
660 %endif
661
662 %if %{with light}
663 %files light
664 %defattr(644,root,root,755)
665 %attr(755,root,root) %{_sbindir}/%{name}-light
666 %attr(770,root,%{name}) /var/cache/%{name}-light
667 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
668 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
669 %{systemdunitdir}/%{name}-light.service
670 %endif
671
672 %if %{with perl}
673 %files perl
674 %defattr(644,root,root,755)
675 %attr(755,root,root) %{_sbindir}/%{name}-perl
676 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
677 %attr(770,root,%{name}) /var/cache/%{name}-perl
678 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
679 %dir %{perl_vendorarch}/auto/%{name}
680 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
681 %{perl_vendorarch}/%{name}.pm
682 %{systemdunitdir}/%{name}-perl.service
683 %endif
684
685 %files -n monit-rc-nginx
686 %defattr(644,root,root,755)
687 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
688 %if %{with perl}
689 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
690 %endif
691 %if %{with light}
692 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
693 %endif
694 %if %{with mail}
695 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
696 %endif
This page took 0.594473 seconds and 4 git commands to generate.