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