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