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