]>
Commit | Line | Data |
---|---|---|
f9e65082 | 1 | # TODO |
ee4f2132 | 2 | # - /etc/sysconfig/nginx file |
1c438d78 | 3 | # - missing perl build/install requires |
7423f6a6 | 4 | # - mod_spdy build http://mailman.nginx.org/pipermail/nginx-devel/2012-June/002343.html patch from http://nginx.org/patches/attic/spdy/ |
1a66daf3 | 5 | # http://nginx.org/en/docs/http/ngx_http_spdy_module.html |
ee4f2132 | 6 | # |
362f5ab2 | 7 | # Conditional build for nginx: |
056acc18 | 8 | %bcond_without light # don't build light version |
9 | %bcond_without mail # don't build imap/mail proxy | |
10 | %bcond_without perl # don't build with perl module | |
d0c0492d | 11 | %bcond_without addition # adds module |
12 | %bcond_without dav # WebDAV | |
13 | %bcond_without flv # FLV stream | |
3d4bad81 | 14 | %bcond_without ipv6 # build without ipv6 support |
d6fc4b09 | 15 | %bcond_without sub # ngx_http_sub_module |
d0c0492d | 16 | %bcond_without poll # poll |
17 | %bcond_without realip # real ip (behind proxy) | |
18 | %bcond_without rtsig # rtsig | |
19 | %bcond_without select # select | |
20 | %bcond_without status # stats module | |
21 | %bcond_without ssl # ssl support | |
056acc18 | 22 | %bcond_with http_browser # header "User-agent" parser |
3b14ae78 | 23 | %bcond_with rtmp # rtmp support |
e9a11359 | 24 | %bcond_without auth_request # auth_request module |
fb649fe5 | 25 | |
b600cff3 | 26 | %define rtmp_version 1.1.5 |
8e1389c7 | 27 | Summary: High perfomance HTTP and reverse proxy server |
185313bb | 28 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
3dfa1ca2 AM |
29 | # nginx lines: |
30 | # - stable: production quality with stable API | |
31 | # - mainline: production quality but API can change | |
f9e65082 | 32 | Name: nginx |
f7602fcf | 33 | Version: 1.7.11 |
fcc4ab16 | 34 | Release: 1 |
51ef519b | 35 | License: BSD-like |
cbf76340 | 36 | Group: Networking/Daemons/HTTP |
06e274b9 | 37 | Source0: http://nginx.org/download/%{name}-%{version}.tar.gz |
f7602fcf | 38 | # Source0-md5: 22912ba71eebd6987be47eeaff79f0f0 |
06e274b9 | 39 | Source1: http://nginx.net/favicon.ico |
87404bf2 | 40 | # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab |
06e274b9 | 41 | Source2: proxy.conf |
226bcc40 | 42 | Source3: %{name}.logrotate |
43 | Source4: %{name}.mime | |
44 | Source5: %{name}-light.conf | |
45 | Source6: %{name}-light.monitrc | |
0da077af | 46 | Source7: %{name}-light.init |
47 | Source8: %{name}-mail.conf | |
48 | Source9: %{name}-mail.monitrc | |
49 | Source10: %{name}-mail.init | |
50 | Source11: %{name}-perl.conf | |
51 | Source12: %{name}-perl.monitrc | |
52 | Source13: %{name}-perl.init | |
53 | Source14: %{name}-standard.conf | |
54 | Source15: %{name}-standard.monitrc | |
7d80c773 | 55 | Source16: %{name}-standard.init |
56 | Source17: %{name}-mime.types.sh | |
d323480a JK |
57 | Source18: %{name}-standard.service |
58 | Source19: %{name}-light.service | |
59 | Source20: %{name}-perl.service | |
60 | Source21: %{name}-mail.service | |
5ca9795d ER |
61 | # when updating rtmp version, use this url: |
62 | #Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz | |
fb649fe5 | 63 | Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}.tar.gz |
b600cff3 | 64 | # Source101-md5: a85f8201c01b7c229b01a5e0fc87b374 |
5ca9795d | 65 | Patch0: %{name}-no-Werror.patch |
d38018f1 | 66 | Patch1: nginx-rtmp-module-build.patch |
51ef519b | 67 | URL: http://nginx.net/ |
dfef7372 | 68 | BuildRequires: mailcap |
f9e65082 | 69 | BuildRequires: openssl-devel |
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 | |
110 | Requires: openssl | |
111 | Requires: pcre | |
112 | Requires: rc-scripts >= 0.2.0 | |
113 | Requires: systemd-units >= 38 | |
114 | Requires: zlib | |
115 | Provides: group(http) | |
116 | Provides: group(nginx) | |
117 | Provides: user(nginx) | |
118 | Provides: webserver | |
5ca9795d | 119 | Obsoletes: nginx < 1.4.1-4.1 |
1a973791 | 120 | Conflicts: logrotate < 3.8.0 |
1a973791 JK |
121 | |
122 | %description common | |
123 | Common files for the nginx daemon. | |
124 | ||
125 | %description common -l pl.UTF-8 | |
57f21172 | 126 | Niezbędne pliki dla nginx. |
85600569 | 127 | |
2ee780b1 | 128 | %package light |
129 | Summary: High perfomance HTTP and reverse proxy server | |
7ad53968 | 130 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
cbf76340 | 131 | Group: Networking/Daemons/HTTP |
85600569 | 132 | Requires(post,preun): /sbin/chkconfig |
1a973791 JK |
133 | Requires(post,preun,postun): systemd-units >= 38 |
134 | Requires: %{name}-common = %{version}-%{release} | |
85600569 | 135 | Requires: openssl |
136 | Requires: pcre | |
137 | Requires: zlib | |
119e2f19 | 138 | Provides: nginx-daemon |
2ee780b1 | 139 | Provides: webserver |
140 | ||
141 | %description light | |
1a973791 JK |
142 | nginx ("engine x") is a high-performance HTTP server and reverse |
143 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
144 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
145 | has been running in production for over two and a half years. Igor has | |
146 | released the source code under a BSD-like license. Although still in | |
147 | beta, nginx is known for its stability, rich feature set, simple | |
148 | configuration, and low resource consumption. | |
149 | ||
57f21172 | 150 | The smallest, but also the fastest nginx edition. No additional |
7ad53968 | 151 | modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy. |
2ee780b1 | 152 | |
153 | %description light -l pl.UTF-8 | |
1a973791 | 154 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
155 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
156 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 157 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
158 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
159 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
1a973791 JK |
160 | prostej konfiguracji oraz małej "zasobożerności". |
161 | ||
57f21172 | 162 | Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV, |
1cf92547 | 163 | FLV oraz IMAP, POP3, SMTP proxy. |
2ee780b1 | 164 | |
165 | %package perl | |
166 | Summary: High perfomance HTTP and reverse proxy server | |
7ad53968 | 167 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
cbf76340 | 168 | Group: Networking/Daemons/HTTP |
85600569 | 169 | Requires(post,preun): /sbin/chkconfig |
1a973791 JK |
170 | Requires(post,preun,postun): systemd-units >= 38 |
171 | Requires: %{name}-common = %{version}-%{release} | |
85600569 | 172 | Requires: openssl |
1cf92547 | 173 | Provides: nginx-daemon |
2ee780b1 | 174 | Provides: webserver |
175 | ||
176 | %description perl | |
1a973791 JK |
177 | nginx ("engine x") is a high-performance HTTP server and reverse |
178 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
179 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
180 | has been running in production for over two and a half years. Igor has | |
181 | released the source code under a BSD-like license. Although still in | |
182 | beta, nginx is known for its stability, rich feature set, simple | |
183 | configuration, and low resource consumption. | |
184 | ||
57f21172 | 185 | nginx with Perl support. Mail modules not included. |
2ee780b1 | 186 | |
187 | %description perl -l pl.UTF-8 | |
1a973791 | 188 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
189 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
190 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 191 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
192 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
193 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
1a973791 JK |
194 | prostej konfiguracji oraz małej "zasobożerności". |
195 | ||
57f21172 | 196 | nginx z obsługą Perla. Bez wsparcia dla modułów poczty. |
2ee780b1 | 197 | |
198 | %package mail | |
57f21172 | 199 | Summary: High perfomance IMAP, POP3, SMTP proxy server |
200 | Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności | |
cbf76340 | 201 | Group: Networking/Daemons/HTTP |
85600569 | 202 | Requires(post,preun): /sbin/chkconfig |
1a973791 JK |
203 | Requires(post,preun,postun): systemd-units >= 38 |
204 | Requires: %{name}-common = %{version}-%{release} | |
85600569 | 205 | Requires: openssl |
206 | Requires: pcre | |
207 | Requires: zlib | |
1cf92547 | 208 | Provides: nginx-daemon |
2ee780b1 | 209 | |
210 | %description mail | |
1a973791 JK |
211 | nginx ("engine x") is a high-performance HTTP server and reverse |
212 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
213 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
214 | has been running in production for over two and a half years. Igor has | |
215 | released the source code under a BSD-like license. Although still in | |
216 | beta, nginx is known for its stability, rich feature set, simple | |
217 | configuration, and low resource consumption. | |
218 | ||
57f21172 | 219 | nginx with mail support. Only mail modules included. |
2ee780b1 | 220 | |
221 | %description mail -l pl.UTF-8 | |
1a973791 | 222 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
223 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
224 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 225 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
226 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
227 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
1a973791 JK |
228 | prostej konfiguracji oraz małej "zasobożerności". |
229 | ||
57f21172 | 230 | nginx ze wsparciem tylko dla modułów poczty. |
2ee780b1 | 231 | |
b0fa7cc6 | 232 | %package standard |
57f21172 | 233 | Summary: High perfomance HTTP and reverse proxy server |
4ca0234e | 234 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
cbf76340 | 235 | Group: Networking/Daemons/HTTP |
d6fc4b09 | 236 | Requires(post,preun): /sbin/chkconfig |
1a973791 JK |
237 | Requires(post,preun,postun): systemd-units >= 38 |
238 | Requires: %{name}-common = %{version}-%{release} | |
6de999a5 | 239 | Requires: openssl |
1a973791 | 240 | Provides: nginx |
1cf92547 | 241 | Provides: nginx-daemon |
d6fc4b09 | 242 | Conflicts: logrotate < 3.7-4 |
28a25161 | 243 | |
b0fa7cc6 | 244 | %description standard |
1a973791 JK |
245 | nginx ("engine x") is a high-performance HTTP server and reverse |
246 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
247 | Sysoev for Rambler.ru, Russia's second-most visited website, where it | |
248 | has been running in production for over two and a half years. Igor has | |
249 | released the source code under a BSD-like license. Although still in | |
250 | beta, nginx is known for its stability, rich feature set, simple | |
251 | configuration, and low resource consumption. | |
252 | ||
57f21172 | 253 | This is standard nginx version, without Perl support and IMAP, POP3, |
5ca9795d | 254 | SMTP proxy. |
fccff804 | 255 | |
b0fa7cc6 | 256 | %description standard -l pl.UTF-8 |
1a973791 | 257 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
5ca9795d ER |
258 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na |
259 | potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości | |
1a973791 | 260 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor |
5ca9795d ER |
261 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w |
262 | fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, | |
263 | prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x") | |
264 | jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3 | |
265 | proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu | |
266 | Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji | |
267 | i działa od ponad dwóch i pół roku. Igor opublikował źródła na | |
268 | licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął | |
269 | dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej | |
270 | "zasobożerności". | |
1a973791 | 271 | |
57f21172 | 272 | To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla |
1dc54c84 | 273 | IMAP, POP3, SMTP. |
85600569 | 274 | |
dd7459ac | 275 | %package -n monit-rc-nginx |
57f21172 | 276 | Summary: nginx support for monit |
277 | Summary(pl.UTF-8): Wsparcie nginx dla monit | |
60b8f836 | 278 | Group: Applications/System |
279 | URL: http://nginx.eu/ | |
1a973791 | 280 | Requires: %{name}-common = %{version}-%{release} |
1cf92547 | 281 | Requires: monit |
dd7459ac | 282 | |
283 | %description -n monit-rc-nginx | |
57f21172 | 284 | monitrc file for monitoring nginx webserver. |
dd7459ac | 285 | |
286 | %description -n monit-rc-nginx -l pl.UTF-8 | |
57f21172 | 287 | Plik monitrc do monitorowania serwera WWW nginx. |
dd7459ac | 288 | |
f9e65082 | 289 | %prep |
9fc2d63c | 290 | %setup -q %{?with_rtmp:-a101} |
717159c4 | 291 | %patch0 -p0 |
f9e65082 | 292 | |
fb649fe5 ER |
293 | %if %{with rtmp} |
294 | mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module | |
d38018f1 AM |
295 | cd nginx-rtmp-module |
296 | %patch1 -p1 | |
297 | cd .. | |
fb649fe5 ER |
298 | %endif |
299 | ||
a8eaad11 | 300 | # build mime.types.conf |
7d80c773 | 301 | #sh %{SOURCE17} /etc/mime.types |
a8eaad11 | 302 | |
f9e65082 ER |
303 | %build |
304 | # NB: not autoconf generated configure | |
056acc18 | 305 | cp -f configure auto/ |
306 | # | |
307 | %if %{with perl} | |
308 | ./configure \ | |
309 | --prefix=%{_prefix} \ | |
4e61eac8 | 310 | --sbin-path=%{_sbindir}/%{name}-perl \ |
311 | --conf-path=%{_sysconfdir}/%{name}-perl.conf \ | |
312 | --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \ | |
313 | --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \ | |
314 | --pid-path=%{_localstatedir}/run/%{name}-perl.pid \ | |
315 | --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \ | |
056acc18 | 316 | --user=nginx \ |
317 | --group=nginx \ | |
318 | --with-http_perl_module \ | |
2ee780b1 | 319 | --without-mail_pop3_module \ |
320 | --without-mail_imap_module \ | |
321 | --without-mail_smtp_module \ | |
056acc18 | 322 | %{?with_addition:--with-http_addition_module} \ |
323 | %{?with_dav:--with-http_dav_module} \ | |
324 | %{?with_flv:--with-http_flv_module} \ | |
3d4bad81 | 325 | %{?with_ipv6:--with-ipv6} \ |
d6fc4b09 | 326 | %{?with_sub:--with-http_sub_module} \ |
056acc18 | 327 | %{?with_poll:--with-poll_module} \ |
328 | %{?with_realip:--with-http_realip_module} \ | |
329 | %{?with_rtsig:--with-rtsig_module} \ | |
330 | %{?with_select:--with-select_module} \ | |
331 | %{?with_status:--with-http_stub_status_module} \ | |
332 | %{?with_ssl:--with-http_ssl_module} \ | |
333 | %{!?with_http_browser:--without-http_browser_module} \ | |
fb649fe5 | 334 | %{?with_rtmp:--add-module=./nginx-rtmp-module} \ |
e9a11359 | 335 | %{?with_auth_request:--with-http_auth_request_module} \ |
ca3f3f03 | 336 | --with-http_secure_link_module \ |
4e61eac8 | 337 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \ |
338 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \ | |
339 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \ | |
056acc18 | 340 | --with-cc="%{__cc}" \ |
341 | --with-cc-opt="%{rpmcflags}" \ | |
342 | --with-ld-opt="%{rpmldflags}" | |
343 | %{__make} | |
4e61eac8 | 344 | mv -f objs/nginx contrib/nginx-perl |
d6fc4b09 | 345 | mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so |
346 | mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm | |
056acc18 | 347 | %endif |
348 | ||
349 | %if %{with mail} | |
056acc18 | 350 | ./configure \ |
351 | --prefix=%{_prefix} \ | |
4e61eac8 | 352 | --sbin-path=%{_sbindir}/%{name}-mail \ |
353 | --conf-path=%{_sysconfdir}/%{name}-mail.conf \ | |
354 | --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \ | |
355 | --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \ | |
356 | --pid-path=%{_localstatedir}/run/%{name}-mail.pid \ | |
357 | --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \ | |
056acc18 | 358 | --user=nginx \ |
359 | --group=nginx \ | |
360 | --with-imap \ | |
361 | --with-mail \ | |
362 | --with-mail_ssl_module \ | |
d6fc4b09 | 363 | --without-http \ |
129a70a2 | 364 | %{?with_ipv6:--with-ipv6} \ |
056acc18 | 365 | %{?with_poll:--with-poll_module} \ |
056acc18 | 366 | %{?with_rtsig:--with-rtsig_module} \ |
367 | %{?with_select:--with-select_module} \ | |
4e61eac8 | 368 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \ |
369 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \ | |
370 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \ | |
056acc18 | 371 | --with-cc="%{__cc}" \ |
372 | --with-cc-opt="%{rpmcflags}" \ | |
373 | --with-ld-opt="%{rpmldflags}" \ | |
374 | %{?debug:--with-debug} | |
375 | %{__make} | |
4e61eac8 | 376 | mv -f objs/nginx contrib/nginx-mail |
056acc18 | 377 | %endif |
378 | ||
379 | %if %{with light} | |
056acc18 | 380 | ./configure \ |
381 | --prefix=%{_prefix} \ | |
4e61eac8 | 382 | --sbin-path=%{_sbindir}/%{name}-light \ |
383 | --conf-path=%{_sysconfdir}/%{name}-light.conf \ | |
384 | --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \ | |
385 | --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \ | |
386 | --pid-path=%{_localstatedir}/run/%{name}-light.pid \ | |
387 | --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \ | |
056acc18 | 388 | --user=nginx \ |
389 | --group=nginx \ | |
129a70a2 | 390 | %{?with_ipv6:--with-ipv6} \ |
056acc18 | 391 | %{?with_poll:--with-poll_module} \ |
392 | %{?with_realip:--with-http_realip_module} \ | |
393 | %{?with_rtsig:--with-rtsig_module} \ | |
394 | %{?with_select:--with-select_module} \ | |
395 | %{?with_status:--with-http_stub_status_module} \ | |
396 | %{?with_ssl:--with-http_ssl_module} \ | |
fb649fe5 | 397 | %{?with_rtmp:--add-module=./nginx-rtmp-module} \ |
e9a11359 | 398 | %{?with_auth_request:--with-http_auth_request_module} \ |
056acc18 | 399 | --without-http_browser_module \ |
1a62642d | 400 | --without-mail_pop3_module \ |
401 | --without-mail_imap_module \ | |
402 | --without-mail_smtp_module \ | |
ca3f3f03 | 403 | --with-http_secure_link_module \ |
4e61eac8 | 404 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \ |
405 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \ | |
406 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \ | |
056acc18 | 407 | --with-cc="%{__cc}" \ |
408 | --with-cc-opt="%{rpmcflags}" \ | |
409 | --with-ld-opt="%{rpmldflags}" \ | |
410 | %{?debug:--with-debug} | |
411 | %{__make} | |
4e61eac8 | 412 | mv -f objs/nginx contrib/nginx-light |
056acc18 | 413 | %endif |
414 | ||
f9e65082 ER |
415 | ./configure \ |
416 | --prefix=%{_prefix} \ | |
226bcc40 | 417 | --sbin-path=%{_sbindir}/%{name}-standard \ |
f1686a52 | 418 | --conf-path=%{_sysconfdir}/%{name}-standard.conf \ |
226bcc40 | 419 | --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \ |
420 | --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \ | |
421 | --pid-path=%{_localstatedir}/run/%{name}-standard.pid \ | |
422 | --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \ | |
dfef7372 ER |
423 | --user=nginx \ |
424 | --group=nginx \ | |
d0c0492d | 425 | %{?with_addition:--with-http_addition_module} \ |
426 | %{?with_dav:--with-http_dav_module} \ | |
427 | %{?with_flv:--with-http_flv_module} \ | |
129a70a2 | 428 | %{?with_ipv6:--with-ipv6} \ |
d6fc4b09 | 429 | %{?with_sub:--with-http_sub_module} \ |
d0c0492d | 430 | %{?with_poll:--with-poll_module} \ |
431 | %{?with_realip:--with-http_realip_module} \ | |
362f5ab2 | 432 | %{?with_rtsig:--with-rtsig_module} \ |
433 | %{?with_select:--with-select_module} \ | |
d0c0492d | 434 | %{?with_status:--with-http_stub_status_module} \ |
362f5ab2 | 435 | %{?with_ssl:--with-http_ssl_module} \ |
ee4f2132 | 436 | %{!?with_http_browser:--without-http_browser_module} \ |
fb649fe5 | 437 | %{?with_rtmp:--add-module=./nginx-rtmp-module} \ |
e9a11359 | 438 | %{?with_auth_request:--with-http_auth_request_module} \ |
ca3f3f03 | 439 | --with-http_secure_link_module \ |
226bcc40 | 440 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \ |
441 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \ | |
442 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \ | |
f9e65082 ER |
443 | --with-cc="%{__cc}" \ |
444 | --with-cc-opt="%{rpmcflags}" \ | |
445 | --with-ld-opt="%{rpmldflags}" \ | |
446 | %{?debug:--with-debug} | |
f9e65082 ER |
447 | %{__make} |
448 | ||
056acc18 | 449 | |
f9e65082 ER |
450 | %install |
451 | rm -rf $RPM_BUILD_ROOT | |
362f5ab2 | 452 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \ |
453 | $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \ | |
4e61eac8 | 454 | $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \ |
226bcc40 | 455 | $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \ |
456 | $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \ | |
36b3be34 | 457 | $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \ |
d323480a | 458 | $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \ |
599f35f0 | 459 | $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system} |
f9e65082 | 460 | |
5ca9795d ER |
461 | cp -p conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params |
462 | cp -p conf/scgi_params $RPM_BUILD_ROOT%{_sysconfdir}/scgi.params | |
463 | cp -p conf/uwsgi_params $RPM_BUILD_ROOT%{_sysconfdir}/uwsgi.params | |
464 | cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf | |
465 | cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win | |
466 | cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf | |
467 | cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html | |
468 | cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors | |
469 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico | |
470 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf | |
471 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
472 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types | |
473 | cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf | |
474 | cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc | |
475 | install -p %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard | |
476 | cp -p %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service | |
477 | install -p objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard | |
599f35f0 | 478 | ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service |
85600569 | 479 | |
480 | %if %{with light} | |
5ca9795d ER |
481 | cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf |
482 | cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc | |
483 | cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light | |
484 | cp -p %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service | |
485 | install -p contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light | |
85600569 | 486 | %endif |
487 | ||
488 | %if %{with mail} | |
5ca9795d ER |
489 | cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf |
490 | cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc | |
491 | install -p contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail | |
492 | install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail | |
493 | cp -p %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service | |
85600569 | 494 | %endif |
495 | ||
496 | %if %{with perl} | |
497 | install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}} | |
5ca9795d ER |
498 | cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf |
499 | cp -p %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc | |
500 | install -p %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl | |
501 | cp -p %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service | |
502 | cp -p contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm | |
503 | install -p contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so | |
504 | install -p contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl | |
85600569 | 505 | %endif |
f9e65082 ER |
506 | |
507 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default | |
508 | rm -rf $RPM_BUILD_ROOT%{_prefix}/html | |
509 | ||
510 | %clean | |
511 | rm -rf $RPM_BUILD_ROOT | |
512 | ||
1a973791 | 513 | %pre common |
a37373c3 | 514 | %groupadd -r -g 213 %{name} |
362f5ab2 | 515 | %groupadd -g 51 http |
a37373c3 | 516 | %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name} |
362f5ab2 | 517 | %addusertogroup %{name} http |
f1fc9780 | 518 | |
738166d2 | 519 | %post standard |
520 | for a in access.log error.log; do | |
521 | if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then | |
98376457 | 522 | umask 022 |
738166d2 | 523 | touch /var/log/%{name}/nginx-standard_$a |
1cf92547 | 524 | chown nginx:nginx /var/log/%{name}/nginx-standard_$a |
738166d2 | 525 | chmod 644 /var/log/%{name}/nginx-standard_$a |
526 | fi | |
527 | done | |
3d760264 | 528 | /sbin/chkconfig --add %{name}-standard |
d323480a | 529 | %systemd_post %{name}-standard.service |
3d760264 | 530 | %service %{name}-standard restart |
a20d2702 | 531 | echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.' |
599f35f0 JK |
532 | if ! [ -L /etc/systemd/system/nginx.service ] ; then |
533 | ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || : | |
534 | fi | |
738166d2 | 535 | |
536 | %post light | |
537 | for a in access.log error.log; do | |
538 | if [ ! -f /var/log/%{name}/nginx-light_$a ]; then | |
98376457 | 539 | umask 022 |
738166d2 | 540 | touch /var/log/%{name}/nginx-light_$a |
541 | chown nginx:nginx /var/log/%{name}/nginx-light_$a | |
542 | chmod 644 /var/log/%{name}/nginx-light_$a | |
543 | fi | |
544 | done | |
3d760264 | 545 | /sbin/chkconfig --add %{name}-light |
d323480a | 546 | %systemd_post %{name}-light.service |
3d760264 | 547 | %service %{name}-light restart |
a20d2702 | 548 | echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config' |
738166d2 | 549 | |
550 | %post perl | |
551 | for a in access.log error.log; do | |
552 | if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then | |
98376457 | 553 | umask 022 |
738166d2 | 554 | touch /var/log/%{name}/nginx-perl_$a |
555 | chown nginx:nginx /var/log/%{name}/nginx-perl_$a | |
556 | chmod 644 /var/log/%{name}/nginx-perl_$a | |
557 | fi | |
558 | done | |
3d760264 | 559 | /sbin/chkconfig --add %{name}-perl |
d323480a | 560 | %systemd_post %{name}-perl.service |
3d760264 | 561 | %service %{name}-perl restart |
a20d2702 | 562 | echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config' |
738166d2 | 563 | |
564 | %post mail | |
362f5ab2 | 565 | for a in access.log error.log; do |
738166d2 | 566 | if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then |
98376457 | 567 | umask 022 |
738166d2 | 568 | touch /var/log/%{name}/nginx-mail_$a |
569 | chown nginx:nginx /var/log/%{name}/nginx-mail_$a | |
570 | chmod 644 /var/log/%{name}/nginx-mail_$a | |
362f5ab2 | 571 | fi |
572 | done | |
3d760264 | 573 | /sbin/chkconfig --add %{name}-mail |
d323480a | 574 | %systemd_post %{name}-mail.service |
3d760264 | 575 | %service %{name}-mail restart |
a20d2702 | 576 | echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config' |
f9e65082 | 577 | |
b0fa7cc6 | 578 | %preun standard |
7d80c773 | 579 | if [ "$1" = "0" ];then |
6eef4074 | 580 | %service %{name}-standard stop |
226bcc40 | 581 | /sbin/chkconfig --del %{name}-standard |
f9e65082 | 582 | fi |
d323480a | 583 | %systemd_preun %{name}-standard.service |
f9e65082 | 584 | |
0663f9da | 585 | %preun light |
586 | if [ "$1" = "0" ]; then | |
6eef4074 | 587 | %service %{name}-light stop |
226bcc40 | 588 | /sbin/chkconfig --del %{name}-light |
0663f9da | 589 | fi |
d323480a | 590 | %systemd_preun %{name}-light.service |
0663f9da | 591 | |
592 | %preun perl | |
593 | if [ "$1" = "0" ]; then | |
6eef4074 | 594 | %service %{name}-perl stop |
226bcc40 | 595 | /sbin/chkconfig --del %{name}-perl |
0663f9da | 596 | fi |
d323480a | 597 | %systemd_preun %{name}-perl.service |
0663f9da | 598 | |
599 | %preun mail | |
600 | if [ "$1" = "0" ]; then | |
6eef4074 | 601 | %service %{name}-mail stop |
226bcc40 | 602 | /sbin/chkconfig --del %{name}-mail |
0663f9da | 603 | fi |
d323480a | 604 | %systemd_preun %{name}-mail.service |
0663f9da | 605 | |
1a973791 | 606 | %postun common |
f1fc9780 | 607 | if [ "$1" = "0" ]; then |
7d9b86c7 ER |
608 | %userremove %{name} |
609 | %groupremove %{name} | |
f1fc9780 | 610 | fi |
611 | ||
d323480a JK |
612 | %postun standard |
613 | %systemd_reload | |
614 | ||
615 | %postun light | |
616 | %systemd_reload | |
617 | ||
618 | %postun perl | |
619 | %systemd_reload | |
620 | ||
621 | %postun mail | |
622 | %systemd_reload | |
623 | ||
624 | %triggerpostun -- %{name}-standard < 1.4.1-4 | |
625 | %systemd_trigger %{name}-standard.service | |
626 | ||
627 | %triggerpostun -- %{name}-light < 1.4.1-4 | |
628 | %systemd_trigger %{name}-light.service | |
629 | ||
630 | %triggerpostun -- %{name}-perl < 1.4.1-4 | |
631 | %systemd_trigger %{name}-perl.service | |
632 | ||
633 | %triggerpostun -- %{name}-mail < 1.4.1-4 | |
634 | %systemd_trigger %{name}-mail.service | |
635 | ||
1a973791 | 636 | %files common |
f9e65082 | 637 | %defattr(644,root,root,755) |
6f8318ed | 638 | %doc CHANGES LICENSE README html/index.html conf/nginx.conf |
f9e65082 | 639 | %doc %lang(ru) CHANGES.ru |
f1fc9780 | 640 | %dir %attr(754,root,root) %{_sysconfdir} |
164ab75d | 641 | %dir %{_nginxdir} |
642 | %dir %{_nginxdir}/cgi-bin | |
643 | %dir %{_nginxdir}/html | |
644 | %dir %{_nginxdir}/errors | |
28a25161 | 645 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} |
98376457 | 646 | # XXX: duplicates, don't use such glob here |
57f21172 | 647 | #%attr(640,root,root) %{_sysconfdir}/*[_-]* |
98376457 | 648 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf |
394dc7b0 | 649 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params |
0bc43776 JK |
650 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi.params |
651 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi.params | |
f1fc9780 | 652 | %attr(640,root,root) %{_sysconfdir}/mime.types |
57f21172 | 653 | %attr(640,root,root) %{_sysconfdir}/koi-utf |
654 | %attr(640,root,root) %{_sysconfdir}/koi-win | |
655 | %attr(640,root,root) %{_sysconfdir}/win-utf | |
36b3be34 JK |
656 | %dir %{_sysconfdir}/webapps.d |
657 | %dir %{_sysconfdir}/vhosts.d | |
debe6eba JR |
658 | %attr(750,nginx,logs) %dir /var/log/archive/%{name} |
659 | %attr(750,nginx,logs) /var/log/%{name} | |
475fecd1 | 660 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/* |
cd728db7 | 661 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/* |
599f35f0 | 662 | %ghost /etc/systemd/system/nginx.service |
28a25161 | 663 | |
b0fa7cc6 | 664 | %files standard |
665 | %defattr(644,root,root,755) | |
de0bfb9b | 666 | %attr(755,root,root) %{_sbindir}/%{name}-standard |
1846cd14 | 667 | %attr(770,root,%{name}) /var/cache/%{name}-standard |
0da077af | 668 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard |
4ddbebd7 | 669 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf |
d323480a | 670 | %{systemdunitdir}/%{name}-standard.service |
b0fa7cc6 | 671 | |
85600569 | 672 | %if %{with mail} |
673 | %files mail | |
674 | %defattr(644,root,root,755) | |
4e61eac8 | 675 | %attr(755,root,root) %{_sbindir}/%{name}-mail |
1846cd14 | 676 | %attr(770,root,%{name}) /var/cache/%{name}-mail |
0da077af | 677 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail |
4ddbebd7 | 678 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf |
d323480a | 679 | %{systemdunitdir}/%{name}-mail.service |
85600569 | 680 | %endif |
681 | ||
682 | %if %{with light} | |
683 | %files light | |
684 | %defattr(644,root,root,755) | |
4e61eac8 | 685 | %attr(755,root,root) %{_sbindir}/%{name}-light |
1846cd14 | 686 | %attr(770,root,%{name}) /var/cache/%{name}-light |
0da077af | 687 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-light |
4ddbebd7 | 688 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf |
d323480a | 689 | %{systemdunitdir}/%{name}-light.service |
85600569 | 690 | %endif |
691 | ||
692 | %if %{with perl} | |
693 | %files perl | |
694 | %defattr(644,root,root,755) | |
4e61eac8 | 695 | %attr(755,root,root) %{_sbindir}/%{name}-perl |
0da077af | 696 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl |
f7b57295 | 697 | %attr(770,root,%{name}) /var/cache/%{name}-perl |
1846cd14 | 698 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf |
85600569 | 699 | %dir %{perl_vendorarch}/auto/%{name} |
700 | %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so | |
98376457 | 701 | %{perl_vendorarch}/%{name}.pm |
d323480a | 702 | %{systemdunitdir}/%{name}-perl.service |
dd7459ac | 703 | %endif |
704 | ||
705 | %files -n monit-rc-nginx | |
706 | %defattr(644,root,root,755) | |
707 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc | |
708 | %if %{with perl} | |
1846cd14 | 709 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc |
85600569 | 710 | %endif |
dd7459ac | 711 | %if %{with light} |
712 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc | |
713 | %endif | |
714 | %if %{with mail} | |
715 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc | |
716 | %endif |