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