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