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