]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
- oops, more ipv6
[packages/nginx.git] / nginx.spec
CommitLineData
f9e65082 1# TODO
ee4f2132 2# - /etc/sysconfig/nginx file
1c438d78 3# - missing perl build/install requires
6de999a5 4# - nginx should have own group (and work with it) or use http group ?
ee4f2132 5#
362f5ab2 6# Conditional build for nginx:
056acc18 7%bcond_without light # don't build light version
8%bcond_without mail # don't build imap/mail proxy
9%bcond_without perl # don't build with perl module
d0c0492d 10%bcond_without addition # adds module
11%bcond_without dav # WebDAV
12%bcond_without flv # FLV stream
3d4bad81 13%bcond_without ipv6 # build without ipv6 support
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
fa3636be 26Version: 0.8.54
27Release: 1
51ef519b 28License: BSD-like
cbf76340 29Group: Networking/Daemons/HTTP
f1fc9780 30Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
fa3636be 31# Source0-md5: 44df4eb6a22d725021288c570789046f
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
51ef519b 51URL: http://nginx.net/
dfef7372 52BuildRequires: mailcap
f9e65082 53BuildRequires: openssl-devel
f1fc9780 54BuildRequires: pcre-devel
1c438d78 55%{?with_perl:BuildRequires: perl-CGI}
d0c0492d 56%{?with_perl:BuildRequires: perl-devel}
dd2388c2 57%{?with_perl:BuildRequires: python}
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
57f21172 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
894ff1f7
ER
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
57f21172 90beta, nginx is known for its stability, rich feature set, simple
894ff1f7 91configuration, and low resource consumption.
8e1389c7 92
57f21172 93Common files for nginx daemon.
85600569 94
390f5b88 95%description -l pl.UTF-8
57f21172 96nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
97a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
056acc18 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
98376457 101w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
1dc54c84 102prostej konfiguracji oraz małej "zasobożerności".
2ee780b1 103
57f21172 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
cbf76340 109Group: Networking/Daemons/HTTP
85600569 110Requires(post,preun): /sbin/chkconfig
111Requires(postun): /usr/sbin/groupdel
112Requires(postun): /usr/sbin/userdel
b0fa7cc6 113Requires: %{name} = %{version}-%{release}
85600569 114Requires: openssl
115Requires: pcre
116Requires: zlib
2ee780b1 117Provides: group(http)
118Provides: group(nginx)
119e2f19 119Provides: nginx-daemon
2ee780b1 120Provides: user(nginx)
121Provides: webserver
122
123%description light
57f21172 124The smallest, but also the fastest nginx edition. No additional
7ad53968 125modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
2ee780b1 126
127%description light -l pl.UTF-8
57f21172 128Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
1cf92547 129FLV oraz IMAP, POP3, SMTP proxy.
2ee780b1 130
131%package perl
132Summary: High perfomance HTTP and reverse proxy server
7ad53968 133Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
cbf76340 134Group: Networking/Daemons/HTTP
85600569 135Requires(post,preun): /sbin/chkconfig
136Requires(postun): /usr/sbin/groupdel
137Requires(postun): /usr/sbin/userdel
b0fa7cc6 138Requires: %{name} = %{version}-%{release}
85600569 139Requires: openssl
2ee780b1 140Provides: group(http)
141Provides: group(nginx)
1cf92547 142Provides: nginx-daemon
2ee780b1 143Provides: user(nginx)
144Provides: webserver
145
146%description perl
57f21172 147nginx with Perl support. Mail modules not included.
2ee780b1 148
149%description perl -l pl.UTF-8
57f21172 150nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
2ee780b1 151
152%package mail
57f21172 153Summary: High perfomance IMAP, POP3, SMTP proxy server
154Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
cbf76340 155Group: Networking/Daemons/HTTP
85600569 156Requires(post,preun): /sbin/chkconfig
157Requires(postun): /usr/sbin/groupdel
158Requires(postun): /usr/sbin/userdel
b0fa7cc6 159Requires: %{name} = %{version}-%{release}
85600569 160Requires: openssl
161Requires: pcre
162Requires: zlib
2ee780b1 163Provides: group(http)
164Provides: group(nginx)
1cf92547 165Provides: nginx-daemon
2ee780b1 166Provides: user(nginx)
167Provides: webserver
168
169%description mail
57f21172 170nginx with mail support. Only mail modules included.
2ee780b1 171
172%description mail -l pl.UTF-8
57f21172 173nginx ze wsparciem tylko dla modułów poczty.
2ee780b1 174
b0fa7cc6 175%package standard
57f21172 176Summary: High perfomance HTTP and reverse proxy server
4ca0234e 177Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
cbf76340 178Group: Networking/Daemons/HTTP
d6fc4b09 179Requires(post,preun): /sbin/chkconfig
180Requires(postun): /usr/sbin/groupdel
181Requires(postun): /usr/sbin/userdel
b0fa7cc6 182Requires: %{name} = %{version}-%{release}
6de999a5 183Requires: openssl
184Provides: group(http)
185Provides: group(nginx)
1cf92547 186Provides: nginx-daemon
d6fc4b09 187Conflicts: logrotate < 3.7-4
28a25161 188
b0fa7cc6 189%description standard
57f21172 190This is standard nginx version, without Perl support and IMAP, POP3,
1dc54c84 191SMTP proxy.
fccff804 192
b0fa7cc6 193%description standard -l pl.UTF-8
57f21172 194To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
1dc54c84 195IMAP, POP3, SMTP.
85600569 196
dd7459ac 197%package -n monit-rc-nginx
57f21172 198Summary: nginx support for monit
199Summary(pl.UTF-8): Wsparcie nginx dla monit
60b8f836 200Group: Applications/System
201URL: http://nginx.eu/
60b8f836 202Requires: %{name} = %{version}-%{release}
1cf92547 203Requires: monit
dd7459ac 204
205%description -n monit-rc-nginx
57f21172 206monitrc file for monitoring nginx webserver.
dd7459ac 207
208%description -n monit-rc-nginx -l pl.UTF-8
57f21172 209Plik monitrc do monitorowania serwera WWW nginx.
dd7459ac 210
f9e65082
ER
211%prep
212%setup -q
f9e65082 213
a8eaad11 214# build mime.types.conf
7d80c773 215#sh %{SOURCE17} /etc/mime.types
a8eaad11 216
f9e65082
ER
217%build
218# NB: not autoconf generated configure
056acc18 219cp -f configure auto/
220#
221%if %{with perl}
222./configure \
223 --prefix=%{_prefix} \
4e61eac8 224 --sbin-path=%{_sbindir}/%{name}-perl \
225 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
226 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
227 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
228 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
229 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
056acc18 230 --user=nginx \
231 --group=nginx \
232 --with-http_perl_module \
2ee780b1 233 --without-mail_pop3_module \
234 --without-mail_imap_module \
235 --without-mail_smtp_module \
056acc18 236 %{?with_addition:--with-http_addition_module} \
237 %{?with_dav:--with-http_dav_module} \
238 %{?with_flv:--with-http_flv_module} \
3d4bad81 239 %{?with_ipv6:--with-ipv6} \
d6fc4b09 240 %{?with_sub:--with-http_sub_module} \
056acc18 241 %{?with_poll:--with-poll_module} \
242 %{?with_realip:--with-http_realip_module} \
243 %{?with_rtsig:--with-rtsig_module} \
244 %{?with_select:--with-select_module} \
245 %{?with_status:--with-http_stub_status_module} \
246 %{?with_ssl:--with-http_ssl_module} \
247 %{!?with_http_browser:--without-http_browser_module} \
4e61eac8 248 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
249 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
250 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
056acc18 251 --with-cc="%{__cc}" \
252 --with-cc-opt="%{rpmcflags}" \
253 --with-ld-opt="%{rpmldflags}"
254%{__make}
4e61eac8 255mv -f objs/nginx contrib/nginx-perl
d6fc4b09 256mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs
257mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
258mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
056acc18 259%endif
260
261%if %{with mail}
056acc18 262./configure \
263 --prefix=%{_prefix} \
4e61eac8 264 --sbin-path=%{_sbindir}/%{name}-mail \
265 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
266 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
267 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
268 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
269 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
056acc18 270 --user=nginx \
271 --group=nginx \
272 --with-imap \
273 --with-mail \
274 --with-mail_ssl_module \
d6fc4b09 275 --without-http \
129a70a2 276 %{?with_ipv6:--with-ipv6} \
056acc18 277 %{?with_poll:--with-poll_module} \
056acc18 278 %{?with_rtsig:--with-rtsig_module} \
279 %{?with_select:--with-select_module} \
4e61eac8 280 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
281 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
282 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
056acc18 283 --with-cc="%{__cc}" \
284 --with-cc-opt="%{rpmcflags}" \
285 --with-ld-opt="%{rpmldflags}" \
286 %{?debug:--with-debug}
287%{__make}
4e61eac8 288mv -f objs/nginx contrib/nginx-mail
056acc18 289%endif
290
291%if %{with light}
056acc18 292./configure \
293 --prefix=%{_prefix} \
4e61eac8 294 --sbin-path=%{_sbindir}/%{name}-light \
295 --conf-path=%{_sysconfdir}/%{name}-light.conf \
296 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
297 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
298 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
299 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
056acc18 300 --user=nginx \
301 --group=nginx \
129a70a2 302 %{?with_ipv6:--with-ipv6} \
056acc18 303 %{?with_poll:--with-poll_module} \
304 %{?with_realip:--with-http_realip_module} \
305 %{?with_rtsig:--with-rtsig_module} \
306 %{?with_select:--with-select_module} \
307 %{?with_status:--with-http_stub_status_module} \
308 %{?with_ssl:--with-http_ssl_module} \
309 --without-http_browser_module \
1a62642d 310 --without-mail_pop3_module \
311 --without-mail_imap_module \
312 --without-mail_smtp_module \
4e61eac8 313 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
314 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
315 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
056acc18 316 --with-cc="%{__cc}" \
317 --with-cc-opt="%{rpmcflags}" \
318 --with-ld-opt="%{rpmldflags}" \
319 %{?debug:--with-debug}
320%{__make}
4e61eac8 321mv -f objs/nginx contrib/nginx-light
056acc18 322%endif
323
f9e65082
ER
324./configure \
325 --prefix=%{_prefix} \
226bcc40 326 --sbin-path=%{_sbindir}/%{name}-standard \
f1686a52 327 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
226bcc40 328 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
329 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
330 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
331 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
dfef7372
ER
332 --user=nginx \
333 --group=nginx \
d0c0492d 334 %{?with_addition:--with-http_addition_module} \
335 %{?with_dav:--with-http_dav_module} \
336 %{?with_flv:--with-http_flv_module} \
129a70a2 337 %{?with_ipv6:--with-ipv6} \
d6fc4b09 338 %{?with_sub:--with-http_sub_module} \
d0c0492d 339 %{?with_poll:--with-poll_module} \
340 %{?with_realip:--with-http_realip_module} \
362f5ab2 341 %{?with_rtsig:--with-rtsig_module} \
342 %{?with_select:--with-select_module} \
d0c0492d 343 %{?with_status:--with-http_stub_status_module} \
362f5ab2 344 %{?with_ssl:--with-http_ssl_module} \
ee4f2132 345 %{!?with_http_browser:--without-http_browser_module} \
226bcc40 346 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
347 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
348 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
f9e65082
ER
349 --with-cc="%{__cc}" \
350 --with-cc-opt="%{rpmcflags}" \
351 --with-ld-opt="%{rpmldflags}" \
352 %{?debug:--with-debug}
f9e65082
ER
353%{__make}
354
056acc18 355
f9e65082
ER
356%install
357rm -rf $RPM_BUILD_ROOT
362f5ab2 358install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
359 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
4e61eac8 360 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
226bcc40 361 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
362 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
28a25161 363 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
364 $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
f9e65082 365
7d80c773 366install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
57f21172 367install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
368install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
369install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
cd728db7 370install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
371install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
226bcc40 372install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
373install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
374install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
375install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
0da077af 376install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
377install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
378install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
de0bfb9b 379install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
85600569 380
381%if %{with light}
226bcc40 382install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
383install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
0da077af 384install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
4e61eac8 385install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
85600569 386%endif
387
388%if %{with mail}
0da077af 389install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
390install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
391install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
4e61eac8 392install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
85600569 393%endif
394
395%if %{with perl}
396install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
0da077af 397install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
398install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
399install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
d6fc4b09 400install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
401install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
402install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
4e61eac8 403install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
85600569 404%endif
f9e65082
ER
405
406rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
407rm -rf $RPM_BUILD_ROOT%{_prefix}/html
408
409%clean
410rm -rf $RPM_BUILD_ROOT
411
b0fa7cc6 412%pre
a37373c3 413%groupadd -r -g 213 %{name}
362f5ab2 414%groupadd -g 51 http
a37373c3 415%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 416%addusertogroup %{name} http
f1fc9780 417
738166d2 418%post standard
419for a in access.log error.log; do
420 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
98376457 421 umask 022
738166d2 422 touch /var/log/%{name}/nginx-standard_$a
1cf92547 423 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
738166d2 424 chmod 644 /var/log/%{name}/nginx-standard_$a
425 fi
426done
3d760264
ER
427/sbin/chkconfig --add %{name}-standard
428%service %{name}-standard restart
429echo 'NOTE: daemon is now using "/etc/nginx/nginx-standard.conf" as config.'
738166d2 430
431%post light
432for a in access.log error.log; do
433 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
98376457 434 umask 022
738166d2 435 touch /var/log/%{name}/nginx-light_$a
436 chown nginx:nginx /var/log/%{name}/nginx-light_$a
437 chmod 644 /var/log/%{name}/nginx-light_$a
438 fi
439done
3d760264
ER
440/sbin/chkconfig --add %{name}-light
441%service %{name}-light restart
57f21172 442echo 'NOTE: daemon is now using "/etc/nginx/nginx-light.conf" as config'
738166d2 443
444%post perl
445for a in access.log error.log; do
446 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
98376457 447 umask 022
738166d2 448 touch /var/log/%{name}/nginx-perl_$a
449 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
450 chmod 644 /var/log/%{name}/nginx-perl_$a
451 fi
452done
3d760264
ER
453/sbin/chkconfig --add %{name}-perl
454%service %{name}-perl restart
57f21172 455echo 'NOTE: daemon is now using "/etc/nginx/nginx-perl.conf" as config'
738166d2 456
457%post mail
362f5ab2 458for a in access.log error.log; do
738166d2 459 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
98376457 460 umask 022
738166d2 461 touch /var/log/%{name}/nginx-mail_$a
462 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
463 chmod 644 /var/log/%{name}/nginx-mail_$a
362f5ab2 464 fi
465done
3d760264
ER
466/sbin/chkconfig --add %{name}-mail
467%service %{name}-mail restart
57f21172 468echo 'NOTE: daemon is now using "/etc/nginx/nginx-mail.conf" as config'
f9e65082 469
b0fa7cc6 470%preun standard
7d80c773 471if [ "$1" = "0" ];then
6eef4074 472 %service %{name}-standard stop
226bcc40 473 /sbin/chkconfig --del %{name}-standard
f9e65082 474fi
f9e65082 475
0663f9da 476%preun light
477if [ "$1" = "0" ]; then
6eef4074 478 %service %{name}-light stop
226bcc40 479 /sbin/chkconfig --del %{name}-light
0663f9da 480fi
481
482%preun perl
483if [ "$1" = "0" ]; then
6eef4074 484 %service %{name}-perl stop
226bcc40 485 /sbin/chkconfig --del %{name}-perl
0663f9da 486fi
487
488%preun mail
489if [ "$1" = "0" ]; then
6eef4074 490 %service %{name}-mail stop
226bcc40 491 /sbin/chkconfig --del %{name}-mail
0663f9da 492fi
493
b0fa7cc6 494%postun
f1fc9780 495if [ "$1" = "0" ]; then
7d9b86c7
ER
496 %userremove %{name}
497 %groupremove %{name}
f1fc9780 498fi
499
f9e65082
ER
500%files
501%defattr(644,root,root,755)
6f8318ed 502%doc CHANGES LICENSE README html/index.html conf/nginx.conf
f9e65082 503%doc %lang(ru) CHANGES.ru
f1fc9780 504%dir %attr(754,root,root) %{_sysconfdir}
164ab75d 505%dir %{_nginxdir}
506%dir %{_nginxdir}/cgi-bin
507%dir %{_nginxdir}/html
508%dir %{_nginxdir}/errors
28a25161 509%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
98376457 510# XXX: duplicates, don't use such glob here
57f21172 511#%attr(640,root,root) %{_sysconfdir}/*[_-]*
98376457 512%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
394dc7b0 513%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
f1fc9780 514%attr(640,root,root) %{_sysconfdir}/mime.types
57f21172 515%attr(640,root,root) %{_sysconfdir}/koi-utf
516%attr(640,root,root) %{_sysconfdir}/koi-win
517%attr(640,root,root) %{_sysconfdir}/win-utf
fb1687bb 518%attr(750,root,root) %dir /var/log/archive/%{name}
f1fc9780 519%attr(750,%{name},logs) /var/log/%{name}
475fecd1 520%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
cd728db7 521%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
28a25161 522
b0fa7cc6 523%files standard
524%defattr(644,root,root,755)
de0bfb9b 525%attr(755,root,root) %{_sbindir}/%{name}-standard
1846cd14 526%attr(770,root,%{name}) /var/cache/%{name}-standard
0da077af 527%attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
4ddbebd7 528%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
b0fa7cc6 529
85600569 530%if %{with mail}
531%files mail
532%defattr(644,root,root,755)
4e61eac8 533%attr(755,root,root) %{_sbindir}/%{name}-mail
1846cd14 534%attr(770,root,%{name}) /var/cache/%{name}-mail
0da077af 535%attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
4ddbebd7 536%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
85600569 537%endif
538
539%if %{with light}
540%files light
541%defattr(644,root,root,755)
4e61eac8 542%attr(755,root,root) %{_sbindir}/%{name}-light
1846cd14 543%attr(770,root,%{name}) /var/cache/%{name}-light
0da077af 544%attr(754,root,root) /etc/rc.d/init.d/%{name}-light
4ddbebd7 545%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
85600569 546%endif
547
548%if %{with perl}
549%files perl
550%defattr(644,root,root,755)
4e61eac8 551%attr(755,root,root) %{_sbindir}/%{name}-perl
0da077af 552%attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
f7b57295 553%attr(770,root,%{name}) /var/cache/%{name}-perl
1846cd14 554%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
85600569 555%dir %{perl_vendorarch}/auto/%{name}
556%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
98376457
JB
557%{perl_vendorarch}/auto/%{name}/%{name}.bs
558%{perl_vendorarch}/%{name}.pm
dd7459ac 559%endif
560
561%files -n monit-rc-nginx
562%defattr(644,root,root,755)
563%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
564%if %{with perl}
1846cd14 565%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
85600569 566%endif
dd7459ac 567%if %{with light}
568%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
569%endif
570%if %{with mail}
571%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
572%endif
This page took 0.601787 seconds and 4 git commands to generate.