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