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