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