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