2 # - /etc/sysconfig/nginx file
3 # - prepare pld style like nginx.conf
4 # - split into nginx-common, nginx, nginx-perl packages
6 # Conditional build for nginx:
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
10 %bcond_without addition # adds module
11 %bcond_without dav # WebDAV
12 %bcond_without flv # FLV stream
13 %bcond_without poll # poll
14 %bcond_without realip # real ip (behind proxy)
15 %bcond_without rtsig # rtsig
16 %bcond_without select # select
17 %bcond_without status # stats module
18 %bcond_without ssl # ssl support
19 %bcond_with http_browser # header "User-agent" parser
21 Summary: High perfomance HTTP and reverse proxy server
22 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
27 Group: Networking/Daemons
28 Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
29 # Source0-md5: 0088269b8a59a146b0ba9c9ee29853bb
31 Source2: %{name}-mime.types.sh
32 Source3: http://www.nginx.eu/favicon.ico
33 # Source3-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
34 Source4: http://www.nginx.eu/download/proxy.conf
35 # Source4-md5: f5263ae01c2edb18f46d5d1df2d3a5cd
36 Source5: http://www.nginx.eu/download/%{name}.monitrc
37 # Source5-md5: 1d3f5eedfd34fe95213f9e0fc19daa88
38 Source6: http://www.nginx.eu/download/%{name}.conf
39 # Source6-md5: 1c112d6f03d0f365e4acc98c1d96261a
40 Source7: %{name}.logrotate
41 Patch0: %{name}-config.patch
42 URL: http://nginx.net/
43 BuildRequires: mailcap
44 BuildRequires: openssl-devel
45 BuildRequires: pcre-devel
46 %{?with_perl:BuildRequires: perl-devel}
47 BuildRequires: rpmbuild(macros) >= 1.268
48 BuildRequires: zlib-devel
49 Requires(post,preun): /sbin/chkconfig
50 Requires(postun): /usr/sbin/groupdel
51 Requires(postun): /usr/sbin/userdel
52 Requires(pre): /bin/id
53 Requires(pre): /usr/bin/getgid
54 Requires(pre): /usr/sbin/groupadd
55 Requires(pre): /usr/sbin/useradd
58 Requires: rc-scripts >= 0.2.0
61 Provides: group(nginx)
64 Conflicts: logrotate < 3.7-4
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 %define _sysconfdir /etc/%{name}
68 %define _nginxdir /home/services/%{name}
71 Nginx ("engine x") is a high-performance HTTP server and reverse
72 proxy, as well as an IMAP/POP3 proxy server. Nginx was written by Igor
73 Sysoev for Rambler.ru, Russia's second-most visited website, where it
74 has been running in production for over two and a half years. Igor has
75 released the source code under a BSD-like license. Although still in
76 beta, Nginx is known for its stability, rich feature set, simple
77 configuration, and low resource consumption.
79 %description -l pl.UTF-8
80 Nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
81 a także IMAP/POP3 proxy. Nginx został napisany przez Igora Sysoev'a
82 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
83 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
84 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
85 w fazie beta, już zasłynął dzieki stabilności, bogactwu dodatków,
86 prostej konfiguracji oraz małej "zasobożerności".
89 Summary: High perfomance HTTP and reverse proxy server
90 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
91 Group: Applications/System
92 Requires: nginx-common
94 Provides: group(nginx)
99 The smallest, but also the fastest nginx edition. No additional
100 modules, no perl support, no imap proxy
102 %description light -l pl.UTF-8
103 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla perla,
104 dodatkowych modulow oraz imap proxy
107 Summary: High perfomance HTTP and reverse proxy server
108 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
109 Group: Applications/System
110 Requires: nginx-common
111 Provides: group(http)
112 Provides: group(nginx)
113 Provides: user(nginx)
117 Nginx with perl support. Mail modules not included.
119 %description perl -l pl.UTF-8
120 Nignx z obsluga perla. Bez wsparcia dla modulow poczty.
123 Summary: High perfomance HTTP and reverse proxy server
124 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
125 Group: Applications/System
126 Requires: nginx-common
127 Provides: group(http)
128 Provides: group(nginx)
129 Provides: user(nginx)
133 Nginx with mail support. Only mail modules included.
135 %description mail -l pl.UTF-8
136 Nignx ze wsparciem tylko dla modulow poczty.
140 #Summary: Configuration files and documentation for Nginx
141 #Summary(pl.UTF-8): Pliki konfiguracyjne i dokumentacja dla Nginx
142 #Group: Networking/Daemons
144 %package -n monit-rc-nginx
145 Summary: Nginx support for monit
146 Summary(pl.UTF-8): Wsparcie nginx dla monit
147 Group: Applications/System
148 Requires: %{name} = %{version}-%{release}
151 %description -n monit-rc-nginx
152 monitrc file for monitoring nginx webserver server.
154 %description -n monit-rc-nginx -l pl.UTF-8
155 Plik monitrc do monitorowania serwera www nginx.
162 # build mime.types.conf
163 sh %{SOURCE2} /etc/mime.types
166 # NB: not autoconf generated configure
167 cp -f configure auto/
171 --prefix=%{_prefix} \
172 --sbin-path=%{_sbindir}/%{name} \
173 --conf-path=%{_sysconfdir}/%{name}.conf \
174 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
175 --pid-path=%{_localstatedir}/run/%{name}.pid \
176 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
179 --with-http_perl_module \
180 %{?with_addition:--with-http_addition_module} \
181 %{?with_dav:--with-http_dav_module} \
182 %{?with_flv:--with-http_flv_module} \
183 %{?with_poll:--with-poll_module} \
184 %{?with_realip:--with-http_realip_module} \
185 %{?with_rtsig:--with-rtsig_module} \
186 %{?with_select:--with-select_module} \
187 %{?with_status:--with-http_stub_status_module} \
188 %{?with_ssl:--with-http_ssl_module} \
189 %{!?with_http_browser:--without-http_browser_module} \
190 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
191 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
192 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
193 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
194 --with-cc="%{__cc}" \
195 --with-cc-opt="%{rpmcflags}" \
196 --with-ld-opt="%{rpmldflags}"
198 mv -f objs/nginx contrib/nginx.perl
204 --prefix=%{_prefix} \
205 --sbin-path=%{_sbindir}/%{name} \
206 --conf-path=%{_sysconfdir}/%{name}.conf \
207 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
208 --pid-path=%{_localstatedir}/run/%{name}.pid \
209 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
214 --with-mail_ssl_module \
215 %{?with_addition:--with-http_addition_module} \
216 %{?with_poll:--with-poll_module} \
217 %{?with_realip:--with-http_realip_module} \
218 %{?with_rtsig:--with-rtsig_module} \
219 %{?with_select:--with-select_module} \
220 %{!?with_http_browser:--without-http_browser_module} \
221 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
222 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
223 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
224 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
225 --with-cc="%{__cc}" \
226 --with-cc-opt="%{rpmcflags}" \
227 --with-ld-opt="%{rpmldflags}" \
228 %{?debug:--with-debug}
230 mv -f objs/nginx contrib/nginx.mail
236 --prefix=%{_prefix} \
237 --sbin-path=%{_sbindir}/%{name} \
238 --conf-path=%{_sysconfdir}/%{name}.conf \
239 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
240 --pid-path=%{_localstatedir}/run/%{name}.pid \
241 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
244 %{?with_poll:--with-poll_module} \
245 %{?with_realip:--with-http_realip_module} \
246 %{?with_rtsig:--with-rtsig_module} \
247 %{?with_select:--with-select_module} \
248 %{?with_status:--with-http_stub_status_module} \
249 %{?with_ssl:--with-http_ssl_module} \
250 --without-http_browser_module \
251 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
252 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
253 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
254 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
255 --with-cc="%{__cc}" \
256 --with-cc-opt="%{rpmcflags}" \
257 --with-ld-opt="%{rpmldflags}" \
258 %{?debug:--with-debug}
260 mv -f objs/nginx contrib/nginx.light
265 --prefix=%{_prefix} \
266 --sbin-path=%{_sbindir}/%{name} \
267 --conf-path=%{_sysconfdir}/%{name}.conf \
268 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
269 --pid-path=%{_localstatedir}/run/%{name}.pid \
270 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
273 %{?with_addition:--with-http_addition_module} \
274 %{?with_dav:--with-http_dav_module} \
275 %{?with_flv:--with-http_flv_module} \
276 %{?with_imap:--with-imap} \
277 %{?with_mail:--with-mail} \
278 %{?with_mail:--with-mail_ssl_module} \
279 %{?with_perl:--with-http_perl_module} \
280 %{?with_poll:--with-poll_module} \
281 %{?with_realip:--with-http_realip_module} \
282 %{?with_rtsig:--with-rtsig_module} \
283 %{?with_select:--with-select_module} \
284 %{?with_status:--with-http_stub_status_module} \
285 %{?with_ssl:--with-http_ssl_module} \
286 %{!?with_http_browser:--without-http_browser_module} \
287 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
288 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
289 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
290 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
291 --with-cc="%{__cc}" \
292 --with-cc-opt="%{rpmcflags}" \
293 --with-ld-opt="%{rpmldflags}" \
294 %{?debug:--with-debug}
299 rm -rf $RPM_BUILD_ROOT
300 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
301 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
302 $RPM_BUILD_ROOT{%{_localstatedir}/log/{%{name},archive/%{name}},%{_localstatedir}/cache/%{name}} \
303 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/%{name} \
304 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
305 $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}} \
306 $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
308 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
309 install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
310 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
311 install %{SOURCE3} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
312 install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
313 install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
314 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
315 install %{SOURCE5} $RPM_BUILD_ROOT/etc/monit/%{name}.monitrc
316 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf
317 install %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
318 install objs/src/http/modules/perl/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
319 install objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
320 install objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
321 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
323 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
324 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
327 rm -rf $RPM_BUILD_ROOT
330 %groupadd -r -g 213 %{name}
332 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
333 %addusertogroup %{name} http
336 for a in access.log error.log; do
337 if [ ! -f /var/log/%{name}/$a ]; then
338 touch /var/log/%{name}/$a
339 chown nginx:nginx /var/log/%{name}/$a
340 chmod 644 /var/log/%{name}/$a
343 /sbin/chkconfig --add %{name}
344 %service %{name} restart
347 if [ "$1" = "0" ]; then
348 %service -q %{name} stop
349 /sbin/chkconfig --del %{name}
353 if [ "$1" = "0" ]; then
359 %defattr(644,root,root,755)
360 %doc CHANGES LICENSE README html/index.html conf/nginx.conf objs/src/http/modules/perl/blib/man3/nginx.3pm
361 %doc %lang(ru) CHANGES.ru
362 %attr(754,root,root) /etc/rc.d/init.d/%{name}
363 %dir %attr(754,root,root) %{_sysconfdir}
365 %dir %{_nginxdir}/cgi-bin
366 %dir %{_nginxdir}/html
367 %dir %{_nginxdir}/errors
368 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
369 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
370 %attr(640,root,root) %{_sysconfdir}/*[_-]*
371 %attr(640,root,root) %{_sysconfdir}/proxy.conf
372 %attr(640,root,root) %{_sysconfdir}/mime.types
373 %attr(755,root,root) %{_sbindir}/%{name}
374 %dir %{perl_vendorarch}/auto/%{name}
375 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
376 %attr(700,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.bs
377 %attr(700,root,root) %{perl_vendorarch}/%{name}.pm
378 %attr(770,root,%{name}) /var/cache/%{name}
379 %attr(750,root,root) %dir /var/log/archive/%{name}
380 %attr(750,%{name},logs) /var/log/%{name}
381 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
382 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
384 %files -n monit-rc-nginx
385 %defattr(644,root,root,755)
386 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc