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