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