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