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