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