]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
- rebuild with perl 5.18.0
[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
297cf41d 26Version: 1.4.1
f92d6feb 27Release: 2
51ef519b 28License: BSD-like
cbf76340 29Group: Networking/Daemons/HTTP
06e274b9 30Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
297cf41d 31# Source0-md5: fea7dfab995545ce27fe4c49dc21a972
06e274b9 32Source1: http://nginx.net/favicon.ico
226bcc40 33# Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
06e274b9 34Source2: proxy.conf
226bcc40 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
572b4761 50Patch0: nginx-no-Werror.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}
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
774b2694 68#Requires: 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
99c7e901 78Conflicts: logrotate < 3.8.0
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
717159c4 213%patch0 -p0
f9e65082 214
a8eaad11 215# build mime.types.conf
7d80c773 216#sh %{SOURCE17} /etc/mime.types
a8eaad11 217
f9e65082
ER
218%build
219# NB: not autoconf generated configure
056acc18 220cp -f configure auto/
221#
222%if %{with perl}
223./configure \
224 --prefix=%{_prefix} \
4e61eac8 225 --sbin-path=%{_sbindir}/%{name}-perl \
226 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
227 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
228 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
229 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
230 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
056acc18 231 --user=nginx \
232 --group=nginx \
233 --with-http_perl_module \
2ee780b1 234 --without-mail_pop3_module \
235 --without-mail_imap_module \
236 --without-mail_smtp_module \
056acc18 237 %{?with_addition:--with-http_addition_module} \
238 %{?with_dav:--with-http_dav_module} \
239 %{?with_flv:--with-http_flv_module} \
3d4bad81 240 %{?with_ipv6:--with-ipv6} \
d6fc4b09 241 %{?with_sub:--with-http_sub_module} \
056acc18 242 %{?with_poll:--with-poll_module} \
243 %{?with_realip:--with-http_realip_module} \
244 %{?with_rtsig:--with-rtsig_module} \
245 %{?with_select:--with-select_module} \
246 %{?with_status:--with-http_stub_status_module} \
247 %{?with_ssl:--with-http_ssl_module} \
248 %{!?with_http_browser:--without-http_browser_module} \
4e61eac8 249 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
250 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
251 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
056acc18 252 --with-cc="%{__cc}" \
253 --with-cc-opt="%{rpmcflags}" \
254 --with-ld-opt="%{rpmldflags}"
255%{__make}
4e61eac8 256mv -f objs/nginx contrib/nginx-perl
d6fc4b09 257mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs
258mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
259mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
056acc18 260%endif
261
262%if %{with mail}
056acc18 263./configure \
264 --prefix=%{_prefix} \
4e61eac8 265 --sbin-path=%{_sbindir}/%{name}-mail \
266 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
267 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
268 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
269 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
270 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
056acc18 271 --user=nginx \
272 --group=nginx \
273 --with-imap \
274 --with-mail \
275 --with-mail_ssl_module \
d6fc4b09 276 --without-http \
129a70a2 277 %{?with_ipv6:--with-ipv6} \
056acc18 278 %{?with_poll:--with-poll_module} \
056acc18 279 %{?with_rtsig:--with-rtsig_module} \
280 %{?with_select:--with-select_module} \
4e61eac8 281 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
282 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
283 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
056acc18 284 --with-cc="%{__cc}" \
285 --with-cc-opt="%{rpmcflags}" \
286 --with-ld-opt="%{rpmldflags}" \
287 %{?debug:--with-debug}
288%{__make}
4e61eac8 289mv -f objs/nginx contrib/nginx-mail
056acc18 290%endif
291
292%if %{with light}
056acc18 293./configure \
294 --prefix=%{_prefix} \
4e61eac8 295 --sbin-path=%{_sbindir}/%{name}-light \
296 --conf-path=%{_sysconfdir}/%{name}-light.conf \
297 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
298 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
299 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
300 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
056acc18 301 --user=nginx \
302 --group=nginx \
129a70a2 303 %{?with_ipv6:--with-ipv6} \
056acc18 304 %{?with_poll:--with-poll_module} \
305 %{?with_realip:--with-http_realip_module} \
306 %{?with_rtsig:--with-rtsig_module} \
307 %{?with_select:--with-select_module} \
308 %{?with_status:--with-http_stub_status_module} \
309 %{?with_ssl:--with-http_ssl_module} \
310 --without-http_browser_module \
1a62642d 311 --without-mail_pop3_module \
312 --without-mail_imap_module \
313 --without-mail_smtp_module \
4e61eac8 314 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
315 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
316 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
056acc18 317 --with-cc="%{__cc}" \
318 --with-cc-opt="%{rpmcflags}" \
319 --with-ld-opt="%{rpmldflags}" \
320 %{?debug:--with-debug}
321%{__make}
4e61eac8 322mv -f objs/nginx contrib/nginx-light
056acc18 323%endif
324
f9e65082
ER
325./configure \
326 --prefix=%{_prefix} \
226bcc40 327 --sbin-path=%{_sbindir}/%{name}-standard \
f1686a52 328 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
226bcc40 329 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
330 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
331 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
332 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
dfef7372
ER
333 --user=nginx \
334 --group=nginx \
d0c0492d 335 %{?with_addition:--with-http_addition_module} \
336 %{?with_dav:--with-http_dav_module} \
337 %{?with_flv:--with-http_flv_module} \
129a70a2 338 %{?with_ipv6:--with-ipv6} \
d6fc4b09 339 %{?with_sub:--with-http_sub_module} \
d0c0492d 340 %{?with_poll:--with-poll_module} \
341 %{?with_realip:--with-http_realip_module} \
362f5ab2 342 %{?with_rtsig:--with-rtsig_module} \
343 %{?with_select:--with-select_module} \
d0c0492d 344 %{?with_status:--with-http_stub_status_module} \
362f5ab2 345 %{?with_ssl:--with-http_ssl_module} \
ee4f2132 346 %{!?with_http_browser:--without-http_browser_module} \
226bcc40 347 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
348 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
349 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
f9e65082
ER
350 --with-cc="%{__cc}" \
351 --with-cc-opt="%{rpmcflags}" \
352 --with-ld-opt="%{rpmldflags}" \
353 %{?debug:--with-debug}
f9e65082
ER
354%{__make}
355
056acc18 356
f9e65082
ER
357%install
358rm -rf $RPM_BUILD_ROOT
362f5ab2 359install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
360 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
4e61eac8 361 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
226bcc40 362 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
363 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
28a25161 364 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
365 $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
f9e65082 366
7d80c773 367install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
57f21172 368install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
369install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
370install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
cd728db7 371install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
372install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
226bcc40 373install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
374install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
375install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
376install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
0da077af 377install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
378install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
379install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
de0bfb9b 380install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
85600569 381
382%if %{with light}
226bcc40 383install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
384install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
0da077af 385install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
4e61eac8 386install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
85600569 387%endif
388
389%if %{with mail}
0da077af 390install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
391install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
392install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
4e61eac8 393install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
85600569 394%endif
395
396%if %{with perl}
397install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
0da077af 398install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
399install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
400install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
d6fc4b09 401install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
402install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
403install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
4e61eac8 404install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
85600569 405%endif
f9e65082
ER
406
407rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
408rm -rf $RPM_BUILD_ROOT%{_prefix}/html
409
410%clean
411rm -rf $RPM_BUILD_ROOT
412
b0fa7cc6 413%pre
a37373c3 414%groupadd -r -g 213 %{name}
362f5ab2 415%groupadd -g 51 http
a37373c3 416%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 417%addusertogroup %{name} http
f1fc9780 418
738166d2 419%post standard
420for a in access.log error.log; do
421 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
98376457 422 umask 022
738166d2 423 touch /var/log/%{name}/nginx-standard_$a
1cf92547 424 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
738166d2 425 chmod 644 /var/log/%{name}/nginx-standard_$a
426 fi
427done
3d760264
ER
428/sbin/chkconfig --add %{name}-standard
429%service %{name}-standard restart
430echo 'NOTE: daemon is now using "/etc/nginx/nginx-standard.conf" as config.'
738166d2 431
432%post light
433for a in access.log error.log; do
434 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
98376457 435 umask 022
738166d2 436 touch /var/log/%{name}/nginx-light_$a
437 chown nginx:nginx /var/log/%{name}/nginx-light_$a
438 chmod 644 /var/log/%{name}/nginx-light_$a
439 fi
440done
3d760264
ER
441/sbin/chkconfig --add %{name}-light
442%service %{name}-light restart
57f21172 443echo 'NOTE: daemon is now using "/etc/nginx/nginx-light.conf" as config'
738166d2 444
445%post perl
446for a in access.log error.log; do
447 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
98376457 448 umask 022
738166d2 449 touch /var/log/%{name}/nginx-perl_$a
450 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
451 chmod 644 /var/log/%{name}/nginx-perl_$a
452 fi
453done
3d760264
ER
454/sbin/chkconfig --add %{name}-perl
455%service %{name}-perl restart
57f21172 456echo 'NOTE: daemon is now using "/etc/nginx/nginx-perl.conf" as config'
738166d2 457
458%post mail
362f5ab2 459for a in access.log error.log; do
738166d2 460 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
98376457 461 umask 022
738166d2 462 touch /var/log/%{name}/nginx-mail_$a
463 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
464 chmod 644 /var/log/%{name}/nginx-mail_$a
362f5ab2 465 fi
466done
3d760264
ER
467/sbin/chkconfig --add %{name}-mail
468%service %{name}-mail restart
57f21172 469echo 'NOTE: daemon is now using "/etc/nginx/nginx-mail.conf" as config'
f9e65082 470
b0fa7cc6 471%preun standard
7d80c773 472if [ "$1" = "0" ];then
6eef4074 473 %service %{name}-standard stop
226bcc40 474 /sbin/chkconfig --del %{name}-standard
f9e65082 475fi
f9e65082 476
0663f9da 477%preun light
478if [ "$1" = "0" ]; then
6eef4074 479 %service %{name}-light stop
226bcc40 480 /sbin/chkconfig --del %{name}-light
0663f9da 481fi
482
483%preun perl
484if [ "$1" = "0" ]; then
6eef4074 485 %service %{name}-perl stop
226bcc40 486 /sbin/chkconfig --del %{name}-perl
0663f9da 487fi
488
489%preun mail
490if [ "$1" = "0" ]; then
6eef4074 491 %service %{name}-mail stop
226bcc40 492 /sbin/chkconfig --del %{name}-mail
0663f9da 493fi
494
b0fa7cc6 495%postun
f1fc9780 496if [ "$1" = "0" ]; then
7d9b86c7
ER
497 %userremove %{name}
498 %groupremove %{name}
f1fc9780 499fi
500
f9e65082
ER
501%files
502%defattr(644,root,root,755)
6f8318ed 503%doc CHANGES LICENSE README html/index.html conf/nginx.conf
f9e65082 504%doc %lang(ru) CHANGES.ru
f1fc9780 505%dir %attr(754,root,root) %{_sysconfdir}
164ab75d 506%dir %{_nginxdir}
507%dir %{_nginxdir}/cgi-bin
508%dir %{_nginxdir}/html
509%dir %{_nginxdir}/errors
28a25161 510%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
98376457 511# XXX: duplicates, don't use such glob here
57f21172 512#%attr(640,root,root) %{_sysconfdir}/*[_-]*
98376457 513%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
394dc7b0 514%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
f1fc9780 515%attr(640,root,root) %{_sysconfdir}/mime.types
57f21172 516%attr(640,root,root) %{_sysconfdir}/koi-utf
517%attr(640,root,root) %{_sysconfdir}/koi-win
518%attr(640,root,root) %{_sysconfdir}/win-utf
debe6eba
JR
519%attr(750,nginx,logs) %dir /var/log/archive/%{name}
520%attr(750,nginx,logs) /var/log/%{name}
475fecd1 521%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
cd728db7 522%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
28a25161 523
b0fa7cc6 524%files standard
525%defattr(644,root,root,755)
de0bfb9b 526%attr(755,root,root) %{_sbindir}/%{name}-standard
1846cd14 527%attr(770,root,%{name}) /var/cache/%{name}-standard
0da077af 528%attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
4ddbebd7 529%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
b0fa7cc6 530
85600569 531%if %{with mail}
532%files mail
533%defattr(644,root,root,755)
4e61eac8 534%attr(755,root,root) %{_sbindir}/%{name}-mail
1846cd14 535%attr(770,root,%{name}) /var/cache/%{name}-mail
0da077af 536%attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
4ddbebd7 537%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
85600569 538%endif
539
540%if %{with light}
541%files light
542%defattr(644,root,root,755)
4e61eac8 543%attr(755,root,root) %{_sbindir}/%{name}-light
1846cd14 544%attr(770,root,%{name}) /var/cache/%{name}-light
0da077af 545%attr(754,root,root) /etc/rc.d/init.d/%{name}-light
4ddbebd7 546%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
85600569 547%endif
548
549%if %{with perl}
550%files perl
551%defattr(644,root,root,755)
4e61eac8 552%attr(755,root,root) %{_sbindir}/%{name}-perl
0da077af 553%attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
f7b57295 554%attr(770,root,%{name}) /var/cache/%{name}-perl
1846cd14 555%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
85600569 556%dir %{perl_vendorarch}/auto/%{name}
557%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
98376457
JB
558%{perl_vendorarch}/auto/%{name}/%{name}.bs
559%{perl_vendorarch}/%{name}.pm
dd7459ac 560%endif
561
562%files -n monit-rc-nginx
563%defattr(644,root,root,755)
564%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
565%if %{with perl}
1846cd14 566%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
85600569 567%endif
dd7459ac 568%if %{with light}
569%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
570%endif
571%if %{with mail}
572%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
573%endif
This page took 0.125801 seconds and 4 git commands to generate.