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