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