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