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