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