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