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