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