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