]>
Commit | Line | Data |
---|---|---|
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 | 34 | Summary: High perfomance HTTP and reverse proxy server |
185313bb | 35 | Summary(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 | 39 | Name: nginx |
69afa2ca | 40 | Version: 1.11.5 |
efc6207e | 41 | Release: 0.1 |
51ef519b | 42 | License: BSD-like |
cbf76340 | 43 | Group: Networking/Daemons/HTTP |
06e274b9 | 44 | Source0: http://nginx.org/download/%{name}-%{version}.tar.gz |
69afa2ca | 45 | # Source0-md5: db43f2b19746f6f47401c3afc3924dc6 |
06e274b9 | 46 | Source1: http://nginx.net/favicon.ico |
87404bf2 | 47 | # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab |
06e274b9 | 48 | Source2: proxy.conf |
226bcc40 | 49 | Source3: %{name}.logrotate |
50 | Source4: %{name}.mime | |
7f97359c | 51 | Source6: %{name}.monitrc |
2cb3d9b2 | 52 | Source7: %{name}.init |
5d9f0850 | 53 | Source14: %{name}.conf |
7d80c773 | 54 | Source17: %{name}-mime.types.sh |
8d0ed4b0 | 55 | Source18: %{name}.service |
ba5570e8 | 56 | Source22: http://www.modsecurity.org/tarball/%{modsecurity_version}/modsecurity-%{modsecurity_version}.tar.gz |
aa6a1e55 | 57 | # Source22-md5: 0fa92b852abc857a20b9e24f83f814cf |
5d0d957d ER |
58 | Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz |
59 | # Source101-md5: 8006de2560db3e55bb15d110220076ac | |
5ca9795d | 60 | Patch0: %{name}-no-Werror.patch |
7ce2935c | 61 | Patch1: %{name}-modsecurity-xheaders.patch |
51ef519b | 62 | URL: http://nginx.net/ |
ba5570e8 | 63 | %{?with_modsecurity:BuildRequires: lua-devel} |
dfef7372 | 64 | BuildRequires: mailcap |
27ce902f | 65 | %{?with_ssl:BuildRequires: openssl-devel >= %{ssl_version}} |
f1fc9780 | 66 | BuildRequires: 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 | 71 | BuildRequires: rpmbuild(macros) >= 1.644 |
f9e65082 ER |
72 | BuildRequires: zlib-devel |
73 | BuildRoot: %{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 | 79 | nginx ("engine x") is a high-performance HTTP server and reverse |
80 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
894ff1f7 ER |
81 | Sysoev for Rambler.ru, Russia's second-most visited website, where it |
82 | has been running in production for over two and a half years. Igor has | |
83 | released the source code under a BSD-like license. Although still in | |
57f21172 | 84 | beta, nginx is known for its stability, rich feature set, simple |
894ff1f7 | 85 | configuration, and low resource consumption. |
8e1389c7 | 86 | |
390f5b88 | 87 | %description -l pl.UTF-8 |
57f21172 | 88 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
89 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
90 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
056acc18 | 91 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
92 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
93 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
1dc54c84 | 94 | prostej konfiguracji oraz małej "zasobożerności". |
2ee780b1 | 95 | |
1a973791 JK |
96 | %package common |
97 | Summary: nginx - common files | |
98 | Summary(pl.UTF-8): nginx - pliki wspólne | |
99 | Group: Networking/Daemons/HTTP | |
100 | Requires(postun): /usr/sbin/groupdel | |
101 | Requires(postun): /usr/sbin/userdel | |
102 | Requires(pre): /bin/id | |
103 | Requires(pre): /usr/bin/getgid | |
104 | Requires(pre): /usr/sbin/groupadd | |
105 | Requires(pre): /usr/sbin/useradd | |
1a973791 JK |
106 | Requires: rc-scripts >= 0.2.0 |
107 | Requires: systemd-units >= 38 | |
1f74ff7c | 108 | Suggests: vim-syntax-nginx |
1a973791 JK |
109 | Provides: group(http) |
110 | Provides: group(nginx) | |
111 | Provides: user(nginx) | |
9b47506f AM |
112 | Provides: webserver(access) |
113 | Provides: webserver(alias) | |
81d5057a JK |
114 | Provides: webserver(auth) |
115 | Provides: webserver(expires) | |
116 | Provides: webserver(headers) | |
1e42c256 | 117 | Provides: webserver(indexfile) |
81d5057a JK |
118 | Provides: webserver(log) |
119 | Provides: webserver(mime) | |
120 | Provides: webserver(reqtimeout) | |
121 | Provides: webserver(rewrite) | |
122 | Provides: webserver(setenv) | |
5ca9795d | 123 | Obsoletes: nginx < 1.4.1-4.1 |
1a973791 | 124 | Conflicts: logrotate < 3.8.0 |
1a973791 JK |
125 | |
126 | %description common | |
127 | Common files for the nginx daemon. | |
128 | ||
129 | %description common -l pl.UTF-8 | |
57f21172 | 130 | Niezbędne pliki dla nginx. |
85600569 | 131 | |
2ee780b1 | 132 | %package light |
133 | Summary: High perfomance HTTP and reverse proxy server | |
7ad53968 | 134 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
cbf76340 | 135 | Group: Networking/Daemons/HTTP |
85600569 | 136 | Requires(post,preun): /sbin/chkconfig |
1a973791 JK |
137 | Requires(post,preun,postun): systemd-units >= 38 |
138 | Requires: %{name}-common = %{version}-%{release} | |
27ce902f | 139 | %{?with_ssl:Requires: openssl >= %{ssl_version}} |
119e2f19 | 140 | Provides: nginx-daemon |
2ee780b1 | 141 | Provides: webserver |
142 | ||
143 | %description light | |
1a973791 JK |
144 | nginx ("engine x") is a high-performance HTTP server and reverse |
145 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
146 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
147 | has been running in production for over two and a half years. Igor has | |
148 | released the source code under a BSD-like license. Although still in | |
149 | beta, nginx is known for its stability, rich feature set, simple | |
150 | configuration, and low resource consumption. | |
151 | ||
57f21172 | 152 | The smallest, but also the fastest nginx edition. No additional |
7ad53968 | 153 | modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy. |
2ee780b1 | 154 | |
155 | %description light -l pl.UTF-8 | |
1a973791 | 156 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
157 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
158 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 159 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
160 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
161 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
1a973791 JK |
162 | prostej konfiguracji oraz małej "zasobożerności". |
163 | ||
57f21172 | 164 | Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV, |
1cf92547 | 165 | FLV oraz IMAP, POP3, SMTP proxy. |
2ee780b1 | 166 | |
167 | %package perl | |
168 | Summary: High perfomance HTTP and reverse proxy server | |
7ad53968 | 169 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
cbf76340 | 170 | Group: Networking/Daemons/HTTP |
85600569 | 171 | Requires(post,preun): /sbin/chkconfig |
1a973791 JK |
172 | Requires(post,preun,postun): systemd-units >= 38 |
173 | Requires: %{name}-common = %{version}-%{release} | |
27ce902f | 174 | %{?with_ssl:Requires: openssl >= %{ssl_version}} |
1cf92547 | 175 | Provides: nginx-daemon |
2ee780b1 | 176 | Provides: webserver |
177 | ||
178 | %description perl | |
1a973791 JK |
179 | nginx ("engine x") is a high-performance HTTP server and reverse |
180 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
181 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
182 | has been running in production for over two and a half years. Igor has | |
183 | released the source code under a BSD-like license. Although still in | |
184 | beta, nginx is known for its stability, rich feature set, simple | |
185 | configuration, and low resource consumption. | |
186 | ||
57f21172 | 187 | nginx with Perl support. Mail modules not included. |
2ee780b1 | 188 | |
189 | %description perl -l pl.UTF-8 | |
1a973791 | 190 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
191 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
192 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 193 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
194 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
195 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
1a973791 JK |
196 | prostej konfiguracji oraz małej "zasobożerności". |
197 | ||
57f21172 | 198 | nginx z obsługą Perla. Bez wsparcia dla modułów poczty. |
2ee780b1 | 199 | |
200 | %package mail | |
57f21172 | 201 | Summary: High perfomance IMAP, POP3, SMTP proxy server |
202 | Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności | |
cbf76340 | 203 | Group: Networking/Daemons/HTTP |
85600569 | 204 | Requires(post,preun): /sbin/chkconfig |
1a973791 JK |
205 | Requires(post,preun,postun): systemd-units >= 38 |
206 | Requires: %{name}-common = %{version}-%{release} | |
1cf92547 | 207 | Provides: nginx-daemon |
2ee780b1 | 208 | |
209 | %description mail | |
1a973791 JK |
210 | nginx ("engine x") is a high-performance HTTP server and reverse |
211 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
212 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
213 | has been running in production for over two and a half years. Igor has | |
214 | released the source code under a BSD-like license. Although still in | |
215 | beta, nginx is known for its stability, rich feature set, simple | |
216 | configuration, and low resource consumption. | |
217 | ||
57f21172 | 218 | nginx with mail support. Only mail modules included. |
2ee780b1 | 219 | |
220 | %description mail -l pl.UTF-8 | |
1a973791 | 221 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
222 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
223 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 224 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
225 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
226 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
1a973791 JK |
227 | prostej konfiguracji oraz małej "zasobożerności". |
228 | ||
57f21172 | 229 | nginx ze wsparciem tylko dla modułów poczty. |
2ee780b1 | 230 | |
b0fa7cc6 | 231 | %package standard |
57f21172 | 232 | Summary: High perfomance HTTP and reverse proxy server |
4ca0234e | 233 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
cbf76340 | 234 | Group: Networking/Daemons/HTTP |
d6fc4b09 | 235 | Requires(post,preun): /sbin/chkconfig |
1a973791 JK |
236 | Requires(post,preun,postun): systemd-units >= 38 |
237 | Requires: %{name}-common = %{version}-%{release} | |
27ce902f | 238 | %{?with_ssl:Requires: openssl >= %{ssl_version}} |
1a973791 | 239 | Provides: nginx |
1cf92547 | 240 | Provides: nginx-daemon |
577e51d2 | 241 | Provides: webserver |
d6fc4b09 | 242 | Conflicts: logrotate < 3.7-4 |
28a25161 | 243 | |
b0fa7cc6 | 244 | %description standard |
1a973791 JK |
245 | nginx ("engine x") is a high-performance HTTP server and reverse |
246 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
247 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
248 | has been running in production for over two and a half years. Igor has | |
249 | released the source code under a BSD-like license. Although still in | |
250 | beta, nginx is known for its stability, rich feature set, simple | |
251 | configuration, and low resource consumption. | |
252 | ||
57f21172 | 253 | This is standard nginx version, without Perl support and IMAP, POP3, |
5ca9795d | 254 | SMTP proxy. |
fccff804 | 255 | |
b0fa7cc6 | 256 | %description standard -l pl.UTF-8 |
1a973791 | 257 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
258 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
259 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 260 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
261 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
262 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
263 | prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x") | |
264 | jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3 | |
265 | proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu | |
266 | Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji | |
267 | i działa od ponad dwóch i pół roku. Igor opublikował źródła na | |
268 | licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął | |
269 | dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej | |
270 | "zasobożerności". | |
1a973791 | 271 | |
57f21172 | 272 | To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla |
1dc54c84 | 273 | IMAP, POP3, SMTP. |
85600569 | 274 | |
dd7459ac | 275 | %package -n monit-rc-nginx |
57f21172 | 276 | Summary: nginx support for monit |
277 | Summary(pl.UTF-8): Wsparcie nginx dla monit | |
60b8f836 | 278 | Group: Applications/System |
279 | URL: http://nginx.eu/ | |
1a973791 | 280 | Requires: %{name}-common = %{version}-%{release} |
1cf92547 | 281 | Requires: monit |
dd7459ac | 282 | |
283 | %description -n monit-rc-nginx | |
57f21172 | 284 | monitrc file for monitoring nginx webserver. |
dd7459ac | 285 | |
286 | %description -n monit-rc-nginx -l pl.UTF-8 | |
57f21172 | 287 | Plik 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} |
295 | mv 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 | 303 | cp -f configure auto/ |
5d0d957d | 304 | |
2fb62cf2 ER |
305 | install -d bin |
306 | ||
021e3ce8 | 307 | # build with default options |
2fb62cf2 | 308 | build() { |
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} |
344 | cd modsecurity-%{modsecurity_version} | |
345 | ./autogen.sh | |
346 | %configure \ | |
347 | --enable-standalone-module \ | |
348 | --disable-mlogc \ | |
349 | --enable-alp2 \ | |
350 | --with-lua=/usr | |
351 | %{__make} | |
352 | cd .. | |
353 | %endif | |
354 | ||
483adace | 355 | %if %{with perl} && 0 |
78ac4e4e | 356 | build 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 | ||
373 | mv -f objs/nginx bin/nginx-perl | |
374 | mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so | |
375 | mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm | |
056acc18 | 376 | %endif |
377 | ||
008e09c3 | 378 | %if %{with mail} && 0 |
78ac4e4e | 379 | build mail \ |
f2d29d05 | 380 | --without-http \ |
056acc18 | 381 | --with-imap \ |
382 | --with-mail \ | |
383 | --with-mail_ssl_module \ | |
2fb62cf2 ER |
384 | %{nil} |
385 | ||
386 | mv -f objs/nginx bin/nginx-mail | |
056acc18 | 387 | %endif |
388 | ||
389 | %if %{with light} | |
78ac4e4e | 390 | build 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 | ||
403 | mv -f objs/nginx bin/nginx-light | |
056acc18 | 404 | %endif |
405 | ||
78ac4e4e | 406 | build 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 | |
424 | rm -rf $RPM_BUILD_ROOT | |
362f5ab2 | 425 | install -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 |
440 | cp -p %{_sourcedir}/%{name}.conf $RPM_BUILD_ROOT%{_sysconfdir} |
441 | cp -p %{_sourcedir}/%{name}.service $RPM_BUILD_ROOT%{systemdunitdir} | |
442 | cp -p %{_sourcedir}/%{name}.monitrc $RPM_BUILD_ROOT/etc/monit | |
c63e9e18 ER |
443 | install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
444 | ||
483adace ER |
445 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
446 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf | |
3c75ce8a | 447 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types |
483adace ER |
448 | rm -r $RPM_BUILD_ROOT%{_prefix}/html |
449 | cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html | |
450 | cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors | |
5ca9795d | 451 | cp -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 |
459 | touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params | |
460 | ||
f9e65082 ER |
461 | %clean |
462 | rm -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 | 471 | for 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 |
478 | done | |
c63e9e18 ER |
479 | /sbin/chkconfig --add %{name} |
480 | %systemd_post %{name}.service | |
481 | %service %{name} force-reload | |
738166d2 | 482 | |
c63e9e18 | 483 | %preun |
7d80c773 | 484 | if [ "$1" = "0" ];then |
c63e9e18 ER |
485 | %service %{name} stop |
486 | /sbin/chkconfig --del %{name} | |
0663f9da | 487 | fi |
c63e9e18 | 488 | %systemd_preun %{name}.service |
0663f9da | 489 | |
c63e9e18 | 490 | %postun |
f1fc9780 | 491 | if [ "$1" = "0" ]; then |
7d9b86c7 ER |
492 | %userremove %{name} |
493 | %groupremove %{name} | |
f1fc9780 | 494 | fi |
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 | |
512 | ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params | |
513 | ln -sf scgi_params %{_sysconfdir}/scgi.params | |
514 | ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params | |
515 | exit 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 |