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