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