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