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