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