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