]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
- deja vu ?
[packages/nginx.git] / nginx.spec
CommitLineData
f9e65082 1# TODO
ee4f2132 2# - /etc/sysconfig/nginx file
1c438d78 3# - missing perl build/install requires
6de999a5 4# - maybe -with-cpu-opt=CPU (pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64) ?
5# - nginx should have own group (and work with it) or use http group ?
ee4f2132 6#
362f5ab2 7# Conditional build for nginx:
056acc18 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
d0c0492d 11%bcond_without addition # adds module
12%bcond_without dav # WebDAV
13%bcond_without flv # FLV stream
d6fc4b09 14%bcond_without sub # ngx_http_sub_module
d0c0492d 15%bcond_without poll # poll
16%bcond_without realip # real ip (behind proxy)
17%bcond_without rtsig # rtsig
18%bcond_without select # select
19%bcond_without status # stats module
20%bcond_without ssl # ssl support
056acc18 21%bcond_with http_browser # header "User-agent" parser
362f5ab2 22#
8e1389c7 23Summary: High perfomance HTTP and reverse proxy server
185313bb 24Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
f9e65082 25Name: nginx
1a62642d 26Version: 0.5.33
7d80c773 27Release: 0.8
51ef519b 28License: BSD-like
7d9b86c7 29Group: Networking/Daemons
f1fc9780 30Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
1a62642d 31# Source0-md5: a78be74b4fd8e009545ef02488fcac86
226bcc40 32Source1: http://www.nginx.eu/favicon.ico
33# Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
34Source2: http://www.nginx.eu/download/proxy.conf
35# Source2-md5: f5263ae01c2edb18f46d5d1df2d3a5cd
36Source3: %{name}.logrotate
37Source4: %{name}.mime
38Source5: %{name}-light.conf
39Source6: %{name}-light.monitrc
0da077af 40Source7: %{name}-light.init
41Source8: %{name}-mail.conf
42Source9: %{name}-mail.monitrc
43Source10: %{name}-mail.init
44Source11: %{name}-perl.conf
45Source12: %{name}-perl.monitrc
46Source13: %{name}-perl.init
47Source14: %{name}-standard.conf
48Source15: %{name}-standard.monitrc
7d80c773 49Source16: %{name}-standard.init
50Source17: %{name}-mime.types.sh
f1fc9780 51Patch0: %{name}-config.patch
51ef519b 52URL: http://nginx.net/
dfef7372 53BuildRequires: mailcap
f9e65082 54BuildRequires: openssl-devel
f1fc9780 55BuildRequires: pcre-devel
1c438d78 56%{?with_perl:BuildRequires: perl-CGI}
d0c0492d 57%{?with_perl:BuildRequires: perl-devel}
1c438d78 58%{?with_perl:BuildRequires: rpm-perlprov}
7d9b86c7 59BuildRequires: rpmbuild(macros) >= 1.268
f9e65082 60BuildRequires: zlib-devel
7d9b86c7
ER
61Requires(post,preun): /sbin/chkconfig
62Requires(postun): /usr/sbin/groupdel
63Requires(postun): /usr/sbin/userdel
64Requires(pre): /bin/id
65Requires(pre): /usr/bin/getgid
66Requires(pre): /usr/sbin/groupadd
67Requires(pre): /usr/sbin/useradd
119e2f19 68Requires: nginx-daemon
d0c0492d 69Requires: openssl
70Requires: pcre
aba2d783 71Requires: rc-scripts >= 0.2.0
d0c0492d 72Requires: zlib
1cf92547 73Suggests: nginx-standard
ee547c00 74Provides: group(http)
75Provides: group(nginx)
76Provides: user(nginx)
7ffe7917 77Provides: webserver
226bcc40 78Conflicts: logrotate < 3.7-4
f9e65082
ER
79BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80
362f5ab2 81%define _sysconfdir /etc/%{name}
82%define _nginxdir /home/services/%{name}
f9e65082
ER
83
84%description
894ff1f7
ER
85Nginx ("engine x") is a high-performance HTTP server and reverse
86proxy, as well as an IMAP/POP3 proxy server. Nginx was written by Igor
87Sysoev for Rambler.ru, Russia's second-most visited website, where it
88has been running in production for over two and a half years. Igor has
89released the source code under a BSD-like license. Although still in
90beta, Nginx is known for its stability, rich feature set, simple
91configuration, and low resource consumption.
8e1389c7 92
b0fa7cc6 93Common files for Nginx daemon.
85600569 94
390f5b88 95%description -l pl.UTF-8
056acc18 96Nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
97a także IMAP/POP3 proxy. Nginx został napisany przez Igora Sysoev'a
98na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
99odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
100opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
1dc54c84 101w fazie beta, już zasłynął dzieki stabilności, bogactwu dodatków,
102prostej konfiguracji oraz małej "zasobożerności".
2ee780b1 103
1dc54c84 104Niezbędne pliki dla Nginx.
85600569 105
2ee780b1 106%package light
107Summary: High perfomance HTTP and reverse proxy server
7ad53968 108Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
85600569 109License: BSD-like
110Group: Networking/Daemons
111URL: http://nginx.net/
112Requires(post,preun): /sbin/chkconfig
113Requires(postun): /usr/sbin/groupdel
114Requires(postun): /usr/sbin/userdel
b0fa7cc6 115Requires: %{name} = %{version}-%{release}
85600569 116Requires: openssl
117Requires: pcre
118Requires: zlib
2ee780b1 119Provides: group(http)
120Provides: group(nginx)
119e2f19 121Provides: nginx-daemon
2ee780b1 122Provides: user(nginx)
123Provides: webserver
124
125%description light
7ad53968 126The smallest, but also the fastest Nginx edition. No additional
127modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
2ee780b1 128
129%description light -l pl.UTF-8
1cf92547 130Najmniejsza i najszybsza wersja Nginx. Bez wsparcia dla Perla, DAV,
131FLV oraz IMAP, POP3, SMTP proxy.
2ee780b1 132
133%package perl
134Summary: High perfomance HTTP and reverse proxy server
7ad53968 135Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
85600569 136License: BSD-like
137Group: Networking/Daemons
d6fc4b09 138URL: http://nginx.net/
85600569 139Requires(post,preun): /sbin/chkconfig
140Requires(postun): /usr/sbin/groupdel
141Requires(postun): /usr/sbin/userdel
b0fa7cc6 142Requires: %{name} = %{version}-%{release}
85600569 143Requires: openssl
2ee780b1 144Provides: group(http)
145Provides: group(nginx)
1cf92547 146Provides: nginx-daemon
2ee780b1 147Provides: user(nginx)
148Provides: webserver
149
150%description perl
7ad53968 151Nginx with Perl support. Mail modules not included.
2ee780b1 152
153%description perl -l pl.UTF-8
7ad53968 154Nignx z obsługą Perla. Bez wsparcia dla modułów poczty.
2ee780b1 155
156%package mail
157Summary: High perfomance HTTP and reverse proxy server
7ad53968 158Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
85600569 159License: BSD-like
160Group: Networking/Daemons
161URL: http://nginx.net/
162Requires(post,preun): /sbin/chkconfig
163Requires(postun): /usr/sbin/groupdel
164Requires(postun): /usr/sbin/userdel
b0fa7cc6 165Requires: %{name} = %{version}-%{release}
85600569 166Requires: openssl
167Requires: pcre
168Requires: zlib
2ee780b1 169Provides: group(http)
170Provides: group(nginx)
1cf92547 171Provides: nginx-daemon
2ee780b1 172Provides: user(nginx)
173Provides: webserver
174
175%description mail
176Nginx with mail support. Only mail modules included.
177
178%description mail -l pl.UTF-8
7ad53968 179Nginx ze wsparciem tylko dla modułów poczty.
2ee780b1 180
b0fa7cc6 181%package standard
2ee780b1 182Summary: Configuration files and documentation for Nginx
183Summary(pl.UTF-8): Pliki konfiguracyjne i dokumentacja dla Nginx
d6fc4b09 184License: BSD-like
2ee780b1 185Group: Networking/Daemons
d6fc4b09 186URL: http://nginx.net/
187Requires(post,preun): /sbin/chkconfig
188Requires(postun): /usr/sbin/groupdel
189Requires(postun): /usr/sbin/userdel
b0fa7cc6 190Requires: %{name} = %{version}-%{release}
6de999a5 191Requires: openssl
192Provides: group(http)
193Provides: group(nginx)
1cf92547 194Provides: nginx-daemon
d6fc4b09 195Conflicts: logrotate < 3.7-4
28a25161 196
b0fa7cc6 197%description standard
85600569 198Nginx ("engine x") is a high-performance HTTP server and reverse
199proxy, as well as an IMAP/POP3 proxy server. Nginx was written by Igor
200Sysoev for Rambler.ru, Russia's second-most visited website, where it
201has been running in production for over two and a half years. Igor has
202released the source code under a BSD-like license. Although still in
203beta, Nginx is known for its stability, rich feature set, simple
204configuration, and low resource consumption.
205
1dc54c84 206This is standard Nginx version, without Perl support and IMAP, POP3,
207SMTP proxy.
fccff804 208
b0fa7cc6 209%description standard -l pl.UTF-8
85600569 210Nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
7ad53968 211a także IMAP/POP3 proxy. Nginx został napisany przez Igora Sysoev'a
212na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
213odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
214opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
1dc54c84 215w fazie beta, już zasłynął dzieki stabilności, bogactwu dodatków,
216prostej konfiguracji oraz małej "zasobożerności".
85600569 217
1dc54c84 218To jest standardowa wersja Nginx, bez obsługi Perla oraz proxy dla
219IMAP, POP3, SMTP.
85600569 220
dd7459ac 221%package -n monit-rc-nginx
60b8f836 222Summary: Nginx support for monit
223Summary(pl.UTF-8): Wsparcie Nginx dla monit
224License: BSD-like
225Group: Applications/System
226URL: http://nginx.eu/
60b8f836 227Requires: %{name} = %{version}-%{release}
1cf92547 228Requires: monit
dd7459ac 229
230%description -n monit-rc-nginx
1dc54c84 231monitrc file for monitoring Nginx webserver server.
dd7459ac 232
233%description -n monit-rc-nginx -l pl.UTF-8
1dc54c84 234Plik monitrc do monitorowania serwera WWW Nginx.
dd7459ac 235
f9e65082
ER
236%prep
237%setup -q
f1fc9780 238%patch0 -p0
f9e65082 239
a8eaad11 240# build mime.types.conf
7d80c773 241#sh %{SOURCE17} /etc/mime.types
a8eaad11 242
f9e65082
ER
243%build
244# NB: not autoconf generated configure
056acc18 245cp -f configure auto/
246#
247%if %{with perl}
248./configure \
249 --prefix=%{_prefix} \
4e61eac8 250 --sbin-path=%{_sbindir}/%{name}-perl \
251 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
252 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
253 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
254 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
255 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
056acc18 256 --user=nginx \
257 --group=nginx \
258 --with-http_perl_module \
2ee780b1 259 --without-mail_pop3_module \
260 --without-mail_imap_module \
261 --without-mail_smtp_module \
056acc18 262 %{?with_addition:--with-http_addition_module} \
263 %{?with_dav:--with-http_dav_module} \
264 %{?with_flv:--with-http_flv_module} \
d6fc4b09 265 %{?with_sub:--with-http_sub_module} \
056acc18 266 %{?with_poll:--with-poll_module} \
267 %{?with_realip:--with-http_realip_module} \
268 %{?with_rtsig:--with-rtsig_module} \
269 %{?with_select:--with-select_module} \
270 %{?with_status:--with-http_stub_status_module} \
271 %{?with_ssl:--with-http_ssl_module} \
272 %{!?with_http_browser:--without-http_browser_module} \
4e61eac8 273 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
274 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
275 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
056acc18 276 --with-cc="%{__cc}" \
277 --with-cc-opt="%{rpmcflags}" \
278 --with-ld-opt="%{rpmldflags}"
279%{__make}
4e61eac8 280mv -f objs/nginx contrib/nginx-perl
d6fc4b09 281mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs
282mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
283mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
056acc18 284%endif
285
286%if %{with mail}
056acc18 287./configure \
288 --prefix=%{_prefix} \
4e61eac8 289 --sbin-path=%{_sbindir}/%{name}-mail \
290 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
291 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
292 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
293 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
294 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
056acc18 295 --user=nginx \
296 --group=nginx \
297 --with-imap \
298 --with-mail \
299 --with-mail_ssl_module \
d6fc4b09 300 --without-http \
056acc18 301 %{?with_poll:--with-poll_module} \
056acc18 302 %{?with_rtsig:--with-rtsig_module} \
303 %{?with_select:--with-select_module} \
4e61eac8 304 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
305 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
306 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
056acc18 307 --with-cc="%{__cc}" \
308 --with-cc-opt="%{rpmcflags}" \
309 --with-ld-opt="%{rpmldflags}" \
310 %{?debug:--with-debug}
311%{__make}
4e61eac8 312mv -f objs/nginx contrib/nginx-mail
056acc18 313%endif
314
315%if %{with light}
056acc18 316./configure \
317 --prefix=%{_prefix} \
4e61eac8 318 --sbin-path=%{_sbindir}/%{name}-light \
319 --conf-path=%{_sysconfdir}/%{name}-light.conf \
320 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
321 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
322 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
323 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
056acc18 324 --user=nginx \
325 --group=nginx \
326 %{?with_poll:--with-poll_module} \
327 %{?with_realip:--with-http_realip_module} \
328 %{?with_rtsig:--with-rtsig_module} \
329 %{?with_select:--with-select_module} \
330 %{?with_status:--with-http_stub_status_module} \
331 %{?with_ssl:--with-http_ssl_module} \
332 --without-http_browser_module \
1a62642d 333 --without-mail_pop3_module \
334 --without-mail_imap_module \
335 --without-mail_smtp_module \
4e61eac8 336 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
337 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
338 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
056acc18 339 --with-cc="%{__cc}" \
340 --with-cc-opt="%{rpmcflags}" \
341 --with-ld-opt="%{rpmldflags}" \
342 %{?debug:--with-debug}
343%{__make}
4e61eac8 344mv -f objs/nginx contrib/nginx-light
056acc18 345%endif
346
f9e65082
ER
347./configure \
348 --prefix=%{_prefix} \
226bcc40 349 --sbin-path=%{_sbindir}/%{name}-standard \
f1686a52 350 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
226bcc40 351 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
352 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
353 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
354 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
dfef7372
ER
355 --user=nginx \
356 --group=nginx \
d0c0492d 357 %{?with_addition:--with-http_addition_module} \
358 %{?with_dav:--with-http_dav_module} \
359 %{?with_flv:--with-http_flv_module} \
d6fc4b09 360 %{?with_sub:--with-http_sub_module} \
d0c0492d 361 %{?with_poll:--with-poll_module} \
362 %{?with_realip:--with-http_realip_module} \
362f5ab2 363 %{?with_rtsig:--with-rtsig_module} \
364 %{?with_select:--with-select_module} \
d0c0492d 365 %{?with_status:--with-http_stub_status_module} \
362f5ab2 366 %{?with_ssl:--with-http_ssl_module} \
ee4f2132 367 %{!?with_http_browser:--without-http_browser_module} \
226bcc40 368 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
369 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
370 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
f9e65082
ER
371 --with-cc="%{__cc}" \
372 --with-cc-opt="%{rpmcflags}" \
373 --with-ld-opt="%{rpmldflags}" \
374 %{?debug:--with-debug}
f9e65082
ER
375%{__make}
376
056acc18 377
f9e65082
ER
378%install
379rm -rf $RPM_BUILD_ROOT
362f5ab2 380install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
381 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
4e61eac8 382 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
226bcc40 383 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
384 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
28a25161 385 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
386 $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
f9e65082 387
7d80c773 388install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
389install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
cd728db7 390install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
391install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
226bcc40 392install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
393install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
394install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
395install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
0da077af 396install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
397install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
398install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
de0bfb9b 399install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
85600569 400
401%if %{with light}
226bcc40 402install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
403install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
0da077af 404install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
4e61eac8 405install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
85600569 406%endif
407
408%if %{with mail}
0da077af 409install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
410install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
411install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
4e61eac8 412install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
85600569 413%endif
414
415%if %{with perl}
416install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
0da077af 417install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
418install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
419install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
d6fc4b09 420install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
421install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
422install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
4e61eac8 423install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
85600569 424%endif
f9e65082
ER
425
426rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
427rm -rf $RPM_BUILD_ROOT%{_prefix}/html
428
429%clean
430rm -rf $RPM_BUILD_ROOT
431
b0fa7cc6 432%pre
a37373c3 433%groupadd -r -g 213 %{name}
362f5ab2 434%groupadd -g 51 http
a37373c3 435%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 436%addusertogroup %{name} http
f1fc9780 437
738166d2 438%post standard
439for a in access.log error.log; do
440 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
441 touch /var/log/%{name}/nginx-standard_$a
1cf92547 442 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
738166d2 443 chmod 644 /var/log/%{name}/nginx-standard_$a
444 fi
445done
3d760264
ER
446/sbin/chkconfig --add %{name}-standard
447%service %{name}-standard restart
448echo 'NOTE: daemon is now using "/etc/nginx/nginx-standard.conf" as config.'
738166d2 449
450%post light
451for a in access.log error.log; do
452 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
453 touch /var/log/%{name}/nginx-light_$a
454 chown nginx:nginx /var/log/%{name}/nginx-light_$a
455 chmod 644 /var/log/%{name}/nginx-light_$a
456 fi
457done
3d760264
ER
458/sbin/chkconfig --add %{name}-light
459%service %{name}-light restart
460echo 'NOTE: daemon is now using "/etc/nginx/nginx-light.conf" file'
738166d2 461
462%post perl
463for a in access.log error.log; do
464 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
465 touch /var/log/%{name}/nginx-perl_$a
466 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
467 chmod 644 /var/log/%{name}/nginx-perl_$a
468 fi
469done
3d760264
ER
470/sbin/chkconfig --add %{name}-perl
471%service %{name}-perl restart
472echo 'NOTE: daemon is now using "/etc/nginx/nginx-perl.conf" file'
738166d2 473
474%post mail
362f5ab2 475for a in access.log error.log; do
738166d2 476 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
477 touch /var/log/%{name}/nginx-mail_$a
478 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
479 chmod 644 /var/log/%{name}/nginx-mail_$a
362f5ab2 480 fi
481done
3d760264
ER
482/sbin/chkconfig --add %{name}-mail
483%service %{name}-mail restart
484echo 'NOTE: daemon is now using "/etc/nginx/nginx-mail.conf" file'
f9e65082 485
b0fa7cc6 486%preun standard
7d80c773 487if [ "$1" = "0" ];then
6eef4074 488 %service %{name}-standard stop
226bcc40 489 /sbin/chkconfig --del %{name}-standard
f9e65082 490fi
f9e65082 491
0663f9da 492%preun light
493if [ "$1" = "0" ]; then
6eef4074 494 %service %{name}-light stop
226bcc40 495 /sbin/chkconfig --del %{name}-light
0663f9da 496fi
497
498%preun perl
499if [ "$1" = "0" ]; then
6eef4074 500 %service %{name}-perl stop
226bcc40 501 /sbin/chkconfig --del %{name}-perl
0663f9da 502fi
503
504%preun mail
505if [ "$1" = "0" ]; then
6eef4074 506 %service %{name}-mail stop
226bcc40 507 /sbin/chkconfig --del %{name}-mail
0663f9da 508fi
509
b0fa7cc6 510%postun
f1fc9780 511if [ "$1" = "0" ]; then
7d9b86c7
ER
512 %userremove %{name}
513 %groupremove %{name}
f1fc9780 514fi
515
f9e65082
ER
516%files
517%defattr(644,root,root,755)
6f8318ed 518%doc CHANGES LICENSE README html/index.html conf/nginx.conf
f9e65082 519%doc %lang(ru) CHANGES.ru
f1fc9780 520%dir %attr(754,root,root) %{_sysconfdir}
164ab75d 521%dir %{_nginxdir}
522%dir %{_nginxdir}/cgi-bin
523%dir %{_nginxdir}/html
524%dir %{_nginxdir}/errors
28a25161 525%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
f1fc9780 526%attr(640,root,root) %{_sysconfdir}/*[_-]*
362f5ab2 527%attr(640,root,root) %{_sysconfdir}/proxy.conf
f1fc9780 528%attr(640,root,root) %{_sysconfdir}/mime.types
fb1687bb 529%attr(750,root,root) %dir /var/log/archive/%{name}
f1fc9780 530%attr(750,%{name},logs) /var/log/%{name}
475fecd1 531%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
cd728db7 532%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
28a25161 533
b0fa7cc6 534%files standard
535%defattr(644,root,root,755)
de0bfb9b 536%attr(755,root,root) %{_sbindir}/%{name}-standard
1846cd14 537%attr(770,root,%{name}) /var/cache/%{name}-standard
0da077af 538%attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
4ddbebd7 539%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
b0fa7cc6 540
85600569 541%if %{with mail}
542%files mail
543%defattr(644,root,root,755)
4e61eac8 544%attr(755,root,root) %{_sbindir}/%{name}-mail
1846cd14 545%attr(770,root,%{name}) /var/cache/%{name}-mail
0da077af 546%attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
4ddbebd7 547%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
85600569 548%endif
549
550%if %{with light}
551%files light
552%defattr(644,root,root,755)
4e61eac8 553%attr(755,root,root) %{_sbindir}/%{name}-light
1846cd14 554%attr(770,root,%{name}) /var/cache/%{name}-light
0da077af 555%attr(754,root,root) /etc/rc.d/init.d/%{name}-light
4ddbebd7 556%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
85600569 557%endif
558
559%if %{with perl}
560%files perl
561%defattr(644,root,root,755)
4e61eac8 562%attr(755,root,root) %{_sbindir}/%{name}-perl
0da077af 563%attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
f7b57295 564%attr(770,root,%{name}) /var/cache/%{name}-perl
1846cd14 565%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
85600569 566%dir %{perl_vendorarch}/auto/%{name}
567%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
568%attr(700,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.bs
569%attr(700,root,root) %{perl_vendorarch}/%{name}.pm
dd7459ac 570%endif
571
572%files -n monit-rc-nginx
573%defattr(644,root,root,755)
574%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
575%if %{with perl}
1846cd14 576%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
85600569 577%endif
dd7459ac 578%if %{with light}
579%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
580%endif
581%if %{with mail}
582%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
583%endif
This page took 0.176525 seconds and 4 git commands to generate.