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