]> git.pld-linux.org Git - packages/nginx.git/blame - nginx.spec
update paths in 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 6%bcond_with light # don't build light version
008e09c3 7%bcond_without 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
7f97359c 51Source6: %{name}.monitrc
2cb3d9b2 52Source7: %{name}.init
5d9f0850 53Source14: %{name}.conf
7d80c773 54Source17: %{name}-mime.types.sh
8d0ed4b0 55Source18: %{name}.service
ba5570e8 56Source22: http://www.modsecurity.org/tarball/%{modsecurity_version}/modsecurity-%{modsecurity_version}.tar.gz
aa6a1e55 57# Source22-md5: 0fa92b852abc857a20b9e24f83f814cf
5d0d957d
ER
58Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
59# Source101-md5: 8006de2560db3e55bb15d110220076ac
5ca9795d 60Patch0: %{name}-no-Werror.patch
7ce2935c 61Patch1: %{name}-modsecurity-xheaders.patch
51ef519b 62URL: http://nginx.net/
ba5570e8 63%{?with_modsecurity:BuildRequires: lua-devel}
dfef7372 64BuildRequires: mailcap
27ce902f 65%{?with_ssl:BuildRequires: openssl-devel >= %{ssl_version}}
f1fc9780 66BuildRequires: pcre-devel
1c438d78 67%{?with_perl:BuildRequires: perl-CGI}
d0c0492d 68%{?with_perl:BuildRequires: perl-devel}
dd2388c2 69%{?with_perl:BuildRequires: python}
1c438d78 70%{?with_perl:BuildRequires: rpm-perlprov}
d323480a 71BuildRequires: rpmbuild(macros) >= 1.644
f9e65082
ER
72BuildRequires: zlib-devel
73BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74
362f5ab2 75%define _sysconfdir /etc/%{name}
76%define _nginxdir /home/services/%{name}
f9e65082
ER
77
78%description
57f21172 79nginx ("engine x") is a high-performance HTTP server and reverse
80proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
894ff1f7
ER
81Sysoev for Rambler.ru, Russia's second-most visited website, where it
82has been running in production for over two and a half years. Igor has
83released the source code under a BSD-like license. Although still in
57f21172 84beta, nginx is known for its stability, rich feature set, simple
894ff1f7 85configuration, and low resource consumption.
8e1389c7 86
390f5b88 87%description -l pl.UTF-8
57f21172 88nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
5ca9795d
ER
89a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
90potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
056acc18 91odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
5ca9795d
ER
92opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
93fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
1dc54c84 94prostej konfiguracji oraz małej "zasobożerności".
2ee780b1 95
1a973791
JK
96%package common
97Summary: nginx - common files
98Summary(pl.UTF-8): nginx - pliki wspólne
99Group: Networking/Daemons/HTTP
100Requires(postun): /usr/sbin/groupdel
101Requires(postun): /usr/sbin/userdel
102Requires(pre): /bin/id
103Requires(pre): /usr/bin/getgid
104Requires(pre): /usr/sbin/groupadd
105Requires(pre): /usr/sbin/useradd
1a973791
JK
106Requires: rc-scripts >= 0.2.0
107Requires: systemd-units >= 38
1f74ff7c 108Suggests: vim-syntax-nginx
1a973791
JK
109Provides: group(http)
110Provides: group(nginx)
111Provides: user(nginx)
9b47506f
AM
112Provides: webserver(access)
113Provides: webserver(alias)
81d5057a
JK
114Provides: webserver(auth)
115Provides: webserver(expires)
116Provides: webserver(headers)
1e42c256 117Provides: webserver(indexfile)
81d5057a
JK
118Provides: webserver(log)
119Provides: webserver(mime)
120Provides: webserver(reqtimeout)
121Provides: webserver(rewrite)
122Provides: webserver(setenv)
5ca9795d 123Obsoletes: nginx < 1.4.1-4.1
1a973791 124Conflicts: logrotate < 3.8.0
1a973791
JK
125
126%description common
127Common files for the nginx daemon.
128
129%description common -l pl.UTF-8
57f21172 130Niezbędne pliki dla nginx.
85600569 131
2ee780b1 132%package light
133Summary: High perfomance HTTP and reverse proxy server
7ad53968 134Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
cbf76340 135Group: Networking/Daemons/HTTP
85600569 136Requires(post,preun): /sbin/chkconfig
1a973791
JK
137Requires(post,preun,postun): systemd-units >= 38
138Requires: %{name}-common = %{version}-%{release}
27ce902f 139%{?with_ssl:Requires: openssl >= %{ssl_version}}
119e2f19 140Provides: nginx-daemon
2ee780b1 141Provides: webserver
142
143%description light
1a973791
JK
144nginx ("engine x") is a high-performance HTTP server and reverse
145proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
146Sysoev for Rambler.ru, Russia's second-most visited website, where it
147has been running in production for over two and a half years. Igor has
148released the source code under a BSD-like license. Although still in
149beta, nginx is known for its stability, rich feature set, simple
150configuration, and low resource consumption.
151
57f21172 152The smallest, but also the fastest nginx edition. No additional
7ad53968 153modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
2ee780b1 154
155%description light -l pl.UTF-8
1a973791 156nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
5ca9795d
ER
157a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
158potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
1a973791 159odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
5ca9795d
ER
160opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
161fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
1a973791
JK
162prostej konfiguracji oraz małej "zasobożerności".
163
57f21172 164Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
1cf92547 165FLV oraz IMAP, POP3, SMTP proxy.
2ee780b1 166
167%package perl
168Summary: High perfomance HTTP and reverse proxy server
7ad53968 169Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
cbf76340 170Group: Networking/Daemons/HTTP
85600569 171Requires(post,preun): /sbin/chkconfig
1a973791
JK
172Requires(post,preun,postun): systemd-units >= 38
173Requires: %{name}-common = %{version}-%{release}
27ce902f 174%{?with_ssl:Requires: openssl >= %{ssl_version}}
1cf92547 175Provides: nginx-daemon
2ee780b1 176Provides: webserver
177
178%description perl
1a973791
JK
179nginx ("engine x") is a high-performance HTTP server and reverse
180proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
181Sysoev for Rambler.ru, Russia's second-most visited website, where it
182has been running in production for over two and a half years. Igor has
183released the source code under a BSD-like license. Although still in
184beta, nginx is known for its stability, rich feature set, simple
185configuration, and low resource consumption.
186
57f21172 187nginx with Perl support. Mail modules not included.
2ee780b1 188
189%description perl -l pl.UTF-8
1a973791 190nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
5ca9795d
ER
191a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
192potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
1a973791 193odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
5ca9795d
ER
194opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
195fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
1a973791
JK
196prostej konfiguracji oraz małej "zasobożerności".
197
57f21172 198nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
2ee780b1 199
200%package mail
57f21172 201Summary: High perfomance IMAP, POP3, SMTP proxy server
202Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
cbf76340 203Group: Networking/Daemons/HTTP
85600569 204Requires(post,preun): /sbin/chkconfig
1a973791
JK
205Requires(post,preun,postun): systemd-units >= 38
206Requires: %{name}-common = %{version}-%{release}
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}
27ce902f 238%{?with_ssl:Requires: openssl >= %{ssl_version}}
1a973791 239Provides: nginx
1cf92547 240Provides: nginx-daemon
577e51d2 241Provides: webserver
d6fc4b09 242Conflicts: logrotate < 3.7-4
28a25161 243
b0fa7cc6 244%description standard
1a973791
JK
245nginx ("engine x") is a high-performance HTTP server and reverse
246proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
247Sysoev for Rambler.ru, Russia's second-most visited website, where it
248has been running in production for over two and a half years. Igor has
249released the source code under a BSD-like license. Although still in
250beta, nginx is known for its stability, rich feature set, simple
251configuration, and low resource consumption.
252
57f21172 253This is standard nginx version, without Perl support and IMAP, POP3,
5ca9795d 254SMTP proxy.
fccff804 255
b0fa7cc6 256%description standard -l pl.UTF-8
1a973791 257nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
5ca9795d
ER
258a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
259potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
1a973791 260odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
5ca9795d
ER
261opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
262fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
263prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x")
264jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3
265proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu
266Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji
267i działa od ponad dwóch i pół roku. Igor opublikował źródła na
268licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął
269dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej
270"zasobożerności".
1a973791 271
57f21172 272To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
1dc54c84 273IMAP, POP3, SMTP.
85600569 274
dd7459ac 275%package -n monit-rc-nginx
57f21172 276Summary: nginx support for monit
277Summary(pl.UTF-8): Wsparcie nginx dla monit
60b8f836 278Group: Applications/System
279URL: http://nginx.eu/
1a973791 280Requires: %{name}-common = %{version}-%{release}
1cf92547 281Requires: monit
dd7459ac 282
283%description -n monit-rc-nginx
57f21172 284monitrc file for monitoring nginx webserver.
dd7459ac 285
286%description -n monit-rc-nginx -l pl.UTF-8
57f21172 287Plik monitrc do monitorowania serwera WWW nginx.
dd7459ac 288
f9e65082 289%prep
ba5570e8 290%setup -q %{?with_rtmp:-a101} %{?with_modsecurity:-a22}
717159c4 291%patch0 -p0
7ce2935c 292%{?with_modsecurity:%patch1 -p0}
f9e65082 293
fb649fe5
ER
294%if %{with rtmp}
295mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
296%endif
297
a8eaad11 298# build mime.types.conf
7d80c773 299#sh %{SOURCE17} /etc/mime.types
a8eaad11 300
f9e65082
ER
301%build
302# NB: not autoconf generated configure
056acc18 303cp -f configure auto/
5d0d957d 304
2fb62cf2
ER
305install -d bin
306
021e3ce8 307# build with default options
2fb62cf2 308build() {
78ac4e4e 309 local type=$1; shift
056acc18 310./configure \
311 --prefix=%{_prefix} \
483adace 312 --modules-path=%{_libdir}/%{name}/modules \
efc6207e
ER
313 --sbin-path=%{_sbindir}/%{name} \
314 --conf-path=%{_sysconfdir}/%{name}.conf \
315 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
316 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
317 --pid-path=%{_localstatedir}/run/%{name}.pid \
318 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
319 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
320 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
321 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
2fb62cf2
ER
322 --user=nginx \
323 --group=nginx \
021e3ce8
ER
324 %{?with_ipv6:--with-ipv6} \
325 %{?with_select:--with-select_module} \
326 %{?with_poll:--with-poll_module} \
327 %{?with_rtsig:--with-rtsig_module} \
008e09c3 328%if %{with perl}
483adace 329 --with-http_perl_module=dynamic \
008e09c3
ER
330%endif
331%if %{with mail}
332 --with-mail=dynamic \
333 --with-mail_ssl_module \
334%endif
2fb62cf2
ER
335 --with-cc="%{__cc}" \
336 --with-cc-opt="%{rpmcflags}" \
337 --with-ld-opt="%{rpmldflags}" \
0aa7dc69 338 %{?with_debug:--with-debug} \
2fb62cf2
ER
339 "$@"
340%{__make}
341}
342
ba5570e8
AO
343%if %{with modsecurity}
344cd modsecurity-%{modsecurity_version}
345./autogen.sh
346%configure \
347 --enable-standalone-module \
348 --disable-mlogc \
349 --enable-alp2 \
350 --with-lua=/usr
351%{__make}
352cd ..
353%endif
354
483adace 355%if %{with perl} && 0
78ac4e4e 356build perl \
056acc18 357 --with-http_perl_module \
358 %{?with_addition:--with-http_addition_module} \
359 %{?with_dav:--with-http_dav_module} \
360 %{?with_flv:--with-http_flv_module} \
d6fc4b09 361 %{?with_sub:--with-http_sub_module} \
056acc18 362 %{?with_realip:--with-http_realip_module} \
056acc18 363 %{?with_status:--with-http_stub_status_module} \
364 %{?with_ssl:--with-http_ssl_module} \
365 %{!?with_http_browser:--without-http_browser_module} \
fb649fe5 366 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
e9a11359 367 %{?with_auth_request:--with-http_auth_request_module} \
8cf64677 368 %{?with_threads:--with-threads} \
6f05a009 369 %{?with_http2:--with-http_v2_module} \
ca3f3f03 370 --with-http_secure_link_module \
2fb62cf2
ER
371 %{nil}
372
373mv -f objs/nginx bin/nginx-perl
374mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so
375mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm
056acc18 376%endif
377
008e09c3 378%if %{with mail} && 0
78ac4e4e 379build mail \
f2d29d05 380 --without-http \
056acc18 381 --with-imap \
382 --with-mail \
383 --with-mail_ssl_module \
2fb62cf2
ER
384 %{nil}
385
386mv -f objs/nginx bin/nginx-mail
056acc18 387%endif
388
389%if %{with light}
78ac4e4e 390build light \
056acc18 391 %{?with_realip:--with-http_realip_module} \
056acc18 392 %{?with_status:--with-http_stub_status_module} \
393 %{?with_ssl:--with-http_ssl_module} \
fb649fe5 394 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
e9a11359 395 %{?with_auth_request:--with-http_auth_request_module} \
8cf64677 396 %{?with_threads:--with-threads} \
6f05a009 397 %{?with_http2:--with-http_v2_module} \
ba5570e8 398 %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
056acc18 399 --without-http_browser_module \
ca3f3f03 400 --with-http_secure_link_module \
2fb62cf2
ER
401 %{nil}
402
403mv -f objs/nginx bin/nginx-light
056acc18 404%endif
405
78ac4e4e 406build standard \
d0c0492d 407 %{?with_addition:--with-http_addition_module} \
408 %{?with_dav:--with-http_dav_module} \
409 %{?with_flv:--with-http_flv_module} \
d6fc4b09 410 %{?with_sub:--with-http_sub_module} \
d0c0492d 411 %{?with_realip:--with-http_realip_module} \
d0c0492d 412 %{?with_status:--with-http_stub_status_module} \
362f5ab2 413 %{?with_ssl:--with-http_ssl_module} \
ee4f2132 414 %{!?with_http_browser:--without-http_browser_module} \
fb649fe5 415 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
e9a11359 416 %{?with_auth_request:--with-http_auth_request_module} \
8cf64677 417 %{?with_threads:--with-threads} \
619c1aee 418 %{?with_http2:--with-http_v2_module} \
ba5570e8 419 %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
ca3f3f03 420 --with-http_secure_link_module \
2fb62cf2 421 %{nil}
f9e65082
ER
422
423%install
424rm -rf $RPM_BUILD_ROOT
362f5ab2 425install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
426 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
4e61eac8 427 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
c63e9e18
ER
428 $RPM_BUILD_ROOT%{_localstatedir}/cache/%{name} \
429 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/%{name} \
36b3be34 430 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
d323480a 431 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
599f35f0 432 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
f9e65082 433
483adace
ER
434%{__make} install \
435 INSTALLDIRS=vendor \
436 DESTDIR=$RPM_BUILD_ROOT
437
438%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/*.default
439
7f97359c
ER
440cp -p %{_sourcedir}/%{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
441cp -p %{_sourcedir}/%{name}.service $RPM_BUILD_ROOT%{systemdunitdir}
442cp -p %{_sourcedir}/%{name}.monitrc $RPM_BUILD_ROOT/etc/monit
c63e9e18
ER
443install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
444
483adace
ER
445cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
446cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
3c75ce8a 447cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
483adace
ER
448rm -r $RPM_BUILD_ROOT%{_prefix}/html
449cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
450cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
5ca9795d 451cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
85600569 452
453%if %{with perl}
483adace
ER
454%{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
455%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/nginx/.packlist
483adace
ER
456%endif
457
32c47bd6
ER
458# only touch these for ghost packaging
459touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params
460
f9e65082
ER
461%clean
462rm -rf $RPM_BUILD_ROOT
463
c63e9e18 464%pre
a37373c3 465%groupadd -r -g 213 %{name}
362f5ab2 466%groupadd -g 51 http
a37373c3 467%useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
362f5ab2 468%addusertogroup %{name} http
f1fc9780 469
c63e9e18 470%post
738166d2 471for a in access.log error.log; do
c63e9e18 472 if [ ! -f /var/log/%{name}/$a ]; then
98376457 473 umask 022
c63e9e18
ER
474 touch /var/log/%{name}/$a
475 chown nginx:nginx /var/log/%{name}/$a
476 chmod 644 /var/log/%{name}/$a
738166d2 477 fi
478done
c63e9e18
ER
479/sbin/chkconfig --add %{name}
480%systemd_post %{name}.service
481%service %{name} force-reload
738166d2 482
c63e9e18 483%preun
7d80c773 484if [ "$1" = "0" ];then
c63e9e18
ER
485 %service %{name} stop
486 /sbin/chkconfig --del %{name}
0663f9da 487fi
c63e9e18 488%systemd_preun %{name}.service
0663f9da 489
c63e9e18 490%postun
f1fc9780 491if [ "$1" = "0" ]; then
7d9b86c7
ER
492 %userremove %{name}
493 %groupremove %{name}
f1fc9780 494fi
d323480a
JK
495%systemd_reload
496
497%triggerpostun -- %{name}-standard < 1.4.1-4
498%systemd_trigger %{name}-standard.service
499
500%triggerpostun -- %{name}-light < 1.4.1-4
501%systemd_trigger %{name}-light.service
502
503%triggerpostun -- %{name}-perl < 1.4.1-4
504%systemd_trigger %{name}-perl.service
505
506%triggerpostun -- %{name}-mail < 1.4.1-4
507%systemd_trigger %{name}-mail.service
508
32c47bd6
ER
509%triggerpostun common -- %{name}-common < 1.8.0-2
510# skip *this* trigger on downgrade
511[ $1 -le 1 ] && exit 0
512ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params
513ln -sf scgi_params %{_sysconfdir}/scgi.params
514ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params
515exit 0
516
c63e9e18 517%files
f9e65082 518%defattr(644,root,root,755)
6f8318ed 519%doc CHANGES LICENSE README html/index.html conf/nginx.conf
f9e65082 520%doc %lang(ru) CHANGES.ru
37ddc577 521%dir %attr(750,root,nginx) %{_sysconfdir}
164ab75d 522%dir %{_nginxdir}
523%dir %{_nginxdir}/cgi-bin
524%dir %{_nginxdir}/html
525%dir %{_nginxdir}/errors
28a25161 526%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
98376457 527%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
32c47bd6
ER
528%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params
529%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params
530%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params
531%ghost %{_sysconfdir}/fastcgi.params
532%ghost %{_sysconfdir}/scgi.params
533%ghost %{_sysconfdir}/uwsgi.params
f1fc9780 534%attr(640,root,root) %{_sysconfdir}/mime.types
57f21172 535%attr(640,root,root) %{_sysconfdir}/koi-utf
536%attr(640,root,root) %{_sysconfdir}/koi-win
537%attr(640,root,root) %{_sysconfdir}/win-utf
36b3be34
JK
538%dir %{_sysconfdir}/webapps.d
539%dir %{_sysconfdir}/vhosts.d
debe6eba
JR
540%attr(750,nginx,logs) %dir /var/log/archive/%{name}
541%attr(750,nginx,logs) /var/log/%{name}
475fecd1 542%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
cd728db7 543%config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
28a25161 544
b0fa7cc6 545%defattr(644,root,root,755)
483adace 546%attr(755,root,root) %{_sbindir}/%{name}
c63e9e18
ER
547%attr(770,root,%{name}) /var/cache/%{name}
548%attr(754,root,root) /etc/rc.d/init.d/%{name}
549%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
550%{systemdunitdir}/%{name}.service
b0fa7cc6 551
85600569 552%if %{with mail}
553%files mail
554%defattr(644,root,root,755)
008e09c3
ER
555%attr(755,root,root) %{_libdir}/%{name}/modules/ngx_mail_module.so
556%endif
85600569 557
558%if %{with light}
559%files light
560%defattr(644,root,root,755)
85600569 561%endif
562
563%if %{with perl}
564%files perl
565%defattr(644,root,root,755)
008e09c3 566%attr(755,root,root) %{_libdir}/%{name}/modules/ngx_http_perl_module.so
85600569 567%dir %{perl_vendorarch}/auto/%{name}
568%attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
98376457 569%{perl_vendorarch}/%{name}.pm
483adace 570%{_mandir}/man3/nginx.3pm*
483adace 571%endif
dd7459ac 572
573%files -n monit-rc-nginx
574%defattr(644,root,root,755)
c63e9e18 575%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc
This page took 0.181198 seconds and 4 git commands to generate.