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