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