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