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