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