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