]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
example on how to disable old ssl proto and leave tls only
[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
9de8ce95 24%bcond_without auth_request # auth_request module
fb649fe5 25
3dfa1ca2 26%define rtmp_version 1.1.3
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
20834250 33Version: 1.6.2
87404bf2 34Release: 1
51ef519b 35License: BSD-like
cbf76340 36Group: Networking/Daemons/HTTP
06e274b9 37Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
20834250 38# Source0-md5: d1b55031ae6e4bce37f8776b94d8b930
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
3dfa1ca2 62# Source101-md5: 66ee2b74799e03a25a9e3aaadd874436
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} \
9de8ce95 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.bs contrib/nginx.bs
340mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
341mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
056acc18 342%endif
343
344%if %{with mail}
056acc18 345./configure \
346 --prefix=%{_prefix} \
4e61eac8 347 --sbin-path=%{_sbindir}/%{name}-mail \
348 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
349 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
350 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
351 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
352 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
056acc18 353 --user=nginx \
354 --group=nginx \
355 --with-imap \
356 --with-mail \
357 --with-mail_ssl_module \
d6fc4b09 358 --without-http \
129a70a2 359 %{?with_ipv6:--with-ipv6} \
056acc18 360 %{?with_poll:--with-poll_module} \
056acc18 361 %{?with_rtsig:--with-rtsig_module} \
362 %{?with_select:--with-select_module} \
4e61eac8 363 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
364 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
365 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
056acc18 366 --with-cc="%{__cc}" \
367 --with-cc-opt="%{rpmcflags}" \
368 --with-ld-opt="%{rpmldflags}" \
369 %{?debug:--with-debug}
370%{__make}
4e61eac8 371mv -f objs/nginx contrib/nginx-mail
056acc18 372%endif
373
374%if %{with light}
056acc18 375./configure \
376 --prefix=%{_prefix} \
4e61eac8 377 --sbin-path=%{_sbindir}/%{name}-light \
378 --conf-path=%{_sysconfdir}/%{name}-light.conf \
379 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
380 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
381 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
382 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
056acc18 383 --user=nginx \
384 --group=nginx \
129a70a2 385 %{?with_ipv6:--with-ipv6} \
056acc18 386 %{?with_poll:--with-poll_module} \
387 %{?with_realip:--with-http_realip_module} \
388 %{?with_rtsig:--with-rtsig_module} \
389 %{?with_select:--with-select_module} \
390 %{?with_status:--with-http_stub_status_module} \
391 %{?with_ssl:--with-http_ssl_module} \
fb649fe5 392 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
9de8ce95 393 %{?with_auth_request:--with-http_auth_request_module} \
056acc18 394 --without-http_browser_module \
1a62642d 395 --without-mail_pop3_module \
396 --without-mail_imap_module \
397 --without-mail_smtp_module \
ca3f3f03 398 --with-http_secure_link_module \
4e61eac8 399 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
400 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
401 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
056acc18 402 --with-cc="%{__cc}" \
403 --with-cc-opt="%{rpmcflags}" \
404 --with-ld-opt="%{rpmldflags}" \
405 %{?debug:--with-debug}
406%{__make}
4e61eac8 407mv -f objs/nginx contrib/nginx-light
056acc18 408%endif
409
f9e65082
ER
410./configure \
411 --prefix=%{_prefix} \
226bcc40 412 --sbin-path=%{_sbindir}/%{name}-standard \
f1686a52 413 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
226bcc40 414 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
415 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
416 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
417 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
dfef7372
ER
418 --user=nginx \
419 --group=nginx \
d0c0492d 420 %{?with_addition:--with-http_addition_module} \
421 %{?with_dav:--with-http_dav_module} \
422 %{?with_flv:--with-http_flv_module} \
129a70a2 423 %{?with_ipv6:--with-ipv6} \
d6fc4b09 424 %{?with_sub:--with-http_sub_module} \
d0c0492d 425 %{?with_poll:--with-poll_module} \
426 %{?with_realip:--with-http_realip_module} \
362f5ab2 427 %{?with_rtsig:--with-rtsig_module} \
428 %{?with_select:--with-select_module} \
d0c0492d 429 %{?with_status:--with-http_stub_status_module} \
362f5ab2 430 %{?with_ssl:--with-http_ssl_module} \
ee4f2132 431 %{!?with_http_browser:--without-http_browser_module} \
fb649fe5 432 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
9de8ce95 433 %{?with_auth_request:--with-http_auth_request_module} \
ca3f3f03 434 --with-http_secure_link_module \
226bcc40 435 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
436 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
437 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
f9e65082
ER
438 --with-cc="%{__cc}" \
439 --with-cc-opt="%{rpmcflags}" \
440 --with-ld-opt="%{rpmldflags}" \
441 %{?debug:--with-debug}
f9e65082
ER
442%{__make}
443
056acc18 444
f9e65082
ER
445%install
446rm -rf $RPM_BUILD_ROOT
362f5ab2 447install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
448 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
4e61eac8 449 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
226bcc40 450 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
451 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
36b3be34 452 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
d323480a 453 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
599f35f0 454 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
f9e65082 455
7d80c773 456install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
0bc43776
JK
457install conf/scgi_params $RPM_BUILD_ROOT%{_sysconfdir}/scgi.params
458install conf/uwsgi_params $RPM_BUILD_ROOT%{_sysconfdir}/uwsgi.params
57f21172 459install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
460install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
461install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
cd728db7 462install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
463install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
226bcc40 464install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
465install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
466install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
467install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
0da077af 468install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
469install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
470install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
d323480a 471install %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
de0bfb9b 472install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
599f35f0 473ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
85600569 474
475%if %{with light}
226bcc40 476install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
477install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
0da077af 478install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
d323480a 479install %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
4e61eac8 480install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
85600569 481%endif
482
483%if %{with mail}
0da077af 484install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
485install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
486install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
d323480a 487install %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
4e61eac8 488install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
85600569 489%endif
490
491%if %{with perl}
492install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
0da077af 493install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
494install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
495install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
d323480a 496install %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
d6fc4b09 497install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
498install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
499install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
4e61eac8 500install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
85600569 501%endif
f9e65082
ER
502
503rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
504rm -rf $RPM_BUILD_ROOT%{_prefix}/html
505
506%clean
507rm -rf $RPM_BUILD_ROOT
508
1a973791 509%pre common
a37373c3 510%groupadd -r -g 213 %{name}
362f5ab2 511%groupadd -g 51 http
a37373c3 512%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 513%addusertogroup %{name} http
f1fc9780 514
738166d2 515%post standard
516for a in access.log error.log; do
517 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
98376457 518 umask 022
738166d2 519 touch /var/log/%{name}/nginx-standard_$a
1cf92547 520 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
738166d2 521 chmod 644 /var/log/%{name}/nginx-standard_$a
522 fi
523done
3d760264 524/sbin/chkconfig --add %{name}-standard
d323480a 525%systemd_post %{name}-standard.service
3d760264 526%service %{name}-standard restart
a20d2702 527echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
599f35f0
JK
528if ! [ -L /etc/systemd/system/nginx.service ] ; then
529 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
530fi
738166d2 531
532%post light
533for a in access.log error.log; do
534 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
98376457 535 umask 022
738166d2 536 touch /var/log/%{name}/nginx-light_$a
537 chown nginx:nginx /var/log/%{name}/nginx-light_$a
538 chmod 644 /var/log/%{name}/nginx-light_$a
539 fi
540done
3d760264 541/sbin/chkconfig --add %{name}-light
d323480a 542%systemd_post %{name}-light.service
3d760264 543%service %{name}-light restart
a20d2702 544echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
738166d2 545
546%post perl
547for a in access.log error.log; do
548 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
98376457 549 umask 022
738166d2 550 touch /var/log/%{name}/nginx-perl_$a
551 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
552 chmod 644 /var/log/%{name}/nginx-perl_$a
553 fi
554done
3d760264 555/sbin/chkconfig --add %{name}-perl
d323480a 556%systemd_post %{name}-perl.service
3d760264 557%service %{name}-perl restart
a20d2702 558echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
738166d2 559
560%post mail
362f5ab2 561for a in access.log error.log; do
738166d2 562 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
98376457 563 umask 022
738166d2 564 touch /var/log/%{name}/nginx-mail_$a
565 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
566 chmod 644 /var/log/%{name}/nginx-mail_$a
362f5ab2 567 fi
568done
3d760264 569/sbin/chkconfig --add %{name}-mail
d323480a 570%systemd_post %{name}-mail.service
3d760264 571%service %{name}-mail restart
a20d2702 572echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
f9e65082 573
b0fa7cc6 574%preun standard
7d80c773 575if [ "$1" = "0" ];then
6eef4074 576 %service %{name}-standard stop
226bcc40 577 /sbin/chkconfig --del %{name}-standard
f9e65082 578fi
d323480a 579%systemd_preun %{name}-standard.service
f9e65082 580
0663f9da 581%preun light
582if [ "$1" = "0" ]; then
6eef4074 583 %service %{name}-light stop
226bcc40 584 /sbin/chkconfig --del %{name}-light
0663f9da 585fi
d323480a 586%systemd_preun %{name}-light.service
0663f9da 587
588%preun perl
589if [ "$1" = "0" ]; then
6eef4074 590 %service %{name}-perl stop
226bcc40 591 /sbin/chkconfig --del %{name}-perl
0663f9da 592fi
d323480a 593%systemd_preun %{name}-perl.service
0663f9da 594
595%preun mail
596if [ "$1" = "0" ]; then
6eef4074 597 %service %{name}-mail stop
226bcc40 598 /sbin/chkconfig --del %{name}-mail
0663f9da 599fi
d323480a 600%systemd_preun %{name}-mail.service
0663f9da 601
1a973791 602%postun common
f1fc9780 603if [ "$1" = "0" ]; then
7d9b86c7
ER
604 %userremove %{name}
605 %groupremove %{name}
f1fc9780 606fi
607
d323480a
JK
608%postun standard
609%systemd_reload
610
611%postun light
612%systemd_reload
613
614%postun perl
615%systemd_reload
616
617%postun mail
618%systemd_reload
619
620%triggerpostun -- %{name}-standard < 1.4.1-4
621%systemd_trigger %{name}-standard.service
622
623%triggerpostun -- %{name}-light < 1.4.1-4
624%systemd_trigger %{name}-light.service
625
626%triggerpostun -- %{name}-perl < 1.4.1-4
627%systemd_trigger %{name}-perl.service
628
629%triggerpostun -- %{name}-mail < 1.4.1-4
630%systemd_trigger %{name}-mail.service
631
1a973791 632%files common
f9e65082 633%defattr(644,root,root,755)
6f8318ed 634%doc CHANGES LICENSE README html/index.html conf/nginx.conf
f9e65082 635%doc %lang(ru) CHANGES.ru
f1fc9780 636%dir %attr(754,root,root) %{_sysconfdir}
164ab75d 637%dir %{_nginxdir}
638%dir %{_nginxdir}/cgi-bin
639%dir %{_nginxdir}/html
640%dir %{_nginxdir}/errors
28a25161 641%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
98376457 642# XXX: duplicates, don't use such glob here
57f21172 643#%attr(640,root,root) %{_sysconfdir}/*[_-]*
98376457 644%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
394dc7b0 645%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
0bc43776
JK
646%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi.params
647%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi.params
f1fc9780 648%attr(640,root,root) %{_sysconfdir}/mime.types
57f21172 649%attr(640,root,root) %{_sysconfdir}/koi-utf
650%attr(640,root,root) %{_sysconfdir}/koi-win
651%attr(640,root,root) %{_sysconfdir}/win-utf
36b3be34
JK
652%dir %{_sysconfdir}/webapps.d
653%dir %{_sysconfdir}/vhosts.d
debe6eba
JR
654%attr(750,nginx,logs) %dir /var/log/archive/%{name}
655%attr(750,nginx,logs) /var/log/%{name}
475fecd1 656%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
cd728db7 657%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
599f35f0 658%ghost /etc/systemd/system/nginx.service
28a25161 659
b0fa7cc6 660%files standard
661%defattr(644,root,root,755)
de0bfb9b 662%attr(755,root,root) %{_sbindir}/%{name}-standard
1846cd14 663%attr(770,root,%{name}) /var/cache/%{name}-standard
0da077af 664%attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
4ddbebd7 665%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
d323480a 666%{systemdunitdir}/%{name}-standard.service
b0fa7cc6 667
85600569 668%if %{with mail}
669%files mail
670%defattr(644,root,root,755)
4e61eac8 671%attr(755,root,root) %{_sbindir}/%{name}-mail
1846cd14 672%attr(770,root,%{name}) /var/cache/%{name}-mail
0da077af 673%attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
4ddbebd7 674%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
d323480a 675%{systemdunitdir}/%{name}-mail.service
85600569 676%endif
677
678%if %{with light}
679%files light
680%defattr(644,root,root,755)
4e61eac8 681%attr(755,root,root) %{_sbindir}/%{name}-light
1846cd14 682%attr(770,root,%{name}) /var/cache/%{name}-light
0da077af 683%attr(754,root,root) /etc/rc.d/init.d/%{name}-light
4ddbebd7 684%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
d323480a 685%{systemdunitdir}/%{name}-light.service
85600569 686%endif
687
688%if %{with perl}
689%files perl
690%defattr(644,root,root,755)
4e61eac8 691%attr(755,root,root) %{_sbindir}/%{name}-perl
0da077af 692%attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
f7b57295 693%attr(770,root,%{name}) /var/cache/%{name}-perl
1846cd14 694%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
85600569 695%dir %{perl_vendorarch}/auto/%{name}
696%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
98376457
JB
697%{perl_vendorarch}/auto/%{name}/%{name}.bs
698%{perl_vendorarch}/%{name}.pm
d323480a 699%{systemdunitdir}/%{name}-perl.service
dd7459ac 700%endif
701
702%files -n monit-rc-nginx
703%defattr(644,root,root,755)
704%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
705%if %{with perl}
1846cd14 706%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
85600569 707%endif
dd7459ac 708%if %{with light}
709%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
710%endif
711%if %{with mail}
712%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
713%endif
This page took 0.235308 seconds and 4 git commands to generate.