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