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