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