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