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