]>
Commit | Line | Data |
---|---|---|
f9e65082 | 1 | # TODO |
ee4f2132 | 2 | # - /etc/sysconfig/nginx file |
1c438d78 | 3 | # - missing perl build/install requires |
6de999a5 | 4 | # - nginx should have own group (and work with it) or use http group ? |
ee4f2132 | 5 | # |
362f5ab2 | 6 | # Conditional build for nginx: |
056acc18 | 7 | %bcond_without light # don't build light version |
8 | %bcond_without mail # don't build imap/mail proxy | |
9 | %bcond_without perl # don't build with perl module | |
d0c0492d | 10 | %bcond_without addition # adds module |
11 | %bcond_without dav # WebDAV | |
12 | %bcond_without flv # FLV stream | |
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 | |
18 | %bcond_without status # stats module | |
19 | %bcond_without ssl # ssl support | |
056acc18 | 20 | %bcond_with http_browser # header "User-agent" parser |
362f5ab2 | 21 | # |
8e1389c7 | 22 | Summary: High perfomance HTTP and reverse proxy server |
185313bb | 23 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
f9e65082 | 24 | Name: nginx |
dcfb1b89 | 25 | Version: 0.6.32 |
bb0ec28a | 26 | Release: 0.1 |
51ef519b | 27 | License: BSD-like |
7d9b86c7 | 28 | Group: Networking/Daemons |
f1fc9780 | 29 | Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz |
dcfb1b89 | 30 | # Source0-md5: c09a2ace3c91f45dabbb608b11e48ed1 |
226bcc40 | 31 | Source1: http://www.nginx.eu/favicon.ico |
32 | # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab | |
33 | Source2: http://www.nginx.eu/download/proxy.conf | |
34 | # Source2-md5: f5263ae01c2edb18f46d5d1df2d3a5cd | |
35 | Source3: %{name}.logrotate | |
36 | Source4: %{name}.mime | |
37 | Source5: %{name}-light.conf | |
38 | Source6: %{name}-light.monitrc | |
0da077af | 39 | Source7: %{name}-light.init |
40 | Source8: %{name}-mail.conf | |
41 | Source9: %{name}-mail.monitrc | |
42 | Source10: %{name}-mail.init | |
43 | Source11: %{name}-perl.conf | |
44 | Source12: %{name}-perl.monitrc | |
45 | Source13: %{name}-perl.init | |
46 | Source14: %{name}-standard.conf | |
47 | Source15: %{name}-standard.monitrc | |
7d80c773 | 48 | Source16: %{name}-standard.init |
49 | Source17: %{name}-mime.types.sh | |
51ef519b | 50 | URL: http://nginx.net/ |
dfef7372 | 51 | BuildRequires: mailcap |
f9e65082 | 52 | BuildRequires: openssl-devel |
f1fc9780 | 53 | BuildRequires: pcre-devel |
1c438d78 | 54 | %{?with_perl:BuildRequires: perl-CGI} |
d0c0492d | 55 | %{?with_perl:BuildRequires: perl-devel} |
dd2388c2 | 56 | %{?with_perl:BuildRequires: python} |
1c438d78 | 57 | %{?with_perl:BuildRequires: rpm-perlprov} |
7d9b86c7 | 58 | BuildRequires: rpmbuild(macros) >= 1.268 |
f9e65082 | 59 | BuildRequires: zlib-devel |
7d9b86c7 ER |
60 | Requires(post,preun): /sbin/chkconfig |
61 | Requires(postun): /usr/sbin/groupdel | |
62 | Requires(postun): /usr/sbin/userdel | |
63 | Requires(pre): /bin/id | |
64 | Requires(pre): /usr/bin/getgid | |
65 | Requires(pre): /usr/sbin/groupadd | |
66 | Requires(pre): /usr/sbin/useradd | |
119e2f19 | 67 | Requires: nginx-daemon |
d0c0492d | 68 | Requires: openssl |
69 | Requires: pcre | |
aba2d783 | 70 | Requires: rc-scripts >= 0.2.0 |
d0c0492d | 71 | Requires: zlib |
1cf92547 | 72 | Suggests: nginx-standard |
ee547c00 | 73 | Provides: group(http) |
74 | Provides: group(nginx) | |
75 | Provides: user(nginx) | |
7ffe7917 | 76 | Provides: webserver |
226bcc40 | 77 | Conflicts: logrotate < 3.7-4 |
f9e65082 ER |
78 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
79 | ||
362f5ab2 | 80 | %define _sysconfdir /etc/%{name} |
81 | %define _nginxdir /home/services/%{name} | |
f9e65082 ER |
82 | |
83 | %description | |
57f21172 | 84 | nginx ("engine x") is a high-performance HTTP server and reverse |
85 | proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor | |
894ff1f7 ER |
86 | Sysoev for Rambler.ru, Russia's second-most visited website, where it |
87 | has been running in production for over two and a half years. Igor has | |
88 | released the source code under a BSD-like license. Although still in | |
57f21172 | 89 | beta, nginx is known for its stability, rich feature set, simple |
894ff1f7 | 90 | configuration, and low resource consumption. |
8e1389c7 | 91 | |
57f21172 | 92 | Common files for nginx daemon. |
85600569 | 93 | |
390f5b88 | 94 | %description -l pl.UTF-8 |
57f21172 | 95 | nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy |
96 | a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva | |
056acc18 | 97 | na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości |
98 | odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor | |
99 | opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle | |
98376457 | 100 | w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków, |
1dc54c84 | 101 | prostej konfiguracji oraz małej "zasobożerności". |
2ee780b1 | 102 | |
57f21172 | 103 | Niezbędne pliki dla nginx. |
85600569 | 104 | |
2ee780b1 | 105 | %package light |
106 | Summary: High perfomance HTTP and reverse proxy server | |
7ad53968 | 107 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
85600569 | 108 | Group: Networking/Daemons |
85600569 | 109 | Requires(post,preun): /sbin/chkconfig |
110 | Requires(postun): /usr/sbin/groupdel | |
111 | Requires(postun): /usr/sbin/userdel | |
b0fa7cc6 | 112 | Requires: %{name} = %{version}-%{release} |
85600569 | 113 | Requires: openssl |
114 | Requires: pcre | |
115 | Requires: zlib | |
2ee780b1 | 116 | Provides: group(http) |
117 | Provides: group(nginx) | |
119e2f19 | 118 | Provides: nginx-daemon |
2ee780b1 | 119 | Provides: user(nginx) |
120 | Provides: webserver | |
121 | ||
122 | %description light | |
57f21172 | 123 | The smallest, but also the fastest nginx edition. No additional |
7ad53968 | 124 | modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy. |
2ee780b1 | 125 | |
126 | %description light -l pl.UTF-8 | |
57f21172 | 127 | Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV, |
1cf92547 | 128 | FLV oraz IMAP, POP3, SMTP proxy. |
2ee780b1 | 129 | |
130 | %package perl | |
131 | Summary: High perfomance HTTP and reverse proxy server | |
7ad53968 | 132 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
85600569 | 133 | Group: Networking/Daemons |
85600569 | 134 | Requires(post,preun): /sbin/chkconfig |
135 | Requires(postun): /usr/sbin/groupdel | |
136 | Requires(postun): /usr/sbin/userdel | |
b0fa7cc6 | 137 | Requires: %{name} = %{version}-%{release} |
85600569 | 138 | Requires: openssl |
2ee780b1 | 139 | Provides: group(http) |
140 | Provides: group(nginx) | |
1cf92547 | 141 | Provides: nginx-daemon |
2ee780b1 | 142 | Provides: user(nginx) |
143 | Provides: webserver | |
144 | ||
145 | %description perl | |
57f21172 | 146 | nginx with Perl support. Mail modules not included. |
2ee780b1 | 147 | |
148 | %description perl -l pl.UTF-8 | |
57f21172 | 149 | nginx z obsługą Perla. Bez wsparcia dla modułów poczty. |
2ee780b1 | 150 | |
151 | %package mail | |
57f21172 | 152 | Summary: High perfomance IMAP, POP3, SMTP proxy server |
153 | Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności | |
85600569 | 154 | Group: Networking/Daemons |
85600569 | 155 | Requires(post,preun): /sbin/chkconfig |
156 | Requires(postun): /usr/sbin/groupdel | |
157 | Requires(postun): /usr/sbin/userdel | |
b0fa7cc6 | 158 | Requires: %{name} = %{version}-%{release} |
85600569 | 159 | Requires: openssl |
160 | Requires: pcre | |
161 | Requires: zlib | |
2ee780b1 | 162 | Provides: group(http) |
163 | Provides: group(nginx) | |
1cf92547 | 164 | Provides: nginx-daemon |
2ee780b1 | 165 | Provides: user(nginx) |
166 | Provides: webserver | |
167 | ||
168 | %description mail | |
57f21172 | 169 | nginx with mail support. Only mail modules included. |
2ee780b1 | 170 | |
171 | %description mail -l pl.UTF-8 | |
57f21172 | 172 | nginx ze wsparciem tylko dla modułów poczty. |
2ee780b1 | 173 | |
b0fa7cc6 | 174 | %package standard |
57f21172 | 175 | Summary: High perfomance HTTP and reverse proxy server |
4ca0234e | 176 | Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności |
2ee780b1 | 177 | Group: Networking/Daemons |
d6fc4b09 | 178 | Requires(post,preun): /sbin/chkconfig |
179 | Requires(postun): /usr/sbin/groupdel | |
180 | Requires(postun): /usr/sbin/userdel | |
b0fa7cc6 | 181 | Requires: %{name} = %{version}-%{release} |
6de999a5 | 182 | Requires: openssl |
183 | Provides: group(http) | |
184 | Provides: group(nginx) | |
1cf92547 | 185 | Provides: nginx-daemon |
d6fc4b09 | 186 | Conflicts: logrotate < 3.7-4 |
28a25161 | 187 | |
b0fa7cc6 | 188 | %description standard |
57f21172 | 189 | This is standard nginx version, without Perl support and IMAP, POP3, |
1dc54c84 | 190 | SMTP proxy. |
fccff804 | 191 | |
b0fa7cc6 | 192 | %description standard -l pl.UTF-8 |
57f21172 | 193 | To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla |
1dc54c84 | 194 | IMAP, POP3, SMTP. |
85600569 | 195 | |
dd7459ac | 196 | %package -n monit-rc-nginx |
57f21172 | 197 | Summary: nginx support for monit |
198 | Summary(pl.UTF-8): Wsparcie nginx dla monit | |
60b8f836 | 199 | Group: Applications/System |
200 | URL: http://nginx.eu/ | |
60b8f836 | 201 | Requires: %{name} = %{version}-%{release} |
1cf92547 | 202 | Requires: monit |
dd7459ac | 203 | |
204 | %description -n monit-rc-nginx | |
57f21172 | 205 | monitrc file for monitoring nginx webserver. |
dd7459ac | 206 | |
207 | %description -n monit-rc-nginx -l pl.UTF-8 | |
57f21172 | 208 | Plik monitrc do monitorowania serwera WWW nginx. |
dd7459ac | 209 | |
f9e65082 ER |
210 | %prep |
211 | %setup -q | |
f9e65082 | 212 | |
a8eaad11 | 213 | # build mime.types.conf |
7d80c773 | 214 | #sh %{SOURCE17} /etc/mime.types |
a8eaad11 | 215 | |
f9e65082 ER |
216 | %build |
217 | # NB: not autoconf generated configure | |
056acc18 | 218 | cp -f configure auto/ |
219 | # | |
220 | %if %{with perl} | |
221 | ./configure \ | |
222 | --prefix=%{_prefix} \ | |
4e61eac8 | 223 | --sbin-path=%{_sbindir}/%{name}-perl \ |
224 | --conf-path=%{_sysconfdir}/%{name}-perl.conf \ | |
225 | --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \ | |
226 | --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \ | |
227 | --pid-path=%{_localstatedir}/run/%{name}-perl.pid \ | |
228 | --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \ | |
056acc18 | 229 | --user=nginx \ |
230 | --group=nginx \ | |
231 | --with-http_perl_module \ | |
2ee780b1 | 232 | --without-mail_pop3_module \ |
233 | --without-mail_imap_module \ | |
234 | --without-mail_smtp_module \ | |
056acc18 | 235 | %{?with_addition:--with-http_addition_module} \ |
236 | %{?with_dav:--with-http_dav_module} \ | |
237 | %{?with_flv:--with-http_flv_module} \ | |
d6fc4b09 | 238 | %{?with_sub:--with-http_sub_module} \ |
056acc18 | 239 | %{?with_poll:--with-poll_module} \ |
240 | %{?with_realip:--with-http_realip_module} \ | |
241 | %{?with_rtsig:--with-rtsig_module} \ | |
242 | %{?with_select:--with-select_module} \ | |
243 | %{?with_status:--with-http_stub_status_module} \ | |
244 | %{?with_ssl:--with-http_ssl_module} \ | |
245 | %{!?with_http_browser:--without-http_browser_module} \ | |
4e61eac8 | 246 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \ |
247 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \ | |
248 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \ | |
056acc18 | 249 | --with-cc="%{__cc}" \ |
250 | --with-cc-opt="%{rpmcflags}" \ | |
251 | --with-ld-opt="%{rpmldflags}" | |
252 | %{__make} | |
4e61eac8 | 253 | mv -f objs/nginx contrib/nginx-perl |
d6fc4b09 | 254 | mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs |
255 | mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so | |
256 | mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm | |
056acc18 | 257 | %endif |
258 | ||
259 | %if %{with mail} | |
056acc18 | 260 | ./configure \ |
261 | --prefix=%{_prefix} \ | |
4e61eac8 | 262 | --sbin-path=%{_sbindir}/%{name}-mail \ |
263 | --conf-path=%{_sysconfdir}/%{name}-mail.conf \ | |
264 | --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \ | |
265 | --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \ | |
266 | --pid-path=%{_localstatedir}/run/%{name}-mail.pid \ | |
267 | --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \ | |
056acc18 | 268 | --user=nginx \ |
269 | --group=nginx \ | |
270 | --with-imap \ | |
271 | --with-mail \ | |
272 | --with-mail_ssl_module \ | |
d6fc4b09 | 273 | --without-http \ |
056acc18 | 274 | %{?with_poll:--with-poll_module} \ |
056acc18 | 275 | %{?with_rtsig:--with-rtsig_module} \ |
276 | %{?with_select:--with-select_module} \ | |
4e61eac8 | 277 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \ |
278 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \ | |
279 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \ | |
056acc18 | 280 | --with-cc="%{__cc}" \ |
281 | --with-cc-opt="%{rpmcflags}" \ | |
282 | --with-ld-opt="%{rpmldflags}" \ | |
283 | %{?debug:--with-debug} | |
284 | %{__make} | |
4e61eac8 | 285 | mv -f objs/nginx contrib/nginx-mail |
056acc18 | 286 | %endif |
287 | ||
288 | %if %{with light} | |
056acc18 | 289 | ./configure \ |
290 | --prefix=%{_prefix} \ | |
4e61eac8 | 291 | --sbin-path=%{_sbindir}/%{name}-light \ |
292 | --conf-path=%{_sysconfdir}/%{name}-light.conf \ | |
293 | --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \ | |
294 | --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \ | |
295 | --pid-path=%{_localstatedir}/run/%{name}-light.pid \ | |
296 | --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \ | |
056acc18 | 297 | --user=nginx \ |
298 | --group=nginx \ | |
299 | %{?with_poll:--with-poll_module} \ | |
300 | %{?with_realip:--with-http_realip_module} \ | |
301 | %{?with_rtsig:--with-rtsig_module} \ | |
302 | %{?with_select:--with-select_module} \ | |
303 | %{?with_status:--with-http_stub_status_module} \ | |
304 | %{?with_ssl:--with-http_ssl_module} \ | |
305 | --without-http_browser_module \ | |
1a62642d | 306 | --without-mail_pop3_module \ |
307 | --without-mail_imap_module \ | |
308 | --without-mail_smtp_module \ | |
4e61eac8 | 309 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \ |
310 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \ | |
311 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \ | |
056acc18 | 312 | --with-cc="%{__cc}" \ |
313 | --with-cc-opt="%{rpmcflags}" \ | |
314 | --with-ld-opt="%{rpmldflags}" \ | |
315 | %{?debug:--with-debug} | |
316 | %{__make} | |
4e61eac8 | 317 | mv -f objs/nginx contrib/nginx-light |
056acc18 | 318 | %endif |
319 | ||
f9e65082 ER |
320 | ./configure \ |
321 | --prefix=%{_prefix} \ | |
226bcc40 | 322 | --sbin-path=%{_sbindir}/%{name}-standard \ |
f1686a52 | 323 | --conf-path=%{_sysconfdir}/%{name}-standard.conf \ |
226bcc40 | 324 | --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \ |
325 | --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \ | |
326 | --pid-path=%{_localstatedir}/run/%{name}-standard.pid \ | |
327 | --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \ | |
dfef7372 ER |
328 | --user=nginx \ |
329 | --group=nginx \ | |
d0c0492d | 330 | %{?with_addition:--with-http_addition_module} \ |
331 | %{?with_dav:--with-http_dav_module} \ | |
332 | %{?with_flv:--with-http_flv_module} \ | |
d6fc4b09 | 333 | %{?with_sub:--with-http_sub_module} \ |
d0c0492d | 334 | %{?with_poll:--with-poll_module} \ |
335 | %{?with_realip:--with-http_realip_module} \ | |
362f5ab2 | 336 | %{?with_rtsig:--with-rtsig_module} \ |
337 | %{?with_select:--with-select_module} \ | |
d0c0492d | 338 | %{?with_status:--with-http_stub_status_module} \ |
362f5ab2 | 339 | %{?with_ssl:--with-http_ssl_module} \ |
ee4f2132 | 340 | %{!?with_http_browser:--without-http_browser_module} \ |
226bcc40 | 341 | --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \ |
342 | --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \ | |
343 | --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \ | |
f9e65082 ER |
344 | --with-cc="%{__cc}" \ |
345 | --with-cc-opt="%{rpmcflags}" \ | |
346 | --with-ld-opt="%{rpmldflags}" \ | |
347 | %{?debug:--with-debug} | |
f9e65082 ER |
348 | %{__make} |
349 | ||
056acc18 | 350 | |
f9e65082 ER |
351 | %install |
352 | rm -rf $RPM_BUILD_ROOT | |
362f5ab2 | 353 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \ |
354 | $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \ | |
4e61eac8 | 355 | $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \ |
226bcc40 | 356 | $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \ |
357 | $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \ | |
28a25161 | 358 | $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \ |
359 | $RPM_BUILD_ROOT/etc/{logrotate.d,monit} | |
f9e65082 | 360 | |
7d80c773 | 361 | install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params |
57f21172 | 362 | install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf |
363 | install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win | |
364 | install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf | |
cd728db7 | 365 | install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html |
366 | install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors | |
226bcc40 | 367 | install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico |
368 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf | |
369 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
370 | install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types | |
0da077af | 371 | install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf |
372 | install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc | |
373 | install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard | |
de0bfb9b | 374 | install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard |
85600569 | 375 | |
376 | %if %{with light} | |
226bcc40 | 377 | install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf |
378 | install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc | |
0da077af | 379 | install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light |
4e61eac8 | 380 | install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light |
85600569 | 381 | %endif |
382 | ||
383 | %if %{with mail} | |
0da077af | 384 | install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf |
385 | install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc | |
386 | install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail | |
4e61eac8 | 387 | install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail |
85600569 | 388 | %endif |
389 | ||
390 | %if %{with perl} | |
391 | install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}} | |
0da077af | 392 | install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf |
393 | install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc | |
394 | install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl | |
d6fc4b09 | 395 | install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm |
396 | install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so | |
397 | install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs | |
4e61eac8 | 398 | install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl |
85600569 | 399 | %endif |
f9e65082 ER |
400 | |
401 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default | |
402 | rm -rf $RPM_BUILD_ROOT%{_prefix}/html | |
403 | ||
404 | %clean | |
405 | rm -rf $RPM_BUILD_ROOT | |
406 | ||
b0fa7cc6 | 407 | %pre |
a37373c3 | 408 | %groupadd -r -g 213 %{name} |
362f5ab2 | 409 | %groupadd -g 51 http |
a37373c3 | 410 | %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name} |
362f5ab2 | 411 | %addusertogroup %{name} http |
f1fc9780 | 412 | |
738166d2 | 413 | %post standard |
414 | for a in access.log error.log; do | |
415 | if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then | |
98376457 | 416 | umask 022 |
738166d2 | 417 | touch /var/log/%{name}/nginx-standard_$a |
1cf92547 | 418 | chown nginx:nginx /var/log/%{name}/nginx-standard_$a |
738166d2 | 419 | chmod 644 /var/log/%{name}/nginx-standard_$a |
420 | fi | |
421 | done | |
3d760264 ER |
422 | /sbin/chkconfig --add %{name}-standard |
423 | %service %{name}-standard restart | |
424 | echo 'NOTE: daemon is now using "/etc/nginx/nginx-standard.conf" as config.' | |
738166d2 | 425 | |
426 | %post light | |
427 | for a in access.log error.log; do | |
428 | if [ ! -f /var/log/%{name}/nginx-light_$a ]; then | |
98376457 | 429 | umask 022 |
738166d2 | 430 | touch /var/log/%{name}/nginx-light_$a |
431 | chown nginx:nginx /var/log/%{name}/nginx-light_$a | |
432 | chmod 644 /var/log/%{name}/nginx-light_$a | |
433 | fi | |
434 | done | |
3d760264 ER |
435 | /sbin/chkconfig --add %{name}-light |
436 | %service %{name}-light restart | |
57f21172 | 437 | echo 'NOTE: daemon is now using "/etc/nginx/nginx-light.conf" as config' |
738166d2 | 438 | |
439 | %post perl | |
440 | for a in access.log error.log; do | |
441 | if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then | |
98376457 | 442 | umask 022 |
738166d2 | 443 | touch /var/log/%{name}/nginx-perl_$a |
444 | chown nginx:nginx /var/log/%{name}/nginx-perl_$a | |
445 | chmod 644 /var/log/%{name}/nginx-perl_$a | |
446 | fi | |
447 | done | |
3d760264 ER |
448 | /sbin/chkconfig --add %{name}-perl |
449 | %service %{name}-perl restart | |
57f21172 | 450 | echo 'NOTE: daemon is now using "/etc/nginx/nginx-perl.conf" as config' |
738166d2 | 451 | |
452 | %post mail | |
362f5ab2 | 453 | for a in access.log error.log; do |
738166d2 | 454 | if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then |
98376457 | 455 | umask 022 |
738166d2 | 456 | touch /var/log/%{name}/nginx-mail_$a |
457 | chown nginx:nginx /var/log/%{name}/nginx-mail_$a | |
458 | chmod 644 /var/log/%{name}/nginx-mail_$a | |
362f5ab2 | 459 | fi |
460 | done | |
3d760264 ER |
461 | /sbin/chkconfig --add %{name}-mail |
462 | %service %{name}-mail restart | |
57f21172 | 463 | echo 'NOTE: daemon is now using "/etc/nginx/nginx-mail.conf" as config' |
f9e65082 | 464 | |
b0fa7cc6 | 465 | %preun standard |
7d80c773 | 466 | if [ "$1" = "0" ];then |
6eef4074 | 467 | %service %{name}-standard stop |
226bcc40 | 468 | /sbin/chkconfig --del %{name}-standard |
f9e65082 | 469 | fi |
f9e65082 | 470 | |
0663f9da | 471 | %preun light |
472 | if [ "$1" = "0" ]; then | |
6eef4074 | 473 | %service %{name}-light stop |
226bcc40 | 474 | /sbin/chkconfig --del %{name}-light |
0663f9da | 475 | fi |
476 | ||
477 | %preun perl | |
478 | if [ "$1" = "0" ]; then | |
6eef4074 | 479 | %service %{name}-perl stop |
226bcc40 | 480 | /sbin/chkconfig --del %{name}-perl |
0663f9da | 481 | fi |
482 | ||
483 | %preun mail | |
484 | if [ "$1" = "0" ]; then | |
6eef4074 | 485 | %service %{name}-mail stop |
226bcc40 | 486 | /sbin/chkconfig --del %{name}-mail |
0663f9da | 487 | fi |
488 | ||
b0fa7cc6 | 489 | %postun |
f1fc9780 | 490 | if [ "$1" = "0" ]; then |
7d9b86c7 ER |
491 | %userremove %{name} |
492 | %groupremove %{name} | |
f1fc9780 | 493 | fi |
494 | ||
f9e65082 ER |
495 | %files |
496 | %defattr(644,root,root,755) | |
6f8318ed | 497 | %doc CHANGES LICENSE README html/index.html conf/nginx.conf |
f9e65082 | 498 | %doc %lang(ru) CHANGES.ru |
f1fc9780 | 499 | %dir %attr(754,root,root) %{_sysconfdir} |
164ab75d | 500 | %dir %{_nginxdir} |
501 | %dir %{_nginxdir}/cgi-bin | |
502 | %dir %{_nginxdir}/html | |
503 | %dir %{_nginxdir}/errors | |
28a25161 | 504 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} |
98376457 | 505 | # XXX: duplicates, don't use such glob here |
57f21172 | 506 | #%attr(640,root,root) %{_sysconfdir}/*[_-]* |
98376457 | 507 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf |
394dc7b0 | 508 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params |
f1fc9780 | 509 | %attr(640,root,root) %{_sysconfdir}/mime.types |
57f21172 | 510 | %attr(640,root,root) %{_sysconfdir}/koi-utf |
511 | %attr(640,root,root) %{_sysconfdir}/koi-win | |
512 | %attr(640,root,root) %{_sysconfdir}/win-utf | |
fb1687bb | 513 | %attr(750,root,root) %dir /var/log/archive/%{name} |
f1fc9780 | 514 | %attr(750,%{name},logs) /var/log/%{name} |
475fecd1 | 515 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/* |
cd728db7 | 516 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/* |
28a25161 | 517 | |
b0fa7cc6 | 518 | %files standard |
519 | %defattr(644,root,root,755) | |
de0bfb9b | 520 | %attr(755,root,root) %{_sbindir}/%{name}-standard |
1846cd14 | 521 | %attr(770,root,%{name}) /var/cache/%{name}-standard |
0da077af | 522 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard |
4ddbebd7 | 523 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf |
b0fa7cc6 | 524 | |
85600569 | 525 | %if %{with mail} |
526 | %files mail | |
527 | %defattr(644,root,root,755) | |
4e61eac8 | 528 | %attr(755,root,root) %{_sbindir}/%{name}-mail |
1846cd14 | 529 | %attr(770,root,%{name}) /var/cache/%{name}-mail |
0da077af | 530 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail |
4ddbebd7 | 531 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf |
85600569 | 532 | %endif |
533 | ||
534 | %if %{with light} | |
535 | %files light | |
536 | %defattr(644,root,root,755) | |
4e61eac8 | 537 | %attr(755,root,root) %{_sbindir}/%{name}-light |
1846cd14 | 538 | %attr(770,root,%{name}) /var/cache/%{name}-light |
0da077af | 539 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-light |
4ddbebd7 | 540 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf |
85600569 | 541 | %endif |
542 | ||
543 | %if %{with perl} | |
544 | %files perl | |
545 | %defattr(644,root,root,755) | |
4e61eac8 | 546 | %attr(755,root,root) %{_sbindir}/%{name}-perl |
0da077af | 547 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl |
f7b57295 | 548 | %attr(770,root,%{name}) /var/cache/%{name}-perl |
1846cd14 | 549 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf |
85600569 | 550 | %dir %{perl_vendorarch}/auto/%{name} |
551 | %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so | |
98376457 JB |
552 | %{perl_vendorarch}/auto/%{name}/%{name}.bs |
553 | %{perl_vendorarch}/%{name}.pm | |
dd7459ac | 554 | %endif |
555 | ||
556 | %files -n monit-rc-nginx | |
557 | %defattr(644,root,root,755) | |
558 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc | |
559 | %if %{with perl} | |
1846cd14 | 560 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc |
85600569 | 561 | %endif |
dd7459ac | 562 | %if %{with light} |
563 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc | |
564 | %endif | |
565 | %if %{with mail} | |
566 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc | |
567 | %endif |