]> git.pld-linux.org Git - packages/nginx.git/blob - nginx.spec
- fix with missing desc
[packages/nginx.git] / nginx.spec
1 # TODO
2 # - /etc/sysconfig/nginx file
3 # - missing perl build/install requires
4 # - prepare pld style like nginx.conf
5 # - split into nginx-common, nginx, nginx-perl packages
6 #
7 # Conditional build for nginx:
8 %bcond_without  light           # don't build light version
9 %bcond_without  mail            # don't build imap/mail proxy
10 %bcond_without  perl            # don't build with perl module
11 %bcond_without  addition        # adds module
12 %bcond_without  dav             # WebDAV
13 %bcond_without  flv             # FLV stream
14 %bcond_without  poll            # poll
15 %bcond_without  realip          # real ip (behind proxy)
16 %bcond_without  rtsig           # rtsig
17 %bcond_without  select          # select
18 %bcond_without  status          # stats module
19 %bcond_without  ssl             # ssl support
20 %bcond_with     http_browser    # header "User-agent" parser
21 #
22 Summary:        High perfomance HTTP and reverse proxy server
23 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
24 Name:           nginx
25 Version:        0.5.33
26 Release:        0.2
27 License:        BSD-like
28 Group:          Networking/Daemons
29 Source0:        http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
30 # Source0-md5:  a78be74b4fd8e009545ef02488fcac86
31 Source1:        %{name}.init
32 Source2:        %{name}-mime.types.sh
33 Source3:        http://www.nginx.eu/favicon.ico
34 # Source3-md5:  2aaf2115c752cbdbfb8a2f0b3c3189ab
35 Source4:        http://www.nginx.eu/download/proxy.conf
36 # Source4-md5:  f5263ae01c2edb18f46d5d1df2d3a5cd
37 Source5:        http://www.nginx.eu/download/%{name}.monitrc
38 # Source5-md5:  1d3f5eedfd34fe95213f9e0fc19daa88
39 Source6:        http://www.nginx.eu/download/%{name}.conf
40 # Source6-md5:  1c112d6f03d0f365e4acc98c1d96261a
41 Source7:        %{name}.logrotate
42 Patch0:         %{name}-config.patch
43 URL:            http://nginx.net/
44 BuildRequires:  mailcap
45 BuildRequires:  openssl-devel
46 BuildRequires:  pcre-devel
47 %{?with_perl:BuildRequires: perl-CGI}
48 %{?with_perl:BuildRequires: perl-devel}
49 %{?with_perl:BuildRequires: rpm-perlprov}
50 BuildRequires:  rpmbuild(macros) >= 1.268
51 BuildRequires:  zlib-devel
52 Requires(post,preun):   /sbin/chkconfig
53 Requires(postun):       /usr/sbin/groupdel
54 Requires(postun):       /usr/sbin/userdel
55 Requires(pre):  /bin/id
56 Requires(pre):  /usr/bin/getgid
57 Requires(pre):  /usr/sbin/groupadd
58 Requires(pre):  /usr/sbin/useradd
59 Requires:       openssl
60 Requires:       pcre
61 Requires:       rc-scripts >= 0.2.0
62 Requires:       zlib
63 Provides:       group(http)
64 Provides:       group(nginx)
65 Provides:       user(nginx)
66 Provides:       webserver
67 Conflicts:      logrotate < 3.7-4
68 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69
70 %define         _sysconfdir     /etc/%{name}
71 %define         _nginxdir       /home/services/%{name}
72
73 %description
74 Nginx ("engine x") is a high-performance HTTP server and reverse
75 proxy, as well as an IMAP/POP3 proxy server. Nginx was written by Igor
76 Sysoev for Rambler.ru, Russia's second-most visited website, where it
77 has been running in production for over two and a half years. Igor has
78 released the source code under a BSD-like license. Although still in
79 beta, Nginx is known for its stability, rich feature set, simple
80 configuration, and low resource consumption.
81
82 %description -l pl.UTF-8
83 Nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
84 a także IMAP/POP3 proxy. Nginx został napisany przez Igora Sysoev'a
85 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
86 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
87 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
88 w fazie beta, już zasÅynÄÅ dzieki stabilnoÅi, bogactwu dodatków,
89 prostej konfiguracji oraz maÅej "zasobożernoÅi".
90
91 %package light
92 Summary:        High perfomance HTTP and reverse proxy server
93 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
94 Group:          Applications/System
95 Requires:       nginx-common
96 Provides:       group(http)
97 Provides:       group(nginx)
98 Provides:       user(nginx)
99 Provides:       webserver
100
101 %description light
102 The smallest, but also the fastest nginx edition. No additional
103 modules, no perl support, no imap, pop3, smtp proxy
104
105 %description light -l pl.UTF-8
106 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla perla,
107 dodatkowych modulow oraz imap, pop3, smtp proxy
108
109 %package perl
110 Summary:        High perfomance HTTP and reverse proxy server
111 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
112 Group:          Applications/System
113 Requires:       nginx-common
114 Requires:       perl-mod_%{mod_name} = %{epoch}:%{version}-%{release}
115 Provides:       group(http)
116 Provides:       group(nginx)
117 Provides:       user(nginx)
118 Provides:       webserver
119
120 %description perl
121 Nginx with perl support. Mail modules not included.
122
123 %description perl -l pl.UTF-8
124 Nignx z obsluga perla. Bez wsparcia dla modulow poczty.
125
126 %package mail
127 Summary:        High perfomance HTTP and reverse proxy server
128 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
129 Group:          Applications/System
130 Requires:       nginx-common
131 Provides:       group(http)
132 Provides:       group(nginx)
133 Provides:       user(nginx)
134 Provides:       webserver
135
136 %description mail
137 Nginx with mail support. Only mail modules included.
138
139 %description mail -l pl.UTF-8
140 Nignx ze wsparciem tylko dla modulow poczty.
141
142
143 %package common
144 Summary:        Configuration files and documentation for Nginx
145 Summary(pl.UTF-8):      Pliki konfiguracyjne i dokumentacja dla Nginx
146 Group:          Networking/Daemons
147
148 %description common
149 Common files for nginx daemon
150
151 %description common -l pl.UTF-8
152 Niezbedne pliki dla nginx
153 %package -n monit-rc-nginx
154 Summary:        Nginx  support for monit
155 Summary(pl.UTF-8):      Wsparcie nginx dla monit
156 Group:          Applications/System
157 Requires:       %{name} = %{version}-%{release}
158 Requires:       monit
159
160 %description -n monit-rc-nginx
161 monitrc file for monitoring nginx webserver server.
162
163 %description -n monit-rc-nginx -l pl.UTF-8
164 Plik monitrc do monitorowania serwera www nginx.
165
166
167 %prep
168 %setup -q
169 %patch0 -p0
170
171 # build mime.types.conf
172 sh %{SOURCE2} /etc/mime.types
173
174 %build
175 # NB: not autoconf generated configure
176 cp -f configure auto/
177 #
178 %if %{with perl}
179 ./configure \
180         --prefix=%{_prefix} \
181         --sbin-path=%{_sbindir}/%{name} \
182         --conf-path=%{_sysconfdir}/%{name}.conf \
183         --error-log-path=%{_localstatedir}/log/%{name}/error.log \
184         --pid-path=%{_localstatedir}/run/%{name}.pid \
185         --lock-path=%{_localstatedir}/lock/subsys/%{name} \
186         --user=nginx \
187         --group=nginx \
188         --enable-fastcgi \
189         --with-http_perl_module \
190         --without-mail_pop3_module \
191         --without-mail_imap_module \
192         --without-mail_smtp_module \
193         %{?with_addition:--with-http_addition_module} \
194         %{?with_dav:--with-http_dav_module} \
195         %{?with_flv:--with-http_flv_module} \
196         %{?with_poll:--with-poll_module} \
197         %{?with_realip:--with-http_realip_module} \
198         %{?with_rtsig:--with-rtsig_module} \
199         %{?with_select:--with-select_module} \
200         %{?with_status:--with-http_stub_status_module} \
201         %{?with_ssl:--with-http_ssl_module} \
202         %{!?with_http_browser:--without-http_browser_module} \
203         --http-log-path=%{_localstatedir}/log/%{name}/access.log \
204         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
205         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
206         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
207         --with-cc="%{__cc}" \
208         --with-cc-opt="%{rpmcflags}" \
209         --with-ld-opt="%{rpmldflags}"
210 %{__make}
211 mv -f objs/nginx contrib/nginx.perl
212 %endif
213
214 %if %{with mail}
215 %{__make} clean
216 ./configure \
217         --prefix=%{_prefix} \
218         --sbin-path=%{_sbindir}/%{name} \
219         --conf-path=%{_sysconfdir}/%{name}.conf \
220         --error-log-path=%{_localstatedir}/log/%{name}/error.log \
221         --pid-path=%{_localstatedir}/run/%{name}.pid \
222         --lock-path=%{_localstatedir}/lock/subsys/%{name} \
223         --user=nginx \
224         --group=nginx \
225         --with-imap \
226         --with-mail \
227         --with-mail_ssl_module \
228         %{?with_addition:--with-http_addition_module} \
229         %{?with_poll:--with-poll_module} \
230         %{?with_realip:--with-http_realip_module} \
231         %{?with_rtsig:--with-rtsig_module} \
232         %{?with_select:--with-select_module} \
233         %{!?with_http_browser:--without-http_browser_module} \
234         --http-log-path=%{_localstatedir}/log/%{name}/access.log \
235         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
236         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
237         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
238         --with-cc="%{__cc}" \
239         --with-cc-opt="%{rpmcflags}" \
240         --with-ld-opt="%{rpmldflags}" \
241         %{?debug:--with-debug}
242 %{__make}
243 mv -f objs/nginx contrib/nginx.mail
244 %endif
245
246 %if %{with light}
247 %{__make} clean
248 ./configure \
249         --prefix=%{_prefix} \
250         --sbin-path=%{_sbindir}/%{name} \
251         --conf-path=%{_sysconfdir}/%{name}.conf \
252         --error-log-path=%{_localstatedir}/log/%{name}/error.log \
253         --pid-path=%{_localstatedir}/run/%{name}.pid \
254         --lock-path=%{_localstatedir}/lock/subsys/%{name} \
255         --user=nginx \
256         --group=nginx \
257         %{?with_poll:--with-poll_module} \
258         %{?with_realip:--with-http_realip_module} \
259         %{?with_rtsig:--with-rtsig_module} \
260         %{?with_select:--with-select_module} \
261         %{?with_status:--with-http_stub_status_module} \
262         %{?with_ssl:--with-http_ssl_module} \
263         --without-http_browser_module \
264         --without-mail_pop3_module \
265         --without-mail_imap_module \
266         --without-mail_smtp_module \
267         --http-log-path=%{_localstatedir}/log/%{name}/access.log \
268         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
269         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
270         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
271         --with-cc="%{__cc}" \
272         --with-cc-opt="%{rpmcflags}" \
273         --with-ld-opt="%{rpmldflags}" \
274         %{?debug:--with-debug}
275 %{__make}
276 mv -f objs/nginx contrib/nginx.light
277 %endif
278
279 %{__make} clean
280 ./configure \
281         --prefix=%{_prefix} \
282         --sbin-path=%{_sbindir}/%{name} \
283         --conf-path=%{_sysconfdir}/%{name}.conf \
284         --error-log-path=%{_localstatedir}/log/%{name}/error.log \
285         --pid-path=%{_localstatedir}/run/%{name}.pid \
286         --lock-path=%{_localstatedir}/lock/subsys/%{name} \
287         --user=nginx \
288         --group=nginx \
289         %{?with_addition:--with-http_addition_module} \
290         %{?with_dav:--with-http_dav_module} \
291         %{?with_flv:--with-http_flv_module} \
292         %{?with_imap:--with-imap} \
293         %{?with_mail:--with-mail} \
294         %{?with_mail:--with-mail_ssl_module} \
295         %{?with_perl:--with-http_perl_module} \
296         %{?with_poll:--with-poll_module} \
297         %{?with_realip:--with-http_realip_module} \
298         %{?with_rtsig:--with-rtsig_module} \
299         %{?with_select:--with-select_module} \
300         %{?with_status:--with-http_stub_status_module} \
301         %{?with_ssl:--with-http_ssl_module} \
302         %{!?with_http_browser:--without-http_browser_module} \
303         --http-log-path=%{_localstatedir}/log/%{name}/access.log \
304         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
305         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
306         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
307         --with-cc="%{__cc}" \
308         --with-cc-opt="%{rpmcflags}" \
309         --with-ld-opt="%{rpmldflags}" \
310         %{?debug:--with-debug}
311 %{__make}
312
313
314 %install
315 rm -rf $RPM_BUILD_ROOT
316 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
317         $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
318         $RPM_BUILD_ROOT{%{_localstatedir}/log/{%{name},archive/%{name}},%{_localstatedir}/cache/%{name}} \
319         $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/%{name} \
320         $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
321         $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}} \
322         $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
323
324 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
325 install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
326 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
327 install %{SOURCE3} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
328 install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
329 install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
330 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
331 install %{SOURCE5} $RPM_BUILD_ROOT/etc/monit/%{name}.monitrc
332 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf
333 install %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
334 install objs/src/http/modules/perl/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
335 install objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
336 install objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
337 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
338
339 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
340 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
341
342 %clean
343 rm -rf $RPM_BUILD_ROOT
344
345 %pre
346 %groupadd -r -g 213 %{name}
347 %groupadd -g 51 http
348 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
349 %addusertogroup %{name} http
350
351 %post
352 for a in access.log error.log; do
353         if [ ! -f /var/log/%{name}/$a ]; then
354                 touch /var/log/%{name}/$a
355                 chown nginx:nginx /var/log/%{name}/$a
356                 chmod 644 /var/log/%{name}/$a
357         fi
358 done
359 /sbin/chkconfig --add %{name}
360 %service %{name} restart
361
362 %preun
363 if [ "$1" = "0" ]; then
364         %service -q %{name} stop
365         /sbin/chkconfig --del %{name}
366 fi
367
368 %postun
369 if [ "$1" = "0" ]; then
370         %userremove %{name}
371         %groupremove %{name}
372 fi
373
374 %files
375 %defattr(644,root,root,755)
376 %doc CHANGES LICENSE README html/index.html conf/nginx.conf objs/src/http/modules/perl/blib/man3/nginx.3pm
377 %doc %lang(ru) CHANGES.ru
378 %attr(754,root,root) /etc/rc.d/init.d/%{name}
379 %dir %attr(754,root,root) %{_sysconfdir}
380 %dir %{_nginxdir}
381 %dir %{_nginxdir}/cgi-bin
382 %dir %{_nginxdir}/html
383 %dir %{_nginxdir}/errors
384 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
385 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
386 %attr(640,root,root) %{_sysconfdir}/*[_-]*
387 %attr(640,root,root) %{_sysconfdir}/proxy.conf
388 %attr(640,root,root) %{_sysconfdir}/mime.types
389 %attr(755,root,root) %{_sbindir}/%{name}
390 %dir %{perl_vendorarch}/auto/%{name}
391 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
392 %attr(700,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.bs
393 %attr(700,root,root) %{perl_vendorarch}/%{name}.pm
394 %attr(770,root,%{name}) /var/cache/%{name}
395 %attr(750,root,root) %dir /var/log/archive/%{name}
396 %attr(750,%{name},logs) /var/log/%{name}
397 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
398 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
399
400 %files -n monit-rc-nginx
401 %defattr(644,root,root,755)
402 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc
This page took 0.084496 seconds and 4 git commands to generate.